Is it not possible to have two not(var) between *if and a choice?

Hello!
I ran into a problem with code. I want the player to see a choice only if (vom) isn’t true, or if (tail) isn’t true. But the choice appears even if either (vom) or (tail) is true. I’m not getting an error, does it mean that having two not(var) between *if and a choice simply doesn’t work in choicescript?

I can actually work around it considering my entire code, but it would be easier if this worked, and I would also like to know so I know better in the future.

I have my code below. Thanks to everyone who helps!

*if not(vom) or not(tail)
            #I stay in my current guard, expecting a faint and prepared to answer it. (+2 stamina)
                *finish

I also tried this:

*if ((not(vom)) or (not(tail))) #I stay in my current guard, expecting a faint and prepared to answer it. (+2 stamina)
            *finish

Btw, just to prevent confusion: the code itself is working. I’m not getting an error. The variables are set correctly, that is one of them is false, but the choice is appearing regardless.

I’m using CSIDE, if that matters.

Try parenthesis
*if (not(vom) or not(tail))

I don’t get what you want. The code is doing exactly what you described you wanted it to do.

If at least one is false, show the choice. That’s what’s gonna happen.

1 Like

Like cup_half_empty, I’m not entirely clear about how you want the code to behave.

This is consistent with how your code should be, and seemingly is, working. However…

This is also consistent with how the code is meant to behave, because the choice should still appear even if only one of the variables is false. That’s what the or operator means: it covers any scenario where either of the conditions are met, in this case vom being false or tail being false. The only situation in which the choice won’t appear is if both variables are true.

Is this really what you want? Because the rest of your message make it sound like what you actually want is for the choice to not appear if either variable is true (meaning it only does appear if both variables are false), which is a different thing.

If that’s what you’re going for, you’ll want the code to use the and operator instead, so it looks more like this:
*if not(vom) and not(tail)

Also, I think you mean “feint” rather than “faint”.

4 Likes

If you want the choice to not appear if either (vom) or (tail) is true, then what you need is

*if not(vom) and not(tail)

not

*if not(vom) or not(tail)

Edit: ninja’d!

2 Likes

@Havenstone @CorvusWitchcraft
Ooh, I’m such a dummy. :smiling_face_with_tear: You are right, I should have used and, not or, and that gives the result I actually wanted. Thanks for the help. In my misunderstanding of the problem, I tried several different variations of the code with different parantheses before posting here so I don’t create a pointless post, but I did it anyways. I also got myself confused so much that I didn’t explain it correctly. Silly me. Sorry guys.

1 Like

You’re not a dummy. :slight_smile: Logic tangles happen. Well done asking for help.

3 Likes

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