Hi, I wanted to know how to do after finishing a novel, change the menu and appear another button that takes you to another story, such as clannad or sepia tears making the myra's diary
http://images.akamai.steamusercontent.c ... 7F13C6C6A/
Change menu after finish 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.
- ileikturtles
- Regular
- Posts: 32
- Joined: Sun Nov 23, 2014 7:54 pm
- Projects: Adventures of Scottie
- Organization: StudioFondue
- Tumblr: ileikturtles
- Contact:
Re: Change menu after finish the game
I would set a variable which controls whether the button is ready to show;
is just an example. Then in the main menu code I would include:
NOTE: you need to place the gameCompleted in an init (to happen before the game starts, or will return an error that the variable doesn't yet exist)
The above code adds a button to the existing Main Menu vbox. Change accordingly if it's an imagebutton, or placed outside the vbox.
Code: Select all
init:
$ gameCompleted = False #CAN BE ANYTHING
Code: Select all
frame:
style_group "mm"
xalign .98
yalign .98
has vbox
textbutton _("Start Game") action Start()
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Preferences") action ShowMenu("preferences")
textbutton _("Help") action Help()
textbutton _("Quit") action Quit(confirm=False)
if gameCompleted == True:
textbutton _("Myra's Diary") action Jump("Myra Diary") #NAME OF JUMP
The above code adds a button to the existing Main Menu vbox. Change accordingly if it's an imagebutton, or placed outside the vbox.
Last edited by ileikturtles on Fri Mar 24, 2017 1:57 pm, edited 1 time in total.
- Milkymalk
- Miko-Class Veteran
- Posts: 753
- Joined: Wed Nov 23, 2011 5:30 pm
- Completed: Don't Look (AGS game)
- Projects: KANPEKI! ★Perfect Play★
- Organization: Crappy White Wings
- Location: Germany
- Contact:
Re: Change menu after finish the game
If you want the new button to persist after closing the game, you need persistent data:
https://www.renpy.org/doc/html/persistent.html
It's easy, just call the variable persistent.gameCompleted instead of only gameCompleted. The exact name is irrelevant, of course.
https://www.renpy.org/doc/html/persistent.html
It's easy, just call the variable persistent.gameCompleted instead of only gameCompleted. The exact name is irrelevant, of course.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
- Ocelot
- Lemma-Class Veteran
- Posts: 2404
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Change menu after finish the game
Note: init variables are reset on entering new context. Like main menu. You want persistent variables.
Code: Select all
label start:
'Game started'
'Game finished'
$ persistent.finished = True # This will set persistent variable 'finished', which will retain it value between launches, new and loaded games
return
# in main menu screen
# . . .
if persistent.finished: # persistent variables return None if not exist, no need to actually set them beforehand there
textbutton 'postgame content' . . .
# . . .
< < insert Rick Cook quote here > >
Re: Change menu after finish the game
Thank you all, I'll try
Who is online
Users browsing this forum: bilmem