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.
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 ortail 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”.
@Havenstone@CorvusWitchcraft
Ooh, I’m such a dummy. 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.