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
https://metin2.dev/topic/29307-two-music-are-playing-at-the-same-time/
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 18
  • Think 1
  • Good 2
  • Love 7

I'll be always helpful!  😉

  • 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
  • Active+ Member

@meneleosIt won't work. Try to disable xmas_snow, restart the client and log in. No music will play, because of lastplay.inf file, from which is the music read. The xmas.mp3 will be saved there.

Edited by ReFresh

I'll be always helpful!  😉

  • 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

  • 1 year later...
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. 

  • 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.

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
6 minutes ago, HFWhite said:

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

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

Edited by ggns7

Im machine.

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)

 

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.

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.