Page 1 of 1

[solved]How to make music change affect returning to main menu from music room

Posted: Tue Sep 21, 2021 10:46 pm
by shiolily
Hello! Sorry for the wordy subject line, but my issue is as follows.

After passing a certain point in the game, the main menu music (and background image) changes. I accomplished this with this code in the script:

Code: Select all

label before_main_menu:

    if persistent.op2:
        $ renpy.music.play('audio/gs.ogg', channel='music', loop=True)
    else:
        $ renpy.music.play('audio/wa.ogg', channel='music', loop=True)
    return main_menu
In the music room code, this is used to change the music back when the player returns to the main menu.

Code: Select all

    # Restore the main menu music upon leaving.

    on "replaced" action Play("music", "audio/gs.ogg")
How can I make the file 'wa.ogg' play if persistent.op2 isn't true yet in the music room?

Additionally (I will move this part into another topic if necessary) I have a ton of songs in my music room and I'd like to implement a scroll bar, but all information I've found on the subject has broken the code or caused crashes. This is what I have right now (it all barely fits)

https://media.discordapp.net/attachment ... nknown.png

Re: How to make music change affect returning to main menu from music room

Posted: Wed Sep 22, 2021 3:38 am
by Ocelot

Code: Select all

on "replaced" action If(persistent.op2, true=Play("music", "audio/gs.ogg"), false=Play("music", "audio/wa.ogg"))

Re: How to make music change affect returning to main menu from music room

Posted: Wed Sep 22, 2021 3:46 pm
by shiolily
That worked perfectly, thank you so much!