"Expected Statement" Error [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
Broodelin
Regular
Posts: 193
Joined: Wed May 14, 2014 9:26 pm
Completed: A Harder Battle
Projects: Too many to list
Location: Eagleland
Contact:

"Expected Statement" Error [Solved]

#1 Post by Broodelin » Thu May 15, 2014 4:31 pm

(Leading up to Line 181)

Code: Select all

menu:
    
    "Could you calm her down before I get kicked out?":
    
        $ hospital_points += 1
        
        $ n1choice = "calmdown"
        
        "Christian looked a little surprised at your bluntness."
        
        ch "Uh... sure. No problem, grandma. Just give me a minute.
            
        Alright, Emma, remember what I taught you about your inside voice?"
        
        e "YEAH! I SHOULD BE QUIETER WHEN I'M INSIDE 'CAUSE THERE'S LESS ROOM FOR MY VOICE!" with sshake
        
        ch "How about we try that right now? I'm sure your nana would like that very much."
        
        e "Okie-dokie, daddy."
        
        m "{i}It's kind of amazing how big of lungs that little girl's got in her.{/i}"
        
        e "Nana...
           Are you going to be out of the hospital soon?"
        
        "I'll be out soon. Don't worry!":
                "Emma smiled a little at you, but you couldn't be sure if she really believed you or not."
That was the first error (plus the lines leading up to it).

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 181: expected statement.
    "I'll be out soon. Don't worry!":
                                    ^

File "game/script.rpy", line 216: expected statement.
    "It'll just be a little longer, Emma.":
                                          ^

File "game/script.rpy", line 249: expected statement.
    "I don't think so.":
                       ^

File "game/script.rpy", line 363: expected statement.
    "I'll be out soon. Don't worry!":
                                    ^

File "game/script.rpy", line 398: expected statement.
    "It'll just be a little longer, Emma.":
                                          ^

File "game/script.rpy", line 435: expected statement.
    "I don't think so.":
                       ^

Ren'Py Version: Ren'Py 6.17.6.512
Here's what I got from errors.txt

I didn't post the rest of the code as I think this is all caused by the same coding error.

If it helps, I'm trying to do "nested" choices (as in choices that result from other choices).

I'm really new at Ren'Py coding, so any help you can give me is greatly appreciated. :)
Last edited by Broodelin on Thu May 15, 2014 7:22 pm, edited 1 time in total.

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: "Expected Statement" Error

#2 Post by Asceai » Thu May 15, 2014 6:36 pm

To include choices in a game you need a menu.

EDIT: Oh, misread that you had a menu in there. If you want nested choices inside that, you need another menu.

Code: Select all

menu:
    "A":
        menu:
            "A1":
                "You picked choice A1"
            "A2":
                "You picked choice A2"
    "B":
        menu:
            "B1":
                "You picked choice B1"
            "B2":
                "You picked choice B2"
Last edited by Asceai on Thu May 15, 2014 6:39 pm, edited 1 time in total.

User avatar
Marionette
Regular
Posts: 128
Joined: Thu Apr 21, 2011 12:04 pm
Completed: https://marionette.itch.io/
Projects: Get Meowt of Here
Deviantart: rexx9224
itch: marionette
Location: Ireland
Discord: Marionette#2995
Contact:

Re: "Expected Statement" Error

#3 Post by Marionette » Thu May 15, 2014 6:36 pm

It looks like your tabbing is out on the second choice. They should all line up.

Unless by nested choiced you mean that choice is only available after this one, in that case your best bet is to use a jump and a second menu.

Code: Select all

            "Nana...
            Are you going to be out of the hospital soon?"
            jump calm

label calm:
    menu:
        "I'll be out soon. Don't worry!":
            "Emma smiled a little at you, but you couldn't be sure if she really believed you or not."
Best idea might be to put the whole result from the choice in the label to keep the menu as tidy and readable as possible, but hopefully with this example you get the idea. :3

User avatar
Broodelin
Regular
Posts: 193
Joined: Wed May 14, 2014 9:26 pm
Completed: A Harder Battle
Projects: Too many to list
Location: Eagleland
Contact:

Re: "Expected Statement" Error

#4 Post by Broodelin » Thu May 15, 2014 7:21 pm

Thanks to the both of you! It seems like I ended up doing this the hard way, huh? :D

It's working fine now.

Post Reply

Who is online

Users browsing this forum: No registered users