[SOLVED] Issue with variable-based menu choices

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
tejina
Newbie
Posts: 14
Joined: Tue Dec 09, 2014 1:43 am
Projects: Faded Hearts, Ward 12
Organization: Tejigroup
Skype: tejina_kyousei
Contact:

[SOLVED] Issue with variable-based menu choices

#1 Post by tejina »

Basically, I'd like for the menu to show certain items depending on what events you've gone through.

So this is what I tried to code:

Code: Select all

label home_3:
    show kitday
    with fade
    "Flopping onto a kitchen chair, I sighed as I remembered I'd need to go buy groceries."
    me "'Why do people have to eat?'"
    "I had a few choices..."
    menu:
        if tara_restaurant_accept:
            "Meat!":
                jump meat_bought
        
        if ask_about_noodles:
            "Noodles!":
                jump noodles_bought
        
        "Salad!":
            jump salad_bought
        
        "Stuff!":
            jump stuff_bought

label meat_bought:
    "Bought meat"
    
label noodles_bought:
    "Bought noodles"
    
label salad_bought:
    "Bought salad"

label stuff_bought:
    "Bought stuff."
but when I try to test it says this:

Code: Select all

File "game/script.rpy", line 2976: expected menuitem
    if tara_restaurant_accept:
    ^
I also checked out
http://lemmasoft.renai.us/forums/viewto ... t=menuitem
but even when I copy&pasted it still had that issue.

T-T


**SOLVED! Also, fixed post :lol: **
Last edited by tejina on Thu Dec 18, 2014 10:26 pm, edited 2 times in total.
Image

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Issue with variable-based menu choices

#2 Post by xela »

You're not displaying code correctly... what's wrong with people today :D

Code: Select all

menu:
    "Meat!" if tara_restaurant_accept:
        jump meat_bought
rewrite the whole thing is this manner.
Like what we're doing? Support us at:
Image

User avatar
tejina
Newbie
Posts: 14
Joined: Tue Dec 09, 2014 1:43 am
Projects: Faded Hearts, Ward 12
Organization: Tejigroup
Skype: tejina_kyousei
Contact:

Re: Issue with variable-based menu choices

#3 Post by tejina »

o_o'

I thought I had picked the code option D=


And thanks! That fixed it!

You're amazing~
Image

Post Reply

Who is online

Users browsing this forum: No registered users