Jump to content

Two music are playing at the same time.


Go to solution Solved by meneleos,

Recommended Posts

  • Honorable Member

 

Hello, I found a problem with music. Perhaps someone will know the solution.
When you type the command /xmas_snow 1, the music changes to Christmas. When you teleport at least twice, the Christmas music will mix with the standard music. Two music will be played at the same time.

This is a problem that occurs for many people. It is not my personal problem.

Edited by Tatsumaru

GhwYizE.gif

Link to comment
Share on other sites

  • Active Member

This is the hidden content, please

By commenting this line, you will disable xmas song, because the function, which have to play this music, when the command is used, never worked properly. In most sources this music is resetted on teleport or disabled or you have the bug mentioned above.

Edited by ReFresh
  • Metin2 Dev 15
  • Think 1
  • Good 1
  • Love 7

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Solution

in game.py
find this:
 


		netFieldMusicFileName = m2netm2g.GetFieldMusicFileName()
		if netFieldMusicFileName:
			snd.FadeInMusic("BGM/" + netFieldMusicFileName)
		elif musicInfo.fieldMusic != "":
			snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

change:
 


		if (musicInfo.fieldMusic != "xmas.mp3"):
			netFieldMusicFileName = m2netm2g.GetFieldMusicFileName()
			if netFieldMusicFileName:
				snd.FadeInMusic("BGM/" + netFieldMusicFileName)
			elif musicInfo.fieldMusic != "":
				snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

 

finally;


https://metin2.download/video/9q1V0kLfanfDv4AXJq80EL2Ykrc6F05o/.mp4

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

  • Honorable Member
14 hours ago, meneleos said:

in game.py
find this:
 


		netFieldMusicFileName = m2netm2g.GetFieldMusicFileName()
		if netFieldMusicFileName:
			snd.FadeInMusic("BGM/" + netFieldMusicFileName)
		elif musicInfo.fieldMusic != "":
			snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

change:
 


		if (musicInfo.fieldMusic != "xmas.mp3"):
			netFieldMusicFileName = m2netm2g.GetFieldMusicFileName()
			if netFieldMusicFileName:
				snd.FadeInMusic("BGM/" + netFieldMusicFileName)
			elif musicInfo.fieldMusic != "":
				snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

 

finally;


https://metin2.download/video/9q1V0kLfanfDv4AXJq80EL2Ykrc6F05o/.mp4

This solution fixes the music problem, but after strong consideration I conclude that it is probably better to disable this option altogether. One Christmas music played over and over in every location is not a good idea. Nevertheless, thank you for the solutions and your time gentlemen's.

Edited by Metin2 Dev
Core X - External 2 Internal

GhwYizE.gif

Link to comment
Share on other sites

  • 1 year later...
  • Active+ Member
On 7/14/2022 at 3:13 AM, Tatsumaru said:

This solution fixes the music problem, but after strong consideration I conclude that it is probably better to disable this option altogether. One Christmas music played over and over in every location is not a good idea. Nevertheless, thank you for the solutions and your time gentlemen's.

you could create a list of christmas songs, and make them randomize everytime you login. 

spacer.png

Link to comment
Share on other sites

  • 4 months later...

Just a logic problem, because GetFieldMusicFileName always returns a non-empty value. There is probably a default music name on the server.

If there is no custom music selection, to play the default

Find in game.py

		netFieldMusicFileName = net.GetFieldMusicFileName()
		if netFieldMusicFileName:
			snd.FadeInMusic("BGM/" + netFieldMusicFileName)
		elif musicInfo.fieldMusic != "":
			snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

Replace with;

		netFieldMusicFileName = net.GetFieldMusicFileName()
		if musicInfo.fieldMusic != "":
			snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
		elif netFieldMusicFileName:
			snd.FadeInMusic("BGM/" + netFieldMusicFileName)

 

Im machine.

Link to comment
Share on other sites

  • Active+ Member
2 hours ago, ggns7 said:

Just a logic problem, because GetFieldMusicFileName always returns a non-empty value. There is probably a default music name on the server.

If there is no custom music selection, to play the default

Find in game.py

		netFieldMusicFileName = net.GetFieldMusicFileName()
		if netFieldMusicFileName:
			snd.FadeInMusic("BGM/" + netFieldMusicFileName)
		elif musicInfo.fieldMusic != "":
			snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

Replace with;

		netFieldMusicFileName = net.GetFieldMusicFileName()
		if musicInfo.fieldMusic != "":
			snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
		elif netFieldMusicFileName:
			snd.FadeInMusic("BGM/" + netFieldMusicFileName)

 

yeah but if you do this, the song will save for all maps and wont reset..

 

If you set enter_the_east from music and change maps, enter_the_East will be for Desert as well for example

Edited by HFWhite

spacer.png

Link to comment
Share on other sites

  • Active+ Member
19 minutes ago, ggns7 said:

It will reset when you deactivate the Xmas event. It is also expected to work on all maps.

shouldn't you write it like this then? because now it acts like this for all songs..

 

        if (musicInfo.fieldMusic == "xmas.mp3"):
			netFieldMusicFileName = net.GetFieldMusicFileName()
			if musicInfo.fieldMusic != "":
				snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
			elif netFieldMusicFileName:
				snd.FadeInMusic("BGM/" + netFieldMusicFileName)
		else:
            netFieldMusicFileName = net.GetFieldMusicFileName()
            if netFieldMusicFileName:
                snd.FadeInMusic("BGM/" + netFieldMusicFileName)
            elif musicInfo.fieldMusic != "":
                snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

 

spacer.png

Link to comment
Share on other sites

7 minutes ago, HFWhite said:

shouldn't you write it like this then? because now it acts like this for all songs..

 

        if (musicInfo.fieldMusic == "xmas.mp3"):
			netFieldMusicFileName = net.GetFieldMusicFileName()
			if musicInfo.fieldMusic != "":
				snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
			elif netFieldMusicFileName:
				snd.FadeInMusic("BGM/" + netFieldMusicFileName)
		else:
            netFieldMusicFileName = net.GetFieldMusicFileName()
            if netFieldMusicFileName:
                snd.FadeInMusic("BGM/" + netFieldMusicFileName)
            elif musicInfo.fieldMusic != "":
                snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

 

No, this is very useless, you are writing specific code. It should be flexible.

Edited by ggns7

Im machine.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

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.