Music Room
Enable the Music Room
Open kit_options.rpy and locate the following line:
define music_room.enabled = False
Replace False with True. It should now look like this:
define music_room.enabled = True
Add music to the Music Room
Locate the following line:
define music_room.tracks = []
Add items to the list in the following format, seperated by commas:
{"name": "Music Name", "file": "audio/music_name.mp3"}
Here, Music Name should be replaced with the name of the music that will be displayed to the user, and audio/music_name.mp3 should be replaced with location of the music file in the game directory. An example of a list of music files would look like this:
define music_room.tracks = [
{"name": "First Track", "file": "audio/music/first_track.ogg"},
{"name": "Second Track", "file": "audio/music/second_track.wav"},
{"name": "Sound Effect", "file": "audio/sfx/sound_effect.mp3"}
]
Unlocking all music tracks
By default, music tracks only show up in the Music Room if the player has heard the audio file at least once. If you want all tracks to show up regardless of whether the player has heard them yet, locate the following line:
define music_room.unlocked = True
Replace False with True. It should now look like this:
define music_room.unlocked = True
Variable Mode
Variable mode is not compatible with Unlocked mode. If one is true, the other must be false to prevent unexpected behavior.
Sometimes, you'll want to unlock music tracks based on variables instead of whether the player has heard the track yet or not. In order to do so, you can use variable mode.
Locate the following line in kit_options.rpy:
define music_room.variable_mode = False
Replace False with True. It should now look like this:
define music_room.variable_mode = True
Next, locate the following line:
define music_room.tracks = []
Add items to the list in the following format, seperated by commas:
{"name": "Track Name", "file": "audio/music/first_track.ogg", "variable": "variable_name"},
Make sure to use peristent variables to ensure the tracks are actually unlocked. Learn about persistent variables in the Official RenPy Documentation
Here, Track Name should be replaced with the name of the image, and variable_name should be replaced with the name of the variable.