Locking a Menu Option [SOLVED]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
Suru
Regular
Posts: 112
Joined: Wed Aug 31, 2016 10:27 pm
Contact:

Locking a Menu Option [SOLVED]

#1 Post by Suru »

Hello,

Is there a way to lock a menu option. Say if a certain thing has happened not allow the menu option to show up? I know how to make options show up only if a certain variable has taken place. I'm looking for a method to remove the option only if a certain variable has occurred.

Example:

menu:
Choice A - always there
Choice B - there as a part of an if statement
Choice C - sometimes there, but not if certain things have happened to deactivate it

I know how to program the first two choices. I don't know and have been unable to find documentation on the last. Is this possible? Thanks for any help.
Last edited by Suru on Thu Jun 22, 2017 12:43 am, edited 1 time in total.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Locking a Menu Option

#2 Post by trooper6 »

That is still just an if statement.

Let's say you don't want option C to show up if someone was murdered.

If you have a variable called is_alive. You the person is murdered, you make is_alive false, and then:

Code: Select all

menu:
    "Option A":
        "Blah"
    "Option B":
        "Blah"
    "Option C" if is_alive:
        "Blah"
What if your variable is called is_murdered, then you do:

Code: Select all

menu:
    "Option A":
        "Blah"
    "Option B":
        "Blah"
    "Option C" if not is_murdered:
        "Blah"
It is all if statements.
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

User avatar
Suru
Regular
Posts: 112
Joined: Wed Aug 31, 2016 10:27 pm
Contact:

Re: Locking a Menu Option

#3 Post by Suru »

Ah okay, simple enough. Thanks for the swift reply!

Post Reply

Who is online

Users browsing this forum: Google [Bot]