sugarcube 2.17
I've notice that when I and(&&) or or(||) if statements together to make it into one if there is even a simple add or subtraction in the statements they get skipped, or not evaluated. Like
<<if (sim1.age - sim.age2 > 10) && (sim1.relationship >= 4)>> will allow the first test to pass every time, but if left as a single test if it works as it should. Is this a bug?
Comments
Anyway, why are you not using Twine script variables? Are the variables you're using scoped right?
Though as to why it didn't work the first few times I don't know. but I used eval on the statement and it worked fine, then I took eval off and it continued to work.
Aside from the missing story/temporary sigils, there's nothing syntactically wrong with the shown code. In which case, I'd suspect either an initial mistype/misspelling which you've since corrected, and simply missed having done so, or data type shenanigans.
Also, I don't know how fat fingered you normally are, however, since you're using JavaScript's logical AND/OR operators, I'd pay special attention to ensuring you type && and ||, rather than accidentally typing the bitwise operators & and |.