It looks like you're new here. If you want to get involved, click one of these buttons!
(if: $var is -1)[ blah blah blah]Here's what ive been doing and there is not error message it just doesn't do what is after the if statement even when it is a negative.
(link: "test")[(set: $affection to -1)(goto: "test2")]this is on the second passage test2
(if: $affection is < 0)[ You are dead.] (print: $affection)When it prints the variable it is indeed -1 however it does not show the you are dead text. any help would be appreciated.
Comments
I don't see anything else wrong off hand, but my brain's a bit cooked right now. Twine absolutely has the ability to compare negatives, since its mostly JavaScript with a bunch of syntactic sugar on top.
Edit.
I don't know that there is a harlowe 2.1.1. Are you sure you aren't using twine 2.1.1 and harlowe 1.x? I think the feature I described above that allows "is" and other operators to be used together is a harlowe 2.x thing. In other words, your problem is probably that you need to delete the "is" from your (if:) macro.
So it says if it's smaller or equal to -1. That's what I always do.
As I said in my previous comment, "is" really, really, really shouldn't be used with other operators, because it is a TwineScript operator already (for "==="). Harlowe 2.x allows it, but it isn't a good habit to be in, and it's still an error--you're counting on Harlowe to fix the error for you.
Also, x <= -1 and x < 0 are functionally the same. There are some reasons to occasionally choose one over the other, but either one should work.
I think you started this topic as a discussion rather than a question. Not a big deal, happens all the time. If it were a question, you'd see an option to "accept this answer" at the bottom of every comment.
I know that x <= -1 and x < 0 are the same, but the first one always works with me. And, sorry, I forgot to take the "is" out.
That's what I do.