Menu Item By If statement.
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.
Menu Item By If statement.
So I would like to make one of my menu items only available if a certain condition is met. I've tried using the if statement in the place where the menu option would normally go but that doesn't work. Does anyone know the code to make a menu choice specific to certain variables?
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Menu Item By If statement.
This is explained in the documentation with examples. See the second example on this page: https://www.renpy.org/doc/html/menus.html
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
- NocturneLight
- Regular
- Posts: 162
- Joined: Thu Jun 30, 2016 1:20 pm
- Projects: Unsound Minds: The Clarevine Epoch
- Organization: Reminiscent 64
- Tumblr: Reminiscent64
- itch: Reminiscent64
- Location: Texas
- Contact:
Re: Menu Item By If statement.
Using an if statement should of worked for you. Did you make sure to indent in all the right places?
If you did it properly, it should look something like this:
If you did it properly, it should look something like this:
Code: Select all
if test == 1:
menu:
"Hi.":
jump SecondStory_FinalMoments
"Hola.":
jump SecondStory_FinalMomentsThe Old Guard is at His Limit. The time is near to usher in the New Guard.
The Great Horror is soon to be free.
Clarevine is the key.
"Unsound Minds: The Clarevine Epoch" is a yuri visual novel that shatters english visual novel norms and aims to blend Christianity and the Cthulhu Mythos to tell a deep and dark story that you'll enjoy. You can follow the Kickstarter here.
Stay sound and persist through the chaos,
NocturneLight
The Great Horror is soon to be free.
Clarevine is the key.
"Unsound Minds: The Clarevine Epoch" is a yuri visual novel that shatters english visual novel norms and aims to blend Christianity and the Cthulhu Mythos to tell a deep and dark story that you'll enjoy. You can follow the Kickstarter here.
Stay sound and persist through the chaos,
NocturneLight
- trooper6
- Lemma-Class Veteran
- Posts: 3712
- Joined: Sat Jul 09, 2011 10:33 pm
- Projects: A Close Shave
- Location: Medford, MA
- Contact:
Re: Menu Item By If statement.
NocturneLight, Suru doesn't want to if the entire menu (which is the code you provided), but only one choice. That is documented in the link I provided.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?) Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978
Re: Menu Item By If statement.
Thank you! I have it now. I was placing the if statement in the next indent below as opposed to next to the statement. Sorry for such a simple question.
Who is online
Users browsing this forum: Google [Bot]
