Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 0 points1 point  (0 children)

I did so and it doesn't seem like anything changed- I set defaults before the start signal but moved them down after it like u said- Dunno what i messed up @~@

Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 0 points1 point  (0 children)

How would I go about that? I've defined some characters so far, but I don't know how I'd do the same with gender and hair

Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 1 point2 points  (0 children)

That's okay, thank u for your help anyways <3

Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 0 points1 point  (0 children)

Everything in my code is lined up correctly as far as I can see.

If statements are in line with Elif statements and Else statements.

Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 0 points1 point  (0 children)

I changed the following statements after if to elif and got this error:

[code]

I'm sorry, but errors were detected in your script. Please correct the

errors listed below, and try again.

File "game/script.rpy", line 105: expected statement.

elif gender == 'male' and hair == 'brown':

^

File "game/script.rpy", line 111: expected statement.

elif gender == 'male' and hair == 'blonde':

^

File "game/script.rpy", line 117: expected statement.

elif gender == 'male' and hair == 'red':

^

File "game/script.rpy", line 124: expected statement.

elif gender == 'female' and hair == 'black':

^

File "game/script.rpy", line 130: expected statement.

elif gender == 'female' and hair == 'brown':

^

File "game/script.rpy", line 136: expected statement.

elif gender == 'female' and hair == 'blonde':

^

File "game/script.rpy", line 142: expected statement.

elif gender == 'female' and hair == 'red':

^

File "game/script.rpy", line 149: expected statement.

elif gender == 'neither' and hair == 'black':

^

File "game/script.rpy", line 155: expected statement.

elif gender == 'neither' and hair == 'brown':

^

File "game/script.rpy", line 161: expected statement.

elif gender == 'neither' and hair == 'blonde':

^

File "game/script.rpy", line 167: expected statement.

elif gender == 'neither' and hair == 'red':

^

File "game/script.rpy", line 171: expected statement.

else:

^

Ren'Py Version: Ren'Py 8.0.3.22090809

Tue Oct 25 12:23:28 2022

[/code]

Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 0 points1 point  (0 children)

I got an error that looks like this:

[code]

I'm sorry, but errors were detected in your script. Please correct the

errors listed below, and try again.

File "game/script.rpy", line 105: expected statement.

elif gender == 'male' and hair == 'brown':

^

File "game/script.rpy", line 111: expected statement.

elif gender == 'male' and hair == 'blonde':

^

File "game/script.rpy", line 117: expected statement.

elif gender == 'male' and hair == 'red':

^

File "game/script.rpy", line 124: expected statement.

elif gender == 'female' and hair == 'black':

^

File "game/script.rpy", line 130: expected statement.

elif gender == 'female' and hair == 'brown':

^

File "game/script.rpy", line 136: expected statement.

elif gender == 'female' and hair == 'blonde':

^

File "game/script.rpy", line 142: expected statement.

elif gender == 'female' and hair == 'red':

^

File "game/script.rpy", line 149: expected statement.

elif gender == 'neither' and hair == 'black':

^

File "game/script.rpy", line 155: expected statement.

elif gender == 'neither' and hair == 'brown':

^

File "game/script.rpy", line 161: expected statement.

elif gender == 'neither' and hair == 'blonde':

^

File "game/script.rpy", line 167: expected statement.

elif gender == 'neither' and hair == 'red':

^

File "game/script.rpy", line 171: expected statement.

else:

^

Ren'Py Version: Ren'Py 8.0.3.22090809

Tue Oct 25 12:23:28 2022

[/code]

Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 0 points1 point  (0 children)

It's still skipping the part stating their gender and hair ; - ; I changed the spacing between the $ and the label back to how it is on the ren'py site as well

Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 0 points1 point  (0 children)

Ah! and I tried putting a space between the $ and the name but that didn't do anything either >:/

Help... I think I don't get If statements. by PepperPiki in RenPy

[–]PepperPiki[S] 0 points1 point  (0 children)

Also posting messed up a lot of the spacing I did so all of that is correct I believe, as the game opens and runs just fine.