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

How do you do a roll query macro that gives a template answer?

1513377659

Edited 1513377884
Hi, i'm pretty new to macro's & roll20 itself. I've been curious to figure out how i can use the default template (for example): &{template:default} {{name=Second Wind}} {{Heal Self=[[1d10+@{Base_level}]] HP}} {{Description= Okori draws from his limited well of stamina to protect himself from harm.}} {{Type Action= Bonus Action}} and insert that into the value of a roll query menu My goal is to have all my possible Bonus action fitted into 1 button, so i can just press 1 button and it gives me a dropdown menu with what  bonus action options I have acces to. For example: - second wind - cunning action - hide - cunning action - dash - cunning action - disengage I want it to give me the name/roll/description effect like the earlier mention template code when i click on 1 of the options of the dropdown menu. Is this possible?
Yep check right here: <a href="https://wiki.roll20.net/Macros#Drop-Down_Prompts_f" rel="nofollow">https://wiki.roll20.net/Macros#Drop-Down_Prompts_f</a>...
Courtney T. said: Yep check right here: <a href="https://wiki.roll20.net/Macros#Drop-Down_Prompts_f" rel="nofollow">https://wiki.roll20.net/Macros#Drop-Down_Prompts_f</a>... I used that to create the following: ?{What action| None, | Dash, **Okori Dashes using his Cunning Action** He may move [[2*@{speed}]] feet. | Disengage, **Okori Disengages using his Cunning Action** His movement don't provoke opportunity attacks for the rest of the turn. | Hide, **Okori Hides using his Cunning Action** [[1d20+@{stealth_bonus}]] **Stealth roll attempt** VS Active Perception } But that only gives standard text without the template. the moment i try to enter the template into the value it breaks the macro.
1513420138
Ziechael
Forum Champion
Sheet Author
API Scripter
I'm on my phone so can't link but you'll need to refer to the macro section of the wiki, specifically the section about advanced usage for queries. What you want is doable but fiddly ;) will try to post more specific help later
Bascially, relpace } with &#125; for the most part. You have to replace any | and , as well and the code for that is seen above.&nbsp; For example, if you were to take the template from your original post and add it to the normal text query, you would get something like ?{What action| None, | Dash, **Okori Dashes using his Cunning Action** He may move [[2*@{speed}]] feet. | Disengage, **Okori Disengages using his Cunning Action** His movement don't provoke opportunity attacks for the rest of the turn. | Hide, **Okori Hides using his Cunning Action** [[1d20]] **Stealth roll attempt** VS Active Perception | Second Wind, &{template:default&amp;#125; {{name=Second Wind&amp;#125;&amp;#125; {{Heal Self=[[1d10]] HP&amp;#125;&amp;#125; {{Description= Okori draws from his limited well of stamina to protect himself from harm.&amp;#125;&amp;#125; {{Type Action= Bonus Action&amp;#125;&amp;#125;} If you follow the same format, you can enter anything in the template like that.
1513458757
Ziechael
Forum Champion
Sheet Author
API Scripter
In addition to the summary above (Thanks Vanakoji!) I'd just add that attribute calls don't require the html entities just the rogue , | } often found in nested queries and roll templates. So @{speed} works fine but {{Speed=@{speed} }} would need to be {{Speed=@{speed} &amp;#125;&amp;#125;
the above post edited the code into the actual characters you want &#.123; for {, &#.124 for |, &#.125 for }, and &#.44 for commas. Take out the periods in the &# codes to make them work. I had to add periods so the forum wouldn't replace with the actual characters.&nbsp;
1513602455

Edited 1513602474
GiGs
Pro
Sheet Author
API Scripter
Could you put them in a code block to avoid having to use periods? Testing: &nbsp;{ for {, &#124 for |, &#125 for }, and &#44 for commas Edit: nope, that didnt work, lol.
1513603220
Ziechael
Forum Champion
Sheet Author
API Scripter
You have to nest them to get them to display correctly in the forums, &amp;amp;#124; for example would result in &amp;#124;, for further levels of nesting just add more amp; between the & and the # :)
1513604090
GiGs
Pro
Sheet Author
API Scripter
Ah, that makes sense.
Vanakoji said: Bascially, relpace } with } for the most part. You have to replace any | and , as well and the code for that is seen above.&nbsp; For example, if you were to take the template from your original post and add it to the normal text query, you would get something like ?{What action| None, | Dash, **Okori Dashes using his Cunning Action** He may move [[2*@{speed}]] feet. | Disengage, **Okori Disengages using his Cunning Action** His movement don't provoke opportunity attacks for the rest of the turn. | Hide, **Okori Hides using his Cunning Action** [[1d20]] **Stealth roll attempt** VS Active Perception | Second Wind, &{template:default&#125; {{name=Second Wind&#125;&#125; {{Heal Self=[[1d10]] HP&#125;&#125; {{Description= Okori draws from his limited well of stamina to protect himself from harm.&#125;&#125; {{Type Action= Bonus Action&#125;&#125;} If you follow the same format, you can enter anything in the template like that. Using your editted code i managed to input all the actions as a template!, thanks a lot!!! here it is for anyone interested: ?{What action| None, | Dash, &{template:default&#125; {{name=Cunning action - Dash&#125;&#125; {{Bonus movement=[[2*@{speed}]] ft&#125;&#125; {{Description= Okori Dashes using his Cunning Action.&#125;&#125; {{Type Action= Bonus Action&#125;&#125; | Disengage, &{template:default&#125; {{name=Cunning action - Disengage&#125;&#125; {{Description= Okori's movement don't provoke **Attacks of Opportunity** for the rest of the turn.&#125;&#125; {{Type Action= Bonus Action&#125;&#125; | Hide, &{template:default&#125; {{name=Cunning Action - Hide&#125;&#125; {{Stealth roll=[[1d20+@{stealth_bonus}]]&#125;&#125; {{contested by= Enemy Perception check roll&#125;&#125; {{Description= Okori Attemps to hide after breaking line of sight with the enemy. On a succesful roll Okori becomes stealthed. An enemy may take an action(perception check) during their turn to search for okori. &#125;&#125; {{Type Action= Bonus Action&#125;&#125; | Second Wind, &{template:default&#125; {{name=Second Wind&#125;&#125; {{Heal Self=[[1d10+@{base_level}]] HP&#125;&#125; {{Description= Okori draws from his limited well of stamina to protect himself from harm.&#125;&#125; {{Type Action= Bonus Action&#125;&#125;}