choicescript icon indicating copy to clipboard operation
choicescript copied to clipboard

Two stages needed to *set a negative value on a new *temp

Open playdeezgames opened this issue 14 years ago • 1 comments

The following will not work:

*temp mytemp
*set mytemp -1

The workaround:

*temp mytemp
*set temp 0
*set temp -1

This issue has both to do with NUMBER as well as how setVar looks for an operator at the start of the string. What winds up happening is that temp.mytemp is equal to null, and setVar attempts to -=1 to it in the call to set.

playdeezgames avatar Apr 12 '10 14:04 playdeezgames

Similarly, one can't compare a variable against a negative number, like (number < -10); one has to compare ((0 - number) > 10) instead.

ChrisPC avatar May 08 '11 05:05 ChrisPC