Multiple main menu music?

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
User avatar
quacksapup
Regular
Posts: 48
Joined: Fri Jan 04, 2013 3:43 pm
Projects: "Heartbeat" (In Progress)
Contact:

Multiple main menu music?

#1 Post by quacksapup »

Hey guys,

Is it possible to change the default music just like you can change the main menu background? I have multiple backgrounds for when more characters role in, and each background has its own music. Also, is there a way to save the music box settings so that the default song doesn't always play each time the game is opened/you return to the main menu?

Thanks!

User avatar
Hijiri
Eileen-Class Veteran
Posts: 1519
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Re: Multiple main menu music?

#2 Post by Hijiri »

1- Yes, you can use something like this:

Code: Select all

init python:
    
    if persistent.completed_game:
        config.main_menu_music = "End.ogg"
    
    else:
        config.main_menu_music = "Day.ogg"
That's an example from my own game. You cam mess with variables as you like.

2- IIRC, you can get rid of the "On replace/On replaced" bits of the music room code to do that.
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]