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

Macro problem beginner

1578859160

Edited 1578862545
I have a problem with one of my macro and im a beginner, i want my players to be able to search for food or water by selecting food or water and then selecting if the zone they are in is abudant or not in water and food(DC of 10 ,15 or 20), like this: CHARACTER 1 is looking for ? SURVIVAL <span class="userscript-userscript-userscript-userscript-userscript-userscript-inlinerollresult showtip tipsy-n-right" title=" Rolling d20+ {{rname=^{survival-u}}} {{mod=1}} {{r1=15}} {{query=1}} {{normal=1}} {{r2=1}} {{global=}} charname=jean claude vandam = ( 13 )">? VS DC ? If succeed you gain ? pound or gallon but i can't make the selected DC appear here is my macro: &amp;{template:default} {{@{selected|token_name} is looking for ?{Food or Water?}}} {{SURVIVAL [[d20+%{selected|survival}]]}} {{VS}} ?{Environment|Abudant|DC10}]]|,Limited|DC15}]]|,Very little,DC20}]]} {{If succeed you gain [[1d6+@{selected|wisdom_mod}]] pound or gallon}}
1578862821

Edited 1578862963
vÍnce
Pro
Sheet Author
Syntax is very important for macros. Macros can get more complicated when using roll templates and variables/queries , but once you practice a little, you will have a better understanding of how they are constructed. try this &amp;{template:default} {{name=@{selected|token_name} is looking for ?{Food or Water?|food, Food|water,Water|} }}{{SURVIVAL=[[ d20+@{selected|survival} ]] }}{{VS}}{{?{Environment|abundant,Abundant DC=[[10|limited,Limited DC=[[15|very little, Very little DC=[[20|} ]] }}
Thank! it worked and helped me understand how it work a little more.
1578863214
vÍnce
Pro
Sheet Author
Great. Post back if you have any questions.&nbsp; Have fun.
1578866328
GiGs
Pro
Sheet Author
API Scripter
By the way, a query like this ?{Food or Water?|food, Food|water,Water|} can be simplified like so ?{Food or Water?|Food|Water} The | character is used to separate the different items that appear in the dropdown. Sometimes you want to display something in the dropdown, and have something else appear in the chat. Say, for example, you wanted people to pick a die size and then roll it, you could do ?(Pick a Die|d4,[[1d4]] |d6,[[1d6]] |d8, [[1d8]] } In this case, between each | you have two entries separated by a comma, for example: 1d6, [[1d8]]. The bit before the comma is the LABEL: it is what is displayed in the query dropdown, and the bit after the comma is the OUTPUT: what is sent to chat and processed by the macro. When the LABEL and OUTPUT are the same (as in the food and water query above), you dont need to list both options, so you can do this ?{Food or Water?|Food|Water} When the label and output are different, you separate them with a comma, as in the dice roll example above.
1578866631
vÍnce
Pro
Sheet Author
GiGs said: By the way, a query like this ?{Food or Water?|food, Food|water,Water|} can be simplified like so ?{Food or Water?|Food|Water} When the LABEL and OUTPUT are the same (as in the food and water query above), you dont need to list both options, so you can do this ?{Food or Water?|Food|Water} When the label and output are different, you separate them with a comma, as in the dice roll example above. For some reason I never picked up on that shortened method...&nbsp; Thanks for that info GiGs.
1578866994
GiGs
Pro
Sheet Author
API Scripter
You're welcome, but you had me wondering if I'd somehow messed up my post. Reblogging it and cutting out the dice example there caused me some genuine confusion, lol.