I kept getting errors trying to do a simple <= and $var - $var.
the error message was it was expecting a string and wouldn't add them.
when i took the $var out of a datamap and made them unique independent variables the error went away.
wondering if anyone else encountered this issue?
code:
(set: $tick's battrack to $tick's roomtrack) and
(if: (30 <= ($tick's roomtrack - $tick's battrack)) is true)[true]
produces an error about booleans and strings
code:
(set: $roomtrack to 30)(set: $battrack to 0)
(if: (30 <= ($roomtrack - $battrack)) is true)[true]
produces [True]
Comments
Also, comparing a conditional expression to one of the boolean values is totally unnecessary and you don't need the extra parenthesis. For example:
the datamap was set on the starting page:
(set: $tick to (datamap: "roomtrack", 0, "battrack", 0))
its now:
(set: $roomtrack to 0)
(set: $battrack to 0)
its not a huge deal since i'm only tracking those 2 variables, a way to "pass time" by moving between passages, compared to when i "plugged a battery in to charge"
i honestly believe its a glitch in the datamap system.
If you initialise your variable(s) like so (set: $tick to (datamap: "roomtrack", 0, "battrack", 0)) and then you subtract one from the other like so $tick's roomtrack - $tick's battrack then the result is going to equal zero.
Because thirty is not less than or equal to zero the condition of your (if:) macro is going to return false, so the associated hook will not be processed.
Where as if you change roomtrack to a number larger than thirty (like forty) and remove the coed that assigns roomtrack value to battrack then your (if) condition will return true, which will cause the associated hook to be processed.