Jump to content
×
×
  • Create New...

NPC Voice Quest System


Recommended Posts

  • Moon

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 :P

 

Kind Regards

HaveBeen

  • Metin2 Dev 3
  • Love 17
  • Good 3
  • Lmao 1
  • Confused 1

Plain logic saves lives.

Link to comment
Share on other sites

  • 1 month later...
  • Premium
0606 20:10:08789 :: invalid idx 0
0606 20:11:47591 :: Traceback (most recent call last):
 
0606 20:11:47592 ::   File "networkModule.py", line 237, in SetGamePhase
 
0606 20:11:47592 ::   File "system.py", line 130, in __pack_import
 
0606 20:11:47593 ::   File "
0606 20:11:47593 :: game.py
0606 20:11:47593 :: ", line 
0606 20:11:47593 :: 2406
0606 20:11:47593 :: 
 
0606 20:11:47593 ::     
0606 20:11:47593 :: x, y, z = player.GetMainCharacterPosition()
 
0606 20:11:47593 ::     
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 :: ^
 
0606 20:11:47595 :: IndentationError
0606 20:11:47595 :: : 
0606 20:11:47595 :: unindent does not match any outer indentation level
0606 20:11:47595 :: 
 
Link to comment
Share on other sites

 

0606 20:10:08789 :: invalid idx 0
0606 20:11:47591 :: Traceback (most recent call last):
 
0606 20:11:47592 ::   File "networkModule.py", line 237, in SetGamePhase
 
0606 20:11:47592 ::   File "system.py", line 130, in __pack_import
 
0606 20:11:47593 ::   File "
0606 20:11:47593 :: game.py
0606 20:11:47593 :: ", line 
0606 20:11:47593 :: 2406
0606 20:11:47593 :: 
 
0606 20:11:47593 ::     
0606 20:11:47593 :: x, y, z = player.GetMainCharacterPosition()
 
0606 20:11:47593 ::     
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47593 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 ::  
0606 20:11:47594 :: ^
 
0606 20:11:47595 :: IndentationError
0606 20:11:47595 :: : 
0606 20:11:47595 :: unindent does not match any outer indentation level
0606 20:11:47595 :: 

 

 

As sysser said you have and indetation error.

Use tab

 

Link to comment
Share on other sites

  • 6 months later...
  • Former Staff

What am i doing wrong?

 

1209 15:33:23542 :: File "game.py", line 2280, in __ServerCommand_Build

1209 15:33:23542 :: AttributeError
1209 15:33:23542 :: :
1209 15:33:23542 :: 'GameWindow' object has no attribute 'GiveMeVoice'
1209 15:33:23542 ::

Link to comment
Share on other sites

  • 5 months later...
snd.PlaySound3D(x+randX, -y+randY, z, "sound/npcs/" +  str(voice) + ".mp3")

"sound/npcs/" + str(voice) + ".mp3"

^- Up there, for every NPC which was asked inside a quest, the MP3 File equivalent to the value of the mob_proto of MySQL is playing then.

 

Just put the file you want to add into that folder: "sound/npcs"

If it doesn't exist, just create it. But first of all you need to extract the sound.epk/eix archive(s).

 

E.g.: If you want the NPC 9003 to play an Mp3, you simply need to rename your .mp3 file to 9003.mp3 -> Go ahead and copy it to this directory: "sound/npcs"

 

Unterstood the principe? 

If not don't hessitate to ask questions :)

Link to comment
Share on other sites

  • 3 years later...
  • 3 weeks later...
  • 4 weeks later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.