Renpy's music issues

The Narrator

Newbie
Game Developer
Nov 14, 2023
63
103
Hi, I have a problem with the music in my game.
I added a music controller to my mod and when I change the song from it and close the mod, it goes back to the previous song.
Please help!
I will post the rpy file
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,130
14,809
I added a music controller to my mod and when I change the song from it and close the mod, it goes back to the previous song.
The music is changed in the screen "mp3", that is included in the screen "Caracters", that is included in the screen "caractergame_menu" that itself looks like a screen opened from the main menu.

You are changing the music at the main menu context level. The change you make is only valid as long as Ren'Py stay in that context, or in any lower context level created after that change. But when you close the screen, you leave that context and return to a lower context created before the change. What make the music fall back to what was previously played.

The "mp3" screen should only be available directly from the game context, either by being directly available from the UI, or by opening (as normal modal screen) through a button available from the UI.