"Neither true nor false"

I’m having trouble with the stats, I’ve been struggling a bit with it

The error I’m getting is “Neither true nor false”

My code looks like this:

*label testing
*set Height "above or equal to 6'3"
*set extra "Scar"
*if ((Height = "above or equal to 6'3") and (extra = "Scar")) and Intimidating < 50
    sup
    *goto intimidatin
*else
    soop
    *goto intimidatin
*label intimidatin

1 Like

I’m going to assume that you have the Intimidating variable declared somewhere else. If you have 3 conditions in an if statement, you have to wrap the whole expression in () so that you always have comparisons between at most two operands. What does that mean in plain English:

if you have conditions A, B, and C you write the if like so

*if (((A = value) and (B = value2)) and (C = value3))

First A = value is evaluated, then B = value2 is evaluated, then the result is compared with C = value3

For your specific problem, you have to write it like so:

*if (((Height = "above or equal to 6'3") and (extra = "Scar")) and (Intimidating < 50))

When in doubt about how many () to put when constructing an if, just construct the expression one condition at a time. So in your case, first put the 1st condition

*if (Height = “above or equal to 6’3”)

next, add the second and wrap it in () so we can compare it with the 3rd parameter as one single expression

*if ((Height = “above or equal to 6’3”) and (extra = “Scar”))

Lastly, add the last condition and wrap the whole thing in ()

*if (((Height = “above or equal to 6’3”) and (extra = “Scar”)) and (Intimidating < 50))

You can use the same technique for adding 4 or more conditions, although in that case, I would recommend storing the intermediate states in a separate variable.

4 Likes

Put Intimidating < 50 in parenthesis
So your if line is
*if ((Height = “above or equal to 6’3”) and (extra = “Scar”)) and (Intimidating < 50)

EDIT: Also what quartsz said, didnt see they answered while I was typing

1 Like

Thanks a lot! That solved my question and also will help me with future things! You too @dreamofeden <3

Well, the error did go away, But it keeps showing me “Soop” instead of “Sup” for some reason even though I set all of the extras there, and the intimidating factor is set on 60

Are you sure you aren’t setting it to 50 somewhere else?

1 Like

Yes, I’m pretty sure that it’s “60” in the start-up. This is the second chapter but I put “goto Testing” right on top and I also put “Chapter_2” first in scene_list

Hard to say where the issue is, try typing the variables before the if so we can see what the values are:

Height: ${height}
Extra: ${extra}
Intimidating: ${Intimidating}

*set Height "above or equal to 6'3"
*set extra "Scar"
*set Intimidating 60
*if (((Height = "above or equal to 6’3") and (extra = "Scar")) and (Intimidating > 50))
    sup
    *goto intimidatin
*else
    soop
    *goto intimidatin
*label intimidatin

I just put the “set” so that I would get the sup but I’m still not getting the desired result.

your apostrophe characters are different

6'3 vs 6’3

I had a mental breakdown at that /j Lmfao, Thanks a lot!!

1 Like

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.