[SOLVED] altering main menu when certain route/end has been reached in 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.
-
+ ali3nn +
- Regular
- Posts: 32
- Joined: Wed Aug 14, 2019 3:08 pm
- Contact:
[SOLVED] altering main menu when certain route/end has been reached in game
straight to the point, if i were to make a vn with several different endings [ ex: 5 ] how would i be able to alter the main menu after any ending/a route has been reached?
i tried looking but most of the information was outdated/from 2 years ago.
anything helps, thank you!
i tried looking but most of the information was outdated/from 2 years ago.
anything helps, thank you!
Last edited by + ali3nn + on Sat Aug 24, 2019 8:40 pm, edited 1 time in total.
- Angelo Seraphim
- Regular
- Posts: 32
- Joined: Tue May 21, 2019 8:00 am
- Completed: Enamored Risks (NaNoReNo 2020)
- Projects: 616 Charagma
- Organization: GLSUoA
- Deviantart: glsuoa
- itch: glsuoa
- Location: London, UK
- Discord: Just A Concept#9599
- Contact:
Re: altering main menu when certain route/end has been reached in game
Under the screen 'main_menu()' in screens.rpy you can do this:
And then near the end of the script or chapter:
Hope this will point you in the right direction. 
Code: Select all
# default story_ending = " "
default persistent.story_ending = " " # If you want the bg to remain as is through every startup, use the 'persistent' variable.
screen main_menu():
## This ensures that any other menu screen is replaced.
tag menu
style_prefix "main_menu"
if persistent.story_ending == "Good A": # Using the 'persistent' variable will make it consistent upon every startup so it won't default to your default menu bg.
add "bg_image_1.jpg"
elif persistent.story_ending == "Good B":
add "bg_image_2.jpg"
elif persistent.story_ending == "Good C":
add "bg_image_3.jpg"
else:
add gui.main_menu_background
# etc
frame:
pass
## The use statement includes another screen inside this one. The actual
## contents of the main menu are in the navigation screen.
use navigation
Code: Select all
label ending: # Just for testing
menu:
"Testing endings"
"Good ending A":
$ persistent.story_ending = "Good A"
"Good ending B":
$ persistent.story_ending = "Good B"
"Good ending C":
$ persistent.story_ending = "Good C"
return
-
+ ali3nn +
- Regular
- Posts: 32
- Joined: Wed Aug 14, 2019 3:08 pm
- Contact:
-
+ ali3nn +
- Regular
- Posts: 32
- Joined: Wed Aug 14, 2019 3:08 pm
- Contact:
Re: altering main menu when certain route/end has been reached in game
is there anyway to add main menu buttons/change the main menu music after certain endings?
sorry if i'm asking for too much.
sorry if i'm asking for too much.
- hell_oh_world
- Miko-Class Veteran
- Posts: 777
- Joined: Fri Jul 12, 2019 5:21 am
- Projects: The Button Man
- Organization: NILA
- Github: hell-oh-world
- Location: Philippines
- Contact:
Re: altering main menu when certain route/end has been reached in game
+ ali3nn + wrote: ↑Tue Aug 20, 2019 4:41 pmis there anyway to add main menu buttons/change the main menu music after certain endings?
sorry if i'm asking for too much.
Yes. Its also possible, just like the code of Angelo Seraphim. You can change the music by using the configuration variables.
Code: Select all
# default story_ending = " "
default persistent.story_ending = " " # If you want the bg to remain as is through every startup, use the 'persistent' variable.
screen main_menu():
## This ensures that any other menu screen is replaced.
tag menu
style_prefix "main_menu"
if persistent.story_ending == "Good A": # Using the 'persistent' variable will make it consistent upon every startup so it won't default to your default menu bg.
add "bg_image_1.jpg"
$ config.main_menu_music = "music1.mp3"
elif persistent.story_ending == "Good B":
add "bg_image_2.jpg"
$ config.main_menu_music = "music2.mp3"
elif persistent.story_ending == "Good C":
add "bg_image_3.jpg"
$ config.main_menu_music = "music3.mp3"
else:
add gui.main_menu_background
$ config.main_menu_music = "music4.mp3"
# etc
frame:
pass
## The use statement includes another screen inside this one. The actual
## contents of the main menu are in the navigation screen.
use navigation You can learn more about configuration variables here....
https://www.renpy.org/doc/html/config.h ... menu_music
-
+ ali3nn +
- Regular
- Posts: 32
- Joined: Wed Aug 14, 2019 3:08 pm
- Contact:
Re: altering main menu when certain route/end has been reached in game
thank you again!!
Who is online
Users browsing this forum: Bing [Bot]
