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 .
×
The Roll20 Black Friday sale is live now! Up to 30% Off Your Favorite Content!

Macro expansion not according to Order of Operations

Say we select a token ("SomeToken") that is bound to a character sheet with the following attribute: SomeAttribute = 6 Then we call the following macro: /r @{selected|?{AttributeName}} First, an error message will appear in the chat window: No attribute was found for @{SomeToken|?{AttributeName} Then we get pompted to input the variable, which we do: SomeAttribute Last, another error message appears in the chat window: There was an error with your formula. Please try again. According to the Dice Reference, the first 4 steps of the operation order are repeated until all symbols are resolved, which is not the case at the moment. I also tried the following combinations with different errors: /r @{selected|?{AttributeName}} /r @{selected|?{AttributeName}} So there are the following issues: There should be more than one expansion cycle. The "No attribute was found" message should only be shown after there is no difference in two expansion cycles and there are still unresolved symbols. Keep up the good work and let me know if you need more information!
1479068633

Edited 1479069001
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
This actually is the correct behavior (at least as far as what you are describing, there actually is an issue with the order of operatoins wiki though): In your example, you have a valid attribute call: @{selected|?{AttributeName}} looks for an attribute named ?{AttributeName} on the character linked to the token. Your other tries don't actually get around this, as the html is expanded as soon as you hit enter (but after all the variable, macro, ability, and query expansions), resulting in the chat looking for an attribute called @{selected|?{AttributeName}} or there not being an actual attribute call respectively. In order to use a roll query to select an attribute name, you would need to do ?{AttributeName|list of all the possible attributes separated by bars} The problem that does exist in the order of operations wiki though is that there are actually two expansions (three if you count the roll expansion). Abilities, macros, and attributes are expanded as described (recursing up to 99 times as described) and then roll queries are expanded (up to 99 levels deep as described) instead of there being one cycle involving all of them.