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

Resolve roll query without showing dialog?

1460123839
Lucian
Pro
API Scripter
Hi, I was wondering if it is possible to "short-circuit" a roll query? Some sheet rolls include roll queries to take account of things like spell slot levels etc. In some situations, these sheet rolls are triggered from a context where the value of this roll query is known in advance, (e.g. an API command triggering the roll based on some prior input) and so the prompt is redundant. Is there any way to provide it with an answer in advance so the prompt never appears? My main use case for this is from the API, but I'd also be interested in options from a macro/the chat window
1460130861
vÍnce
Pro
Sheet Author
Lucian said: Hi, I was wondering if it is possible to "short-circuit" a roll query? Some sheet rolls include roll queries to take account of things like spell slot levels etc. In some situations, these sheet rolls are triggered from a context where the value of this roll query is known in advance, (e.g. an API command triggering the roll based on some prior input) and so the prompt is redundant. Is there any way to provide it with an answer in advance so the prompt never appears? My main use case for this is from the API, but I'd also be interested in options from a macro/the chat window AFAIK, you cannot "pre-select" a query.  That would be a nice feature though.  Kind of like automating a query.
1460131778

Edited 1460131819
Not that I know of but you can bring up a query that gives only one option. So if want a set spell level per se you could add a repeat of the query with the level as two pulldown options that are the same. i.e.  ?{Spell Level|2|2}   With that set then the player wouldn't be able to select anything but the level you wanted to use. I do this with magic items ans scroll when I make spell macros for them.  
1460136924
Silvyre
Forum Champion
An API Script could change the value of an Attribute that contains the Roll Query to a number (and back). Chance are, you're&nbsp;already calling sheet rolls from Ability Command Buttons within the text chat :). So, one API chat command could simultaneously modify the Attribute and call the "spellbook" macro without really adding an "extra click". Otherwise, this would make a great Suggestion. :) If a goal is minimizing user input across multiple Roll Queries, you could look into nesting Roll Queries to a certain effect, e.g.: <a href="https://app.roll20.net/forum/permalink/2924047/" rel="nofollow">https://app.roll20.net/forum/permalink/2924047/</a> /me [...] rolls a [[1d20 + 0 + 0 + ?{Usage| Standard, 0 ]] for Skill! | Ability 1, 10 [Ability 1] + ?{Secondary Usage&amp;#124; &nbsp;&nbsp;&nbsp; None&amp;#44; 0]] for Skill! &amp;#124; &nbsp;&nbsp;&nbsp; Ability 2&amp;#44; 10 [Ability 2] ]] for Skill! Ability 2 flavour text! &amp;#124; &nbsp;&nbsp;&nbsp; Other&amp;#44; 0?{Modifier&amp;amp;#124;0&amp;amp;#125; [Other Modifiers] ]] ``(modified by ?{Modifier&amp;amp;#125;)`` for Skill! &amp;#125; Ability 1 flavour text! | Ability 2 - on this "layer" of nesting&amp;#44; escaped commas look like: &amp;#44; but notice that the Query commas look like: , 20 [Ability 2] + ?{Secondary Usage&amp;#124; &nbsp;&nbsp;&nbsp; None&amp;#44; 0]] for Skill! &amp;#124; &nbsp;&nbsp;&nbsp; Ability 1 - on this "layer" of nesting&amp;amp;#44; escaped commas look like &amp;amp;#44; but notice that the Query commas look like: &amp;#44; 10 [Ability 1] ]] for Skill! Ability 1 flavour text! &amp;#124; &nbsp;&nbsp;&nbsp; Other&amp;#44; 0?{Modifier&amp;amp;#124;0&amp;amp;#125; [Other Modifiers] ]] ``(modified by ?{Modifier&amp;amp;#125;)`` for Skill! &amp;#125; Ability 2 flavour text! | Other, 0?{Modifier&amp;#124;0&amp;#125; [Other Modifiers] ]] ``(modified by ?{Modifier&amp;#125;)`` for Skill! }
1460137161
Lucian
Pro
API Scripter
Thanks to all have answered. I think probably what I'm going to do is to see if we can get the roll expressions moved into variables where I need to access them, so that I can replaced out the roll queries before sending them off. My goal here is to avoid duplication of the sheet code as much as possible, which is why I don't just want to rebuild the roll expressions from scratch - and obviously you can't access the contents of sheet rolls directly from the API. By moving the expression into a variable and having the roll launch that instead, I think it might be ok though! Thanks again,