I want to change the main menu background every time the player completes a different route.
Here's what I did:
In script.rpy before the game starts, I defined the persistent to false:
Code: Select all
define persistent.end1 = False
define persistent.end2 = False
define persistent.end3 = False
Code: Select all
$ persistent.end1=True
The main menu background is changed in options.rpy under the Themes category. So I made a list of the different bgs I will change to. I'm not sure if we're allowed to have more than one mm and that's why it's not reading it? Sorry I'm very new to coding. I feel like I'm doing it in a very roundabout way but I didn't want to risk using more conditions to confuse me.
Code: Select all
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "mm_1.png", #no ending complete, main menu starts with this
mm_root1 = "mm_2.png", #A ending complete
mm_root2 = "mm_3.png", #E ending complete
mm_root3 = "mm_4.png", #H ending complete
mm_root4 = "mm_5.png", #A and E ending complete
mm_root5 = "mm_6.png", #A and H ending complete
mm_root6 = "mm_7.png", #E and H ending complete
mm_root7 = "mm_8.png", #A and E and H ending complete
Code: Select all
screen main_menu:
# This ensures that any other menu screen is replaced.
tag menu
if persistent.end1: #A
use main_menu_1
elif persistent.end2: #E
use main_menu_2
elif persistent.end3: #H
use main_menu_3
elif persistent.end1 and persistent.end2: #A and E
use main_menu_4
elif persistent.end1 and persistent.end3: #A and H
use main_menu_5
elif persistent.end2 and persistent.end3: #E and H
use main_menu_6
elif persistent.end1 and persistent.end2 and persistent.end3: #A and E and H
use main_menu_7
else:
use main_menu #No route complete
# The background of the main menu.
window:
style "mm_root"
Code: Select all
screen main_menu_1:
tag menu
window:
style "mm_root1"