Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
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
Sheet Author
API Scripter
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.