Page 1 of 1

[Solved] conditional statement does not expect a block?

Posted: Tue May 04, 2021 7:59 pm
by Hollace
I made a post before, but thought I found the problem and immediately deleted it,,, seems I didn't find it at all <:D I'm not sure what's going on, according to my tired eyes the code seems to be all alright, no issues nothing... unless I understand conditional statements wrong?

At first I thought that my folders included spaces was the issue (which is definitely still a problem and I have since fixed) but it,,, it didn't fix anything. So this is what's going on in my line of code:

Code: Select all

define e = Character("mc")

image side avatar = LayeredImageProxy("mc", Transform(crop=(0, 0, 1000, 1000), zoom=0.6, xoffset=950, yoffset=200))

define a = Character("Main Character", image="avatar")

default skin = 1
default hair = 1
default haircolour = 1
default eyes = 1
default eyecolour = 1
default eyebrows = 1
default nose = 1
default mouth = 1
default skindetails = 1

layeredimage mc:

    if gender == "Male":
        if skin == 1:
            "/Assets/SkinColour/Male/MBase01.png"
        elif skin == 2:
            "/Assets/SkinColour/Male/MBase02.png"
        elif skin == 3:
            "/Assets/SkinColour/Male/MBase03.png"
        elif skin == 4:
            "/Assets/SkinColour/Male/MBase04.png"
        elif skin == 5:
            "/Assets/SkinColour/Male/MBase05.png"
        elif skin == 6:
            "/Assets/SkinColour/Male/MBase06.png"
        elif skin == 7:
            "/Assets/SkinColour/Male/MBase07.png"
        elif skin == 8:
            "/Assets/SkinColour/Male/MBase08.png"
        elif skin == 9:
            "/Assets/SkinColour/Male/MBase09.png"
        elif skin == 10:
            "/Assets/SkinColour/Male/MBase10.png"
        elif skin == 11:
            "/Assets/SkinColour/Male/MBase11.png"
        elif skin == 12:
            "/Assets/SkinColour/Male/MBase12.png"
        elif skin == 13:
            "/Assets/SkinColour/Male/MBase13.png"
    elif gender == "Female":
        if skin == 1:
            "/Assets/SkinColour/Female/FBase01.png"
        elif skin == 2:
            "/Assets/SkinColour/Female/FBase02.png"
        elif skin == 3:
            "/Assets/SkinColour/Female/FBase03.png"
        elif skin == 4:
            "/Assets/SkinColour/Female/FBase04.png"
        elif skin == 5:
            "/Assets/SkinColour/Female/FBase05.png"
        elif skin == 6:
            "/Assets/SkinColour/Female/FBase06.png"
        elif skin == 7:
            "/Assets/SkinColour/Female/FBase07.png"
        elif skin == 8:
            "/Assets/SkinColour/Female/FBase08.png"
        elif skin == 9:
            "/Assets/SkinColour/Female/FBase09.png"
        elif skin == 10:
            "/Assets/SkinColour/Female/FBase10.png"
        elif skin == 11:
            "/Assets/SkinColour/Female/FBase11.png"
        elif skin == 12:
            "/Assets/SkinColour/Female/FBase12.png"
        elif skin == 13:
            "/Assets/SkinColour/Female/FBase13.png"
    elif gender == "Trans-male":
        if skin == 1:
            "/Assets/SkinColour/TransMale/TMBase01.png"
        elif skin == 2:
            "/Assets/SkinColour/TransMale/TMBase02.png"
        elif skin == 3:
            "/Assets/SkinColour/TransMale/TMBase03.png"
        elif skin == 4:
            "/Assets/SkinColour/TransMale/TMBase04.png"
        elif skin == 5:
            "/Assets/SkinColour/TransMale/TMBase05.png"
        elif skin == 6:
            "/Assets/SkinColour/TransMale/TMBase06.png"
        elif skin == 7:
            "/Assets/SkinColour/TransMale/TMBase07.png"
        elif skin == 8:
            "/Assets/SkinColour/TransMale/TMBase08.png"
        elif skin == 9:
            "/Assets/SkinColour/TransMale/TMBase09.png"
        elif skin == 10:
            "/Assets/SkinColour/TransMale/TMBase10.png"
        elif skin == 11:
            "/Assets/SkinColour/TransMale/TMBase11.png"
        elif skin == 12:
            "/Assets/SkinColour/TransMale/TMBase12.png"
        elif skin == 13:
            "/Assets/SkinColour/TransMale/TMBase13.png"
    elif gender == "Trans-female":
        if skin == 1:
            "/Assets/SkinColour/TransFemale/TFBase01.png"
        elif skin == 2:
            "/Assets/SkinColour/TransFemale/TFBase02.png"
        elif skin == 3:
            "/Assets/SkinColour/TransFemale/TFBase03.png"
        elif skin == 4:
            "/Assets/SkinColour/TransFemale/TFBase04.png"
        elif skin == 5:
            "/Assets/SkinColour/TransFemale/TFBase05.png"
        elif skin == 6:
            "/Assets/SkinColour/TransFemale/TFBase06.png"
        elif skin == 7:
            "/Assets/SkinColour/TransFemale/TFBase07.png"
        elif skin == 8:
            "/Assets/SkinColour/TransFemale/TFBase08.png"
        elif skin == 9:
            "/Assets/SkinColour/TransFemale/TFBase09.png"
        elif skin == 10:
            "/Assets/SkinColour/TransFemale/TFBase10.png"
        elif skin == 11:
            "/Assets/SkinColour/TransFemale/TFBase11.png"
        elif skin == 12:
            "/Assets/SkinColour/TransFemale/TFBase12.png"
        elif skin == 13:
            "/Assets/SkinColour/TransFemale/TFBase13.png"
    elif gender == "Non-binary":
        if skin == 1:
            "/Assets/SkinColour/TransMale/TMBase01.png"
        elif skin == 2:
            "/Assets/SkinColour/TransMale/TMBase02.png"
        elif skin == 3:
            "/Assets/SkinColour/TransMale/TMBase03.png"
        elif skin == 4:
            "/Assets/SkinColour/TransMale/TMBase04.png"
        elif skin == 5:
            "/Assets/SkinColour/TransMale/TMBase05.png"
        elif skin == 6:
            "/Assets/SkinColour/TransMale/TMBase06.png"
        elif skin == 7:
            "/Assets/SkinColour/TransMale/TMBase07.png"
        elif skin == 8:
            "/Assets/SkinColour/TransMale/TMBase08.png"
        elif skin == 9:
            "/Assets/SkinColour/TransMale/TMBase09.png"
        elif skin == 10:
            "/Assets/SkinColour/TransMale/TMBase10.png"
        elif skin == 11:
            "/Assets/SkinColour/TransMale/TMBase11.png"
        elif skin == 12:
            "/Assets/SkinColour/TransMale/TMBase12.png"
        elif skin == 13:
            "/Assets/SkinColour/TransMale/TMBase13.png"
