Yet another "Expected Statement" error

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
LiquidDarkness
Newbie
Posts: 17
Joined: Wed Feb 21, 2018 7:45 pm
Contact:

Yet another "Expected Statement" error

#1 Post by LiquidDarkness »

No idea what might be wrong here, honestly. Sorry, if it's obvious, for me it isn't :(

Code: Select all

    menu rei_interact_menu:
        "What do you want?"
        "Talk":
            "I still need to come up with something here.":
                jump rei_interact_menu
            "I still need to come up with something here.":
                jump rei_interact_menu
In different part of the code the very same formula works smoothly.

Code: Select all

        "Give a gift":
            menu rei_gift:
                "I still need to come up with something here.":
                    jump rei_interact_menu
                "I still need to come up with something here.":
                    jump rei_interact_menu
                "I still need to come up with something here.":
                    jump rei_interact_menu

        "Ask out":
            if $rei_friendship <= 550:
                rei "I don't think so, sorry. Maybe if we knew each other better?"
                jump rei_interact_menu
            if rei_friendship >= 550:
                menu rei_date:
                    "City Centre":
                        if $rei_romance <= 50:
                            "I don't think she likes me enough..."
                            jump rei_date
                        if $rei_romance >= 50:
                            rei "Ok, let's go!"
                            call rei_cc_01
                    "Shrine":
                        if $rei_romance <= 200:
                            "I don't think she likes me enough..."
                            jump rei_date
                        if $rei_romance >= 200:
                            rei "Ok, let's go!"
                    "Park":
                        if $rei_romance <= 500:
                            "I don't think she likes me enough..."
                            jump rei_date
                        if $rei_romance >= 500:
                            rei "Ok, let's go!"
                    "My house":
                        if $rei_romance <= 800:
                            "I don't think she likes me enough..."
                            jump rei_date
                        if $rei_romance >= 800:
                            rei "Ok, let's go!"
        "Nevermind":
            jump rei_interact_menu

User avatar
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: Yet another "Expected Statement" error

#2 Post by Milkymalk »

I'm not sure if you can put a menu inside a menu. Better jump or call a label where then that menu appears, that will probably solve the issue.
For future reference, please state the exact line for the error message. Better, post the entire traceback.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

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: Yet another "Expected Statement" error

#3 Post by trooper6 »

Also, you explicitly put a menu in the second example, but you don't in the first example.
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
Lord Hisu
Regular
Posts: 58
Joined: Sun Feb 11, 2018 2:31 am
Contact:

Re: Yet another "Expected Statement" error

#4 Post by Lord Hisu »

Milkymalk wrote: Fri Mar 16, 2018 12:00 am I'm not sure if you can put a menu inside a menu. Better jump or call a label where then that menu appears, that will probably solve the issue.
For future reference, please state the exact line for the error message. Better, post the entire traceback.
Actually, you can. That's not the problem.


You can only have one line of text inside the menu.
If you want "Talk" to be the text inside the menu, you should do:

Code: Select all

    "What do you want?"
    menu rei_interact_menu:
        "Talk"
        "I still need to come up with something here.":
            jump rei_interact_menu
        "I still need to come up with something here.":
            jump rei_interact_menu
If you want "Talk" to open another menu, you should do:

Code: Select all

    menu rei_interact_menu:
        "What do you want?"
        "Talk":
            menu:
                "I still need to come up with something here.":
                    jump rei_interact_menu
                "I still need to come up with something here.":
                    jump rei_interact_menu

LiquidDarkness
Newbie
Posts: 17
Joined: Wed Feb 21, 2018 7:45 pm
Contact:

Re: Yet another "Expected Statement" error

#5 Post by LiquidDarkness »

Lord Hisu, you're the best!
Thank you for the help and sory for not putting the error traceback in the post, I only noticed that now.

Post Reply

Who is online

Users browsing this forum: No registered users