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

Using a selection from a drop down

If I use a drop down menu for example this; ?{Weapon|Greatsword,2d6|Longsword,1d8} I can use ?{Weapon} which will bring up the result of the choice;  2d6, if the Greatsword option was selected. Is there also a way to bring up the name of the selection so, Greatsword,  in the example above. Like a ?{Weapon_choice} or something? Thanks for any help D&D 5e OGL if that makes a difference.
1586602008
Ziechael
Forum Champion
Sheet Author
API Scripter
Add the text into the query output: ?{Weapon|Greatsword,Greatsword - [[2d6]]|Longsword,Longsword - [[1d8]]} A query output is literally a replacement so what you get is what you choose.
1586602076
Ziechael
Forum Champion
Sheet Author
API Scripter
If you are using this as part of a larger formula/calculation you'll end up needing to use value tagging instead to avoid breaking the roll: ?{Weapon|Greatsword,2d6[Greatsword]|Longsword,1d8[Longsword]}
1586602166
GiGs
Pro
Sheet Author
API Scripter
You'd either need to use a separate drop down for that (not ideal!), or include more details in the query. For instance you can do I attack with my ?{Weapon|Greatsword,Greatsword /roll 2d6|Longsword,Longsword /roll 1d8} In queries, if you separate an entry with a comma, the bit to the left is what gets displayed in the drop down, and the bit to the right is what the macro uses-  and this can spread over multiple lines. It must not include more commas, | or } characters (except attribute names like @{frodo|strength} are fine), or it'll break the query.