[solved]Make music continue on main menu when the game ends

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

[solved]Make music continue on main menu when the game ends

#1 Post by WillandBran »

Hello !!

I want to have a music keep going in the main menu when the game ends.
As in, the music at the end of my visual novel is the same as the main_menu music.
But, right now when it ends, the music just start over from the beginning, where I would like it to just seemlessly keep playing as the transition happen.

Right now, to display the music on the main_menu, I use this code :

on "show" action Play("music", "gui/pres_de_toi.ogg")
Last edited by WillandBran on Fri Nov 20, 2020 10:31 am, edited 1 time in total.

User avatar
Vladya
Regular
Posts: 34
Joined: Sun Sep 20, 2020 3:16 am
Github: NyashniyVladya
Contact:

Re: Make music continue on main menu when the game ends

#2 Post by Vladya »

Pass to "Play" class the argument if_changed with the value True.

Code: Select all

on "show" action Play("music", "gui/pres_de_toi.ogg", if_changed=True)
https://www.renpy.org/doc/html/audio.ht ... music.play

WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

Re: Make music continue on main menu when the game ends

#3 Post by WillandBran »

Thanks for your response!
Unfortunately, I tried using this code... but it didn't work T.T

User avatar
Vladya
Regular
Posts: 34
Joined: Sun Sep 20, 2020 3:16 am
Github: NyashniyVladya
Contact:

Re: Make music continue on main menu when the game ends

#4 Post by Vladya »

Hmm... Have you performed any manipulations with config.main_menu_music variable?
If it is not set, Ren'Py will automatically call renpy.music.stop before initializing the menu.

If all you want is for the music to continue playing, set your song to config.main_menu_music and remove the Play() line at all. Behavior with a preset if_changed for config.main_menu_music is defined by default by the engine.

WillandBran
Regular
Posts: 26
Joined: Fri Sep 08, 2017 8:18 am
Contact:

Re: Make music continue on main menu when the game ends

#5 Post by WillandBran »

Ho !! It's working !!
Thanks a lot !

Post Reply

Who is online

Users browsing this forum: No registered users