Tiur
Well-Known Member
- Nov 13, 2021
- 1,317
- 3,640
Are you sure the game's considering it to be "yes"? That condition is terribly-written. Mixing AND and OR without parentheses is a recipe for misunderstandings just like this one.Hello,
I have a variable with kay_sic==“yes”
View attachment 4915777
or in the mod the variable is set to “no.”
View attachment 4915778
The game considers it to be “yes.” I tried to create it again, but nothing worked.
Is this a coding error in the game itself? It seems that the developer is forcing us to take this path.
The game is: Doors part 2
As written, that condition is
True
if kay_def
is "yes" (which it is), or if all three of kay_sic
, lunaroute
, and kay_dom
are "yes". If this isn't what the dev intended, then yes, it's a logic error (as in, a dev mistake rather than a code error; the code is doing exactly what it was written to do).In the absence of parentheses, Python evaluates the main three logical tests in this priority: OR > AND > NOT
So because that condition is "A AND B AND C OR D", it gets read as "((A AND B AND C) OR D)". If the intent of the dev was that it instead be (A AND B AND (C OR D)), they should have used parentheses, because that's how logical OR works in Python.