Change main menu music during the game? [Solved]
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.
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.
Change main menu music during the game? [Solved]
I can use persistent in screen so I can use different main menu pictures when I reach the different endings or points in the story... but I also want to change the menu music and I've tried all, but no one worked, if I set one specific music it won't change because an if/else statement... I don't know what to do, I need help
Thank you
Thank you
Last edited by Hipi on Sat Sep 01, 2018 8:42 am, edited 1 time in total.
Re: Change main menu music during the game?
Random play music menu:
Option.rpy
define config.main_menu_music = renpy.random.shuffle(["music1.mp3", "music2.mp3", "music3.mp3", "music4.mp3"] )
Persistent:
Option.rpy
define config.main_menu_music = "heppiend" + persistent.last_t + ".ogg"
else
$ config.main_menu_music = "heppiend" + persistent.last_t + ".ogg
Last_t =1 will be heppiend1.ogg
Option.rpy
define config.main_menu_music = renpy.random.shuffle(["music1.mp3", "music2.mp3", "music3.mp3", "music4.mp3"] )
Persistent:
Option.rpy
define config.main_menu_music = "heppiend" + persistent.last_t + ".ogg"
else
$ config.main_menu_music = "heppiend" + persistent.last_t + ".ogg
Last_t =1 will be heppiend1.ogg
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Re: Change main menu music during the game?
I have this error:
"coercing to Unicode: need string or buffer, NoneType found"
I tried putting persistant.menu = 1 and ="1" and none worked
"coercing to Unicode: need string or buffer, NoneType found"
I tried putting persistant.menu = 1 and ="1" and none worked
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Change main menu music during the game?
There are several ways... Here one of them (Classical).
in options.rpy:
Code: Select all
define config.main_menu_music = None
Code: Select all
label main_menu:
if persistent.musicon:
$ renpy.music.play('new_music.mp3', channel='music', loop=True)
else:
$ renpy.music.play('old_music.mp3', channel='music', loop=True)
jump main_menu_screen
Code: Select all
$ persistent.musicon = True / False
Re: Change main menu music during the game?
main_menu_screen is just an example? I have a label splashscreen, I tried doing this:
It works the change of music but... it starts the game immediately instead of enter in the main menu screen
Code: Select all
label splashscreen:
scene black
with Pause (1.5)
show splash with dissolve
with Pause(1.2)
jump main_menu
label main_menu:
if persistent.musicon:
$ renpy.music.play("tl/menu2.mp3", channel='music', loop=True)
else:
$ renpy.music.play("tl/menu1.mp3", channel='music', loop=True)
return
- MaydohMaydoh
- Regular
- Posts: 165
- Joined: Mon Jul 09, 2018 5:49 am
- Projects: Fuwa Fuwa Panic
- Tumblr: maydohmaydoh
- Location: The Satellite of Love
- Contact:
Re: Change main menu music during the game?
Use the label "before_main_menu" instead.
Re: Change main menu music during the game?
Thank you, it worked!!
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Change main menu music during the game?
No. The special label's name, like before_main_menu
splashscreen's block must be ended with return, not jump.
Here several examples: https://www.renpy.org/wiki/renpy/doc/co ... lashscreen
And this most important
Who is online
Users browsing this forum: Alex, Majestic-12 [Bot], piinkpuddiin