I have a "true ending" defined in my script as persistent.final, and two main menu images in my images folder, main_menu.png and main_menu_true.png.
I want to make it so that if persistent.final is true, the main menu image will change from main_menu to main_menu_true.png.
Here's what I currently have in my script, at the end of the "true ending":
$persistent.final = True
$persistent.main = "gui/main_menu_true.png"
And here's what I currently have in gui.rpy:
## Main and Game Menus #########################################################
## The images used for the main and game menus.
default persistent.main = "gui/main_menu_true.png"
image mainMenu = "[persistent.main]"
define gui.main_menu_background = "main_menu"
define gui.game_menu_background = "gui/game_menu.png"
However, the only image that manifests, regardless of how many endings are unlocked, is main_menu.png. Where am I going wrong?
Thanks!
How to make the titlescreen image change upon route completion?
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.
-
- Newbie
- Posts: 1
- Joined: Sun Feb 25, 2024 11:16 pm
- Contact:
Re: How to make the titlescreen image change upon route completion?
The actual place where Main Menu image is set see in "screens.rpy".
"gui.rpy" only sets default values.
In "screens.rpy", the standard script is
Make it something like
and in the script
PS. Also note that "define" set something constant. For values that could be changed use "default".
And check the variable names in your code: "mainMenu" is not "main_menu".
"gui.rpy" only sets default values.
In "screens.rpy", the standard script is
Code: Select all
screen main_menu():
## This ensures that any other menu screen is replaced.
tag menu
add gui.main_menu_background
Code: Select all
add persistent.main_menu_bg
Code: Select all
default persistent.main_menu_bg = gui.main_menu_background
#...
label true_ending_finish:
$ persistent.main_menu_bg = "gui/main_menu_true.png"
And check the variable names in your code: "mainMenu" is not "main_menu".
If the problem is solved, please edit the original post and add [SOLVED] to the title.
Who is online
Users browsing this forum: No registered users