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

Any way to get a roll query choice/selection listed in addition to the result of the formula that it is a part of (other than just adding text to the result)?

I currently use an attack formula that includes a Roll Query prompting whether the attack was made with Advantage, etc. I WAS using it in a way that allowed for the result of the attack to be put in a default template output alongside text that stated whether the attack roll was made as as Standard attack, with Advantage, or Disadvantage and that was working fine, but now I am trying to implement a further mechanic that is calculating another number for me and it uses that whole attack roll inside of that calculation. This is problematic for the results that I was used to getting before, because now the text portion of the Roll Query outcome can't be in there anymore, since it messes up the overall formula that now surrounds that earlier calculation. So, does anyone know of a way to still include the Roll Query choice in the outcome of a calculation if that calculation has to be a part of another larger calculation? Is there an API way to do it perhaps, if a Macro can't handle that on it's own? Thanks. (Examples of what I'm talking about below.) Previous: /w gm &{template:default} {{name=@{attack_name_3}}} {{Attack Roll= [[ @{attack_bonus_3} + ?{Roll Type|Standard,1d20 ]] Standard|Advantage,2d20kh1 ]] Advantage|Disadvantage,2d20kl1 ]] Disadvantage} }} Current: /w gm &{template:default} {{name=@{attack_name_1}}} [[ [[ {floor(([[@{attack_bonus_1}+?{Added_Momentum|0}+?{Roll Type|Standard,1d20 ]]|Advantage,2d20kh1 ]]|Disadvantage,2d20kl1 ]]}-@{target|armor_class})/5),0}kh1 ]] ]] {{``ATTACK ROLL:``=$[[0]] (with ``[[?{Added_Momentum|0}]]`` Momentum used)}} But the Current one can't list out the Roll Query choice, since it is text that was added to the value and doesn't fit in the new calculation. (And no, I don't want the player to simply select the same result from two Roll Queries, either - i.e. one for the formula and one for the text.) Thanks.
And I know that this is the Macro section, not the API section, but I'm going to ask anyway since this just occurred to me... Does anyone know if the following would be viable as a means of solution to my above question? (I would test it myself, but I don't know the ChatSetAttr commands yet.) The players are prompted with a Roll Query that asks whether they are rolling Standard, Advantage, or Disadvantage and in the corresponding formula, if their choice was Standard, for example, then it might say - Standard|<ChatSetAttr command that creates an attribute titled "Attack_Roll", for example, and rolls a d20 and assigns that value to it> <ChatSetAttr command that creates an attribute titled "Attack_Roll_Type", let's say, and assigns a value (in text form) to fill that field based on the choice the player made in the Roll Query>[[@{Selected|Attack_Roll}]] (in order to now call the value that was assigned to the newly created "Attack_Roll" attribute so that it could be included still as a numerical value in the overall formula still)... And would this all still allow those newly created attributes to be called on at later times in the macro, like allowing me to then list the "Attack_Roll_Type" after the attack roll result in a default template, for example?
1599986519
GiGs
Pro
Sheet Author
API Scripter
I'm having trouble parsing exactly what you need. This question might relate to your issue:&nbsp; <a href="https://app.roll20.net/forum/post/9174947/chatsetattr-and-multiple-uses" rel="nofollow">https://app.roll20.net/forum/post/9174947/chatsetattr-and-multiple-uses</a> . You cant change an attribute's value, and use that updated attribute in the same macro, due to roll20's order of operations. If on the other hand, you want to use a query inside another query, thats the classic nesting problem requiring html substitutions, and I walk away from those questions muttering "no please no" these days. Some information:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a>
1599991294

Edited 1599991390
Oosh
Sheet Author
API Scripter
The easiest way would be to put a bit more inside the Query so you can change the {{name}} field depending on roll type: /w gm &amp;{template:default} [[ [[ {floor(([[@{attack_bonus_1}+?{Added_Momentum|0}+?{Roll Type| Standard,1d20]] -@{target|armor_class})/5)&amp;#44;0&amp;#125;kh1 ]] ]]{{name=@{attack_name_1}&amp;#44; normal| Advantage,2d20kh1]]-@{target|armor_class})/5)&amp;#44;0&amp;#125;kh1 ]] ]]{{name=@{attack_ name _1}&amp;#44; advantage| Disadvantage,2d20kl1]]-@{target|armor_class})/5)&amp;#44;0&amp;#125;kh1 ]] ]]{{name=@{attack_ name _1}&amp;#44; disadvantage}}} {{``ATTACK ROLL:``=$[[0]] (with ``[[?{Added_Momentum}]]`` Momentum used)}}
Oosh, that's thinking outside the box - Genius! Thanks a ton, I can definitely use that. Very much appreciated.&nbsp; (And GiGs, thanks for your response, too. Even if a response doesn't always come up with the answer, just the fact that you took the time to respond is still appreciated as well.)