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

Drop down menu choice influence atk and dmg roll

1600878701

Edited 1600878872
Hi everyone,&nbsp; I have a spell that lets the player throw an object to an enemy and, based on the object size, I have different attack and damage rolls. How can I make a macro that lets me choose the size and prints a default template with the attack and damage roll? I looke around a lot but couldn't find anything that works. This is an example that was suggested in this post (<a href="https://app.roll20.net/forum/post/6245471/drop-down-menu-for-weapons" rel="nofollow">https://app.roll20.net/forum/post/6245471/drop-down-menu-for-weapons</a>) but that does not work for me: ?{Object size?| Tiny, &amp;{template:default} {{name=attack with Tiny object}} {{attack=[[1d20+@{pb}+@{strength_mod}+6]]}} {{damage=[[1d4+3]]}}| Small, &amp;{template:default} {{name=attack with Small object}} {{attack=[[1d20+@{pb}+@{strength_mod}+6]]}} {{damage=[[1d8+2]]}}| Medium, &amp;{template:default} {{name=attack with Medium object}} {{attack=[[1d20+@{pb}+@{strength_mod}+5]]}} {{damage=[[2d6+1]]}}| Large, &amp;{template:default} {{name=attack with Large object}} {{attack=[[1d20+@{pb}+@{strength_mod}+6]]}} {{damage=[[2d10+2]]}}| Huge, &amp;{template:default} {{name=attack with Huge object}} {{attack=[[1d20+@{pb}+@{strength_mod}+8]]}} {{damage=[[2d12+4]]}} } When I try the macro I get the popup with "Object size" and a text field that shows " Tiny, &amp;{template:default} {{n " Can you please help me? Thank you very much!
1600885696

Edited 1600885731
Ziechael
Forum Champion
Sheet Author
API Scripter
What we have here is called a 'nested' query, although in this instance you only have one query... fun eh! The issue is that there are certain characters (| , } ) that break queries and need to be replaced with html entities as such: &amp;{template:default} {{name=attack with ?{Object size?| Tiny,Tiny object&amp;#125;&amp;#125; {{attack=[[1d20+@{pb}+@{strength_mod}+6]]&amp;#125;&amp;#125; {{damage=[[1d4+3]]| Small,Small object&amp;#125;&amp;#125; {{attack=[[1d20+@{pb}+@{strength_mod}+6]]&amp;#125;&amp;#125; {{damage=[[1d8+2]]| Medium,Medium object&amp;#125;&amp;#125; {{attack=[[1d20+@{pb}+@{strength_mod}+5]]&amp;#125;&amp;#125; {{damage=[[2d6+1]]| Large,Large object&amp;#125;&amp;#125; {{attack=[[1d20+@{pb}+@{strength_mod}+6]]&amp;#125;&amp;#125; {{damage=[[2d10+2]]| Huge,Huge object&amp;#125;&amp;#125; {{attack=[[1d20+@{pb}+@{strength_mod}+8]]&amp;#125;&amp;#125; {{damage=[[2d12+4]]}}}
It works!!! Thank you very much!!!!
1600935351
Ziechael
Forum Champion
Sheet Author
API Scripter
You are most welcome :) Happy rolling!