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

Which comes first: Chicken or the Egg

I've been working on a macro for magic missile. I have one that works for the most part but there is some functionality that perplexes me. In the following code I have a query for the number of targets followed by another query that sets up a call for each target. The macro is designed to as for a certain number of calls based on the number of targets in the first query. That said, every time I use the macro I am asked to select the target calls before specifying how many targets I select. I have a simplified version of this macro that exhibits this behavior. Is there something I'm overlooking or is this something I'll have to live with?  ?{Targets? |1 , [[ ?{Target 1 | 1d4+1 } ]]  |2 , [[ ?{Target 1 | 1d4+1 } ]] force damage and [[ ?{Target 2| 1d4+1 } ]]  }} force damage to  ?{Targets? |1 , to @{target|1|token_name}.   |2 , to @{target|1|token_name} and @{target|2|token_name}. }}
1624665828
Kraynic
Pro
Sheet Author
The dice roller is trying to fill in all the values from attributes (which includes target attributes).&nbsp; If you check out where that lands in the order of operations, it makes sense what you are seeing. <a href="https://wiki.roll20.net/Dice_Reference#Order_of_Operations" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Operations</a>
If I'm understanding this correctly, since&nbsp; you can't force a variable to be interpreted before an attribute call, the only way to remove erroneous target calls would be to have 5 different macros depending on the number of desired targets.
1624667578
Kraynic
Pro
Sheet Author
You could do that and use a chat menu instead of a query.&nbsp; You would trigger the menu that would have individual buttons for the macros with different numbers of targets.&nbsp; Then when you click one of those, it would ask you to select the targets. <a href="https://app.roll20.net/forum/permalink/5927072/" rel="nofollow">https://app.roll20.net/forum/permalink/5927072/</a>