Page 1 of 1

Music won't play after loading

Posted: Fri Nov 26, 2021 12:26 am
by HighlightKing
Hey there!

So my issue is, the following:
You play (music_1 is playing), you reach a choice menu (music_3 starts to play), you make a choice, keep on playing and reach a scene, where music_ 1 starts to play again. Works perfectly, except... if I load a save file that was made BEFORE the choice menu, where music_3 starts, when I reach the choice menu, it won't play.

Now I tried having music_3 start before the choice menu, but it's the same result. If the save file is from BEFORE music_ starts, it won't play when you reach it. There are other music changes that work fine when loaded, except this one.
And with this one, just like with the the rest, the music that's supposed to play is defined right there.

So since this description is somewhat vague, here is my question. What could cause this:

$ renpy.music.play("audio/music_3.mp3", channel='music3', loop=True, fadeout=2, synchro_start=True, fadein=2, tight=None, if_changed=False)
$ renpy.music.set_volume(0.55, 4, channel = "music3")
$ renpy.music.set_volume(0, 4, channel = "music")

to not work, if after a load you reach it in the script? But again, if you play a clean play-through, it works fine.
It's odd that it's possible for the game to reach the code above after loading a save, and just ignore it for some reason.
(Also tried if music_3 is on a channel that hasn't even been used before, like "music5"... same result.)

Thank you for any possible suggestions/ideas.

Re: Music won't play after loading

Posted: Sun Nov 28, 2021 4:10 pm
by papillon
ISTR I had some weird issues occasionally with music after load because renpy would sometimes think the track was already playing, even though it wasn't, and therefore not start it. This was in a game that was using a lot of queuing though.

Have you tried putting in some notifications or popups to test that your code lines are being run and to figure out what music renpy THINKS is playing?

Re: Music won't play after loading

Posted: Sun Nov 28, 2021 6:37 pm
by PyTom
papillon wrote:
Sun Nov 28, 2021 4:10 pm
ISTR I had some weird issues occasionally with music after load because renpy would sometimes think the track was already playing, even though it wasn't, and therefore not start it. This was in a game that was using a lot of queuing though.
There's a relatively recent fix that might be relevant to this issue, which turned out to be related to the audio channels not necessarily being assigned the same numbers when the game reloads.