Expected statement error.

Mephistofeles

Active Member
Jul 9, 2017
647
721
Hi! Im new working on renpy and i keep getting the ''Expected statement'' error in a python code. Here its the code:
menu:
(Other menu options)
"A flame rune, that will kill slowly and with much pain":
$ pain_guard = True
"The guard meets his demise in flames that cover his body, feeling every inch of his skin burning and becoming of a similar texture as coocked meat."
"His screams are heard in the low level of the castle, and his companion quickly comes to investigate."
jump after_choice
label after_choice:
"The other guard stops at the entrance of the cell, seeing your work, and quickly draws his blade. Unrealising the other figure that was behind him, hanging like a enormous bat from the ceiling of the cell"

"The figure jump over him, and with a quick move, place its hand inside his armor, in a seducting manner."

"However, with a quick move, the hand is removed with a new founded red coloration. The guard try to scream, but all that left his mouth are muffled sounds, when his blood fills his lungs."

A "They fell as planned master"

"Said the shadowy silloute, now revelead as a winged woman, with horns coming from his head and a body deceptively heaven like, with curves that bring the atention, just to hide intentions. A succubus."

"Figure" "They are but the first"

"A devilish grin shine in Ariesnell face."

A "Oh, i do hope so."

If pain_guard: (THIS IS THE LINE WHERE I GET THE ERROR)

A "And i very much enjoyed your own show. It was...exciting."
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,225
It's difficult to say since the code isn't correctly indented here on the forums (look at the [code] [/code] tags sometime - or use the menu bar option that looks like "...v" and choose insert...code...).

Meanwhile, I'm almost certain it's because you've used If instead of if. RenPy is case sensitive and will get a tad upset about that capital "I" at the start of the statement.

I guess your code should look something like:

Python:
label start:

    menu:
        "A flame rune, that will kill slowly and with much pain":
            $ pain_guard = True
            "The guard meets his demise in flames that cover his body, feeling every inch of his skin burning and becoming of a similar texture as cooked meat."
            "His screams are heard in the low level of the castle, and his companion quickly comes to investigate."
            jump after_choice

 
label after_choice:
 
    "The other guard stops at the entrance of the cell, seeing your work, and quickly draws his blade. Unrealizing the other figure that was behind him, hanging like a enormous bat from the ceiling of the cell."
    "The figure jump over him, and with a quick move, place its hand inside his armor, in a seductive manner."
    "However, with a quick move, the hand is removed with a new founded red coloration. The guard try to scream, but all that left his mouth are muffled sounds, when his blood fills his lungs."
    A "They fell as planned master."
    "Said the shadowy silhouette, now revealed as a winged woman, with horns coming from his head and a body deceptively heaven like, with curves that bring the attention, just to hide intentions. A succubus."
    "Figure" "They are but the first."
    "A devilish grin shines on Ariesnell's face."
    A "Oh, I do hope so."

    if pain_guard:
        A "And I very much enjoyed your own show. It was... exciting."

    # blah, blah, more code.
 

Mephistofeles

Active Member
Jul 9, 2017
647
721
It's difficult to say since the code isn't correctly indented here on the forums (look at the [code] [/code] tags sometime - or use the menu bar option that looks like "...v" and choose insert...code...).

Meanwhile, I'm almost certain it's because you've used If instead of if. RenPy is case sensitive and will get a tad upset about that capital "I" at the start of the statement.

I guess your code should look something like:

Python:
label start:

    menu:
        "A flame rune, that will kill slowly and with much pain":
            $ pain_guard = True
            "The guard meets his demise in flames that cover his body, feeling every inch of his skin burning and becoming of a similar texture as cooked meat."
            "His screams are heard in the low level of the castle, and his companion quickly comes to investigate."
            jump after_choice


label after_choice:

    "The other guard stops at the entrance of the cell, seeing your work, and quickly draws his blade. Unrealizing the other figure that was behind him, hanging like a enormous bat from the ceiling of the cell."
    "The figure jump over him, and with a quick move, place its hand inside his armor, in a seductive manner."
    "However, with a quick move, the hand is removed with a new founded red coloration. The guard try to scream, but all that left his mouth are muffled sounds, when his blood fills his lungs."
    A "They fell as planned master."
    "Said the shadowy silhouette, now revealed as a winged woman, with horns coming from his head and a body deceptively heaven like, with curves that bring the attention, just to hide intentions. A succubus."
    "Figure" "They are but the first."
    "A devilish grin shines on Ariesnell's face."
    A "Oh, I do hope so."

    if pain_guard:
        A "And I very much enjoyed your own show. It was... exciting."

    # blah, blah, more code.
....The error was simple caused because i was typing If instead of if. Thank you for make me realise my STUPID mistake.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,384
15,292
In complement to 79flavors answer :

Hi! Im new working on renpy and i keep getting the ''Expected statement'' error in a python code.
"Expected statement" mean that what you wrote isn't a "statement" (a instruction understood by Ren'py). Therefore, it's always either a syntax error (like in this case) or because you forgot a $ at start of an inline python line. Exceptionally its because the you used a screen command inside the label, or something like that.
Anyway, the first thing to do is to look at the pointed line and how you wrote the statement.
 
  • Like
Reactions: Mephistofeles