def setChat(self, chat): self.clearChatbox() Avatar.setChat(self, chat) self.chat = chat chatDial = None questionDial = self.voice.getSoundFile('question') question02Dial = None gruntDial = self.voice.getSoundFile('grunt') statementDial = self.voice.getSoundFile('statement') if self.voice == Voice.NORMAL: question02Dial = self.voice.getSoundFile('question_2') if '!' in self.chat: chatDial = self.audio3d.loadSfx(gruntDial) elif '?' in self.chat: questionDials = [questionDial] if self.voice == Voice.NORMAL: questionDials.append(question02Dial) chatDial = self.audio3d.loadSfx(random.choice(questionDials)) else: chatDial = self.audio3d.loadSfx(statementDial) self.chatDial = chatDial if self.variant == Variant.SKELETON: self.audio3d.attachSoundToObject(self.chatDial, self) else: self.audio3d.attachSoundToObject(self.chatDial, self.headModel) base.playSfx(self.chatDial, node=self)
def setChat(self, chat): Avatar.setChat(self, chat)