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 a query in an @{selected| command?

1418334691
Ziechael
Forum Champion
Sheet Author
API Scripter
I fear that my question might be sort of answered by this thread: Macro Queries that dropbox a list of Macros However since my question is disparate enough i though i'd start a new thread. I want to write a general 'ability' check macro along the lines of: @{selected|character_name} performs a Wisdom check: [[(1d20 + @{selected|wis-mod}) + ?{Other Bonus|0}]] v DC ?{DC Target:|0}. However i would like something that could be customised as follows: @{selected|character_name} performs an ability check: [[(1d20 + @{selected|?{Ability?|Ability-Abbrev.}-mod}) + ?{Other Bonus|0}]] v DC ?{DC Target:|0}. I'm hoping there is a way to do this so that the macro user could type str, dex, con, int, wis or cha into a prompt which would tell the macro to look at str-mod etc... what do we think? It doesn't work in its present form but i'm still new to macros. Thanks for any thoughts.
1418336232

Edited 1418336970
vÍnce
Pro
Sheet Author
AFAIK a roll query won't allow attributes or macros as input. It will just show as text. I often use [[1d20+?{Modifier?|0}]] for general checks or for a little more info ?{Ability/Skill Used?|0} [Check]: [[1d20+?{Modifier?|0}]]
1418338363
Gen Kitty
Forum Champion
What you need is here: <a href="https://wiki.roll20.net/Dice_Reference#Order_of_Op" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Op</a>... Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears). Macros are expanded, including nested macros up to 99 levels deep. Variables are substituted Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula) Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula. The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction). The bolding is mine. You can use roll queries to do some interesting things, but those things are limited in scope.
1418339587
Ziechael
Forum Champion
Sheet Author
API Scripter
I kinda figured that was the case, the other thread i linked had similar order of operations issues, i just hoped there might be a work around (wasn't important enough to be API worthy, just a cunning way to avoid lots of macros ;) ). Thanks for confirming the impossibility though, i'm just going to write a lot of macros and tell my players that they exist in #... form so that they can quickly pull them out of the bag when needed. I almost prefer it that way so i can customise the 'message' further, for example: Move Silently check @{selected|character_name} treads lightly: [[1d20 + @{selected|movesilently} + ?{Other Bonus|0}]] v DC ?{DC Target:|0}.