($gameVariables.value(16) != 43 && $gameVariables.value(17) != 33)
Ok, so I am using these two variables to check the players coordinates. As long as they are not standing on that tile. For some reason it is reading the &&
like it is an or symbol. Am I missing something?
Let's call V[16] "x" and V[17] "y".
If x = 40 and y = 30, the statement evaluates to true, so far so good.
However if x = 43 and y = 30, the JS is gonna come along and evaluate the first part as
43 != 43 which is obviously false. After that, "
false && anything" will always be false, because
&& specifies that both expressions have to be true for the whole condition to be true.
To put it simply, you actually
want an OR (
||) in there when the conditions are exclusionary (
!==). It's kind of the opposite to when you're doing inclusionary/positive conditions (
===), in which you'd use AND. So yeah, it isn't very intuitive sometimes, but it can make sense if you work through the logic.