We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
Accept
Advertisement Create a free account

(Macros) Turn tracker calls are not called in the expected order.

Steps to reproduce: 1- select a token with name A 2- type [[5 &{tracker}]] in chat and press enter 3- type [[1 &{tracker}]] [[@{tracker|A} * 2 &{tracker}]] in the chat and press enter 4-type Result: @{tracker|A} in the chat and press enter expected behavior: The token gets a turn tracker value of 5, after that it is changed to 1 and in the end it becomes 1*2 = 2 observed behavior: The token gets a turn tracker value of 5, and in the end it becomes 5*2 = 10 Note: my guess is that everytime a &{tracker} call is made, the new tracker value is added to a queue, which applies only after the current roll ends, instead of being applied immediately, so the @{tracker} calls in the same roll only see what was in the tracker before the current roll.
1593490391

Edited 1593490649
Oosh
Plus
Yep, that's from the order of operations - Attribute calls are resolved before the math is done. So what the tracker is actually seeing is: [[1 &{tracker}]] [[ (5) * 2 &{tracker}]] so it accepts the value of 1 then accepts the value of 10. The only way to have the first line of math done & sent to the tracker before the Attribute call is resolved is to send it to chat first, then run the second line.