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

Query Macro Help

So I'm having trouble calling a command within a query. For the Advanced 1st Edition character sheets, there is a command to roll a weapon you've input information for using %{selected|repeating_weapon_$X_attack-roll}  ($X changes to $0, $1, $2 depending on which weapon you are trying to reference.) Now I can get this to roll fine on its own in a separate macro, but what I want to do is collect multiple of these commands into a query, so I can have a drop down menu of the weapons I have, and can choose one. Now, I've been trying to use the HTML coding, but it's not working for me, so I figured I would drop a line here and see if someone can spot the mistake I'm making. Here's what I have: ?{Choose your weapon!| Spear,  %{selected|repeating_weapon_$0_attack-roll}| Shortsword,  %{selected|repeating_weapon$1_attack-roll}} I've been fiddling with it for hours now and can't find anything, so any help would be appreciated! Thank you so much. 
1536727830

Edited 1536727866
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
due to how roll queries work, this isn't possible (at least assuming that your sheet's rolls have roll templates and/or bars ( | ), commas, or end curly brackets ( } ) ). I'd recommend making a chat menu of ability command buttons: /w @{selected|character_name} &{template:default} {{name=Weapon Menu}} {{[Spear](~selected|repeating_weapon_$0_attack-roll)=[Shortsword](~selected|repeating_weapon_$1_attack-roll)}}
Yah essentially the problem is, it is the sub-macro being called by the query that needs to be using the character substitutions, not the top level macro with the query.  One of those things that trip up everyone at some point.