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

Nesting Query inside calling sheet ability

Hey eFriends! I've been struggling with trying to get a specific macro working. Now I'm wondering if it's even possible to nest a query inside calling a sheet ability. My goal here is to have one macro that queries one time for a PC, then outputs their pedigree info like stats and proficiency bonus. Here's the macro I'm trying to make: /w gm &{template:npcaction} {{rname=?{Who?|PC 1|PC 2|PC 3|PC 4}'s Stats}} {{description=**STR:**  [[@{?{Who?}|strength_mod}]] **DEX:** [[@{?{Who?}|dexterity_mod}]] **CON:** [[@{?{Who?}|constitution_mod}]] **INT:** [[@{?{Who?}|intelligence_mod}]] **WIS:** [[@{?{Who?}|wisdom_mod}]] **CHA:** [[@{?{Who?}|charisma_mod}]] **Proficiency Bonus:** [[@{?{Who?}|pb}]]}} I've tried substituting the vertical bars, ending brackets, and commas with their corresponding HTML codes, but it still doesn't generates errors. So...is it even possible to nest a query inside calling a sheet ability? And if so, what am I doing wrong?
1537507746
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
This is not possible due to the order of operations. You'd need to hardcode the character names and make each option be explicit. You could however use the selected/target keywords instead: /w gm &{template:npcaction} {{rname=@{selected|character_name}} {{description=**STR:**  [[@{selected|strength_mod}]] **DEX:** [[@{ selected |dexterity_mod}]] **CON:** [[@{ selected |constitution_mod}]] **INT:** [[@{ selected |intelligence_mod}]] **WIS:** [[@{ selected |wisdom_mod}]] **CHA:** [[@{ selected |charisma_mod}]] **Proficiency Bonus:** [[@{ selected |pb}]]}} This will of course require that there be a token to select/target.
Scott C. said: This is not possible due to the order of operations. You'd need to hardcode the character names and make each option be explicit. You could however use the selected/target keywords instead: /w gm &{template:npcaction} {{rname=@{selected|character_name}} {{description=**STR:**  [[@{selected|strength_mod}]] **DEX:** [[@{ selected |dexterity_mod}]] **CON:** [[@{ selected |constitution_mod}]] **INT:** [[@{ selected |intelligence_mod}]] **WIS:** [[@{ selected |wisdom_mod}]] **CHA:** [[@{ selected |charisma_mod}]] **Proficiency Bonus:** [[@{ selected |pb}]]}} This will of course require that there be a token to select/target. Thanks for the tip and honesty regarding order of operations. I was hoping to avoid the selected target macros, but it seems like that's my only option. Thank you for the coding on it.