Line indented, but preceding condition properties statement does not expect a block

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
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Line indented, but preceding condition properties statement does not expect a block

#1 Post by ArizaLuca »

Code: Select all

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


File "game/images.rpy", line 6: Line is indented, but the preceding condition properties statement does not expect a block. Please check this line's indentation.
    "jesse_base_1"
    ^

Ren'Py Version: Ren'Py 7.1.3.1092
Sat Mar  2 09:14:56 2019
The problem is right here:

Code: Select all

layeredimage jesse:
    always:
        "jesse_here"
    if gender == 1:
        if race == 1:
            "jesse_base_1" ## <== HERE
        elif race == 2:
            "jesse_base_3"
        elif race == 3:
            "jesse_base_5"
        elif race == 4:
            "jesse_base_7"
        elif race == 5:
            "jesse_base_9"
        elif race == 6:
            "jesse_base_11"
    elif gender == 2:
        if race == 1:
            "jesse_base_2"
        elif race == 2:
            "jesse_base_4"
        elif race == 3:
            "jesse_base_6"
        elif race == 4:
            "jesse_base_8"
        elif race == 5:
            "jesse_base_10"
        elif race == 6:
            "jesse_base_12"
    group face:
        attribute normal default:
            "jesse_face_normal"
        attribute amused:
            "jesse_face_amused"
        attribute angry:
            "jesse_face_angry"
        attribute annoyed:
            "jesse_face_annoyed"
        attribute closed:
            "jesse_face_closed"
        attribute happy:
            "jesse_face_happy"
        attribute sad:
            "jesse_face_sad"
        attribute surprised:
            "jesse_face_surprised"
        attribute thoughtful:
            "jesse_face_thoughtful"
    if armor == 0:
        "jesse_here"
    elif armor == 1:
        "jesse_armor_goldengoliath"
    elif armor == 2:
        "jesse_armor_redstoneriot"
    elif armor == 3:
        "jesse_armor_enderdefender"
    elif armor == 4:
        "jesse_armor_swordbreaker"
    elif armor == 5:
        "jesse_armor_shieldofinfinity"
    elif armor == 6:
        "jesse_armor_dragonsbane"
    elif armor == 7:
        "jesse_armor_starshield"
    elif armor == 8:
        "jesse_armor_adamantineimpervium"
Line six is the issue. I have no idea what to do about that. Advice?

The purpose of this code is to make a character that switches between genders; so if gender is 1 and race is 2 you end up with a certain player. In the past I used LiveComposite and ConditionSwitch to get this, but I'm trying to use LayeredImage.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Line indented, but preceding condition properties statement does not expect a block

#2 Post by Remix »

I would guess that the issue is nested if's rather than the actual indent... perhaps try:

Code: Select all

    if gender == 1:
        "jesse_base_{}".format( (race*2) -1 )
    else:
        "jesse_base_{}".format( race*2 )
Frameworks & Scriptlets:

ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Line indented, but preceding condition properties statement does not expect a block

#3 Post by ArizaLuca »

Would this work for the entire stretch of code, though? The thing about that is that there are 6 different races and it depends on the choices the player makes in game-- they pick the gender and then the race.

Post Reply

Who is online

Users browsing this forum: Google [Bot]