Basically, I want to have several different title screens. When the player starts up the VN for the first time, they'll see the first image, but after they progress far enough in the story, the title screen will change to the second image, and so on.
How should I do this? I set persistent data when those points in the story are passed, but I'm not sure how to change the image based on that.
[Solved] Changing the title screen throughout the game?
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: 15
- Joined: Tue Jan 06, 2009 10:01 am
- Contact:
[Solved] Changing the title screen throughout the game?
Last edited by menostorpe on Wed Mar 29, 2017 5:28 pm, edited 1 time in total.
- Ocelot
- Lemma-Class Veteran
- Posts: 2402
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Changing the title screen throughout the game?
You can do something like that in main_menu screen:
Code: Select all
# instead of add gui.main_menu_background :
if persistent.progress == 3:
add backgound_3
elif persistent.progress == 2:
add backgound_2
elif persistent.progress == 1:
add backgound_1
else
add backgound_default
< < insert Rick Cook quote here > >
-
- Newbie
- Posts: 15
- Joined: Tue Jan 06, 2009 10:01 am
- Contact:
Re: Changing the title screen throughout the game?
Thanks for the quick answer! I should probably have mentioned that I'm using the legacy theme, not the GUI interface. I think the relevant part looks like this:
I tried something very much like what you suggested, just in case the screen could take if/else statements, but it didn't work.
Code: Select all
window:
style "mm_root"
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Changing the title screen throughout the game?
in Legacy theme:
Code: Select all
# The background of the main menu.
window:
style "mm_root"
if persistent.progress == 1:
add "image.png"
elif persistent.progress == 2:
add "newimage.png"
#etc...
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Changing the title screen throughout the game?
Always make sure you count from highest to lowest (if you use numbers as your flags). Otherwise you may get undesired results when Ren'Py checks if '1' is true before '2'
If 1 is true, then 2 is ignored without being checked.
If you're using the same variable to set the bg, I think thats a bad idea. Imagine a player is at persistent.progress = 5.
What happens if a player loads an old save file, reaches persistent.progress = 3
The menu changes back to 3's background. All good.
But now they exit and reload where they were. Persistent.progress is still 3.
If 1 is true, then 2 is ignored without being checked.
If you're using the same variable to set the bg, I think thats a bad idea. Imagine a player is at persistent.progress = 5.
What happens if a player loads an old save file, reaches persistent.progress = 3
The menu changes back to 3's background. All good.
But now they exit and reload where they were. Persistent.progress is still 3.
Last edited by Imperf3kt on Wed Mar 29, 2017 5:02 pm, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 15
- Joined: Tue Jan 06, 2009 10:01 am
- Contact:
Re: Changing the title screen throughout the game?
That does it, thanks!
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot]