M2 Download Center
Download Here ( Internal )
Hi guys. someone wanna voice for npcs but they are not know how to make this system and i wanna share with your
I hope you are like it.
First client;
open game.py and search this after under add this
"mall" : self.__InGameShop_Show,
"voice" : self.GiveMeVoice,
Add this
def GiveMeVoice(self,voice):
x, y, z = player.GetMainCharacterPosition()
randX = app.GetRandom(-150, 150)
randY = app.GetRandom(-150, 150)
snd.PlaySound3D(x+randX, -y+randY, z, "sound/npcs/" + str(voice) + ".mp3")
How to use this function in my quest?
quest voice begin
state start begin
when 20354.chat."Give me a voice" begin
cmdchat("voice "..npc.get_race())
say("I'm say this feeling really perfect.. ")
say("")
end
end
end
Why i use to snd.PlaySound3D? Why not snd.FadeInMusic?
Let me i explain to your. snd.FadeInMusic just change music so i mean if i use to this function in function, when sound is finished sound is started again until player change music..
snd.PlaySound3D when sound is finished, sound not started again
Kind Regards
HaveBeen