Page 1 of 1

Add or remove options in a menu depending certain criterias

Posted: Sun Nov 03, 2019 8:47 pm
by richycapy
Hi

Im trying to set a Menu depending on certain things during the game... example, this is the original code:

Code: Select all

$ picturetaken = False

label label_1
	"{i}She is taking walking by, what do you want to do?{/i}"

menu:
    "Leave before she see you":
        jump label_2
    "Take a picture":
        jump label_3


label label_3
        $ picturetaken = True
        play sound "sounds/fx/takepicture.mp3"
        "{i}I hope she didn't notice me{/i}"
        "{i}I better leave quickly...{/i}"
        jump label_1
        
label label_2
        "{i}I better leave...{/i}"
        jump next_scene
Very simple, just an option to take or not a picture

So, after you take the picture, I want to remove the "Take a picture" option... so, if I do this:

Code: Select all

menu:
    "Leave before she see you":
        jump label_2

    if not picturetaken:
        "Take a picture":
         jump label_3
         

Code: Select all

File "game/historias.rpy", line 1438: expected menuitem
     if not picturetaken:
    ^
And I would like, in a future, to be able to add more options, like if the player has certain amount of friendship, add the option: "Say hi" or other things

Re: Add or remove options in a menu depending certain criterias

Posted: Sun Nov 03, 2019 10:25 pm
by Imperf3kt
You only need to reverse your statement.

Code: Select all

 
    menu:
    "Leave before she see you":
        jump label_2

    "Take a picture" if not picturetaken:
         jump label_3
         

Re: Add or remove options in a menu depending certain criterias

Posted: Mon Nov 04, 2019 11:39 am
by richycapy
Imperf3kt wrote:
Sun Nov 03, 2019 10:25 pm
You only need to reverse your statement.

Code: Select all

 
    menu:
    "Leave before she see you":
        jump label_2

    "Take a picture" if not picturetaken:
         jump label_3
         
Awesome! Thanks a lot dude!! :D