There's more after that, but they're more like this:

Code: Select all

if hair == 1 and haircolour == 1:
        "Assets/HairColour/CasualMale/CasualMale00.png"
    elif hair == 1 and haircolour == 2:
        "Assets/HairColour/CasualMale/CasualMale01.png"
    elif hair == 1 and haircolour == 3:
        "Assets/HairColour/CasualMale/CasualMale02.png"
    elif hair == 1 and haircolour == 4:
        "Assets/HairColour/CasualMale/CasualMale03.png"
    elif hair == 1 and haircolour == 5:
        "Assets/HairColour/CasualMale/CasualMale04.png"
    elif hair == 1 and haircolour == 6:
        "Assets/HairColour/CasualMale/CasualMale05.png"
    elif hair == 1 and haircolour == 7:
        "Assets/HairColour/CasualMale/CasualMale06.png"
I'm not gonna post it all as it's quite a lot of code,,,,

and this is the error I'm getting:

Code: Select all

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


File "game/character customization.rpy", line 21: Line is indented, but the preceding condition properties statement does not expect a block. Please check this line's indentation.
    "/Assets/SkinColour/Male/MBase01.png"
    ^

Ren'Py Version: Ren'Py 7.4.4.1439
Wed May  5 01:54:19 2021

Re: conditional statement does not expect a block?

Posted: Wed May 05, 2021 5:12 am
by Hollace
I think I should explain something I forgot to explain since I was extremely tired <:D!

So my reasoning behind doing this line of code:

Code: Select all

    if gender == "Male":
        if skin == 1:
            "/Assets/SkinColour/Male/MBase01.png"
is that I have multiple genders with different sprites but I want the skin numerics to be the same colour, but different sprites... I hope that makes sense? Either way, I bet there's a better way to do this, but my tired brains could only get this

Re: [Solved] conditional statement does not expect a block?

Posted: Wed May 05, 2021 5:43 am
by Hollace
so I found a pretty simple way to fix it and I don't know how I hadn't thought of it earlier <:D 'cause it's literally the same as I do my different colours lmaooo

Code: Select all

    if gender == "Male" and skin == 1:
        "/Assets/SkinColour/Male/MBase01.png"
    elif gender == "Male" and skin == 2:
        "/Assets/SkinColour/Male/MBase02.png"
    elif gender == "Male" and skin == 3:
        "/Assets/SkinColour/Male/MBase03.png"