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 to select a specific save macro

How do I call a macro, as part of a drop-down, to activate another macro? (3.5 sheets) Code attempt 1: ?{Save Type|Fort,#Fort|Ref,#Ref|Will,#Will} Sample macro called (#Fort): &{template:DnD35StdRoll} {{saveflag=true}} {{name=@{Arkcowl Dagda|character_name} }} {{subtags=braces against the attack}} {{check=Fortitude check:}} {{checkroll= [[ 1d20 + [[ @{Arkcowl Dagda|fortitude} ]] ]] }} {{notes=@{Arkcowl Dagda|fortitudenote} }} Issue: "#Fort" appears in the chat window. However activating the Fort macro directly properly rolls the Fort save. Code attempt 2: ?{Save Type|Fort,@{Arkcowl Dagda|fortitudemacro}|Ref,@{Arkcowl Dagda|reflexmacro}|Will,@{Arkcowl Dagda|willmacro}} Issue: Selection window inserts the text from the template fortitudemacro.
1502379151

Edited 1502379171
In order to call macros from within nested queries you need to put a space after the macro name. So this would work to call the macros ?{Save Type|Fort,#Fort |Ref,#Ref |Will,#Will } However, your other problem is that queries end at the first '}' that it comes across, which includes any '}' inside of a macro.  If you want to get it to work, you will need to go through each macro you want to include and change each ',', '|', and '}' to their respective HTML equivalent '&amp#44;', '&amp#124;', and '&amp#125;', respectively.
You can also try combining all three macros into a single macro to reduce the number of HTML equivalents needed like so. (I have no idea if these are the proper attributes for the Ref and Will macros, I just guessed) &{template:DnD35StdRoll} {{saveflag=true}} {{name=@{Arkcowl Dagda|character_name} }} {{subtags=braces against the attack}} {{check=?{Save Type |Fort,Fortitude check }} {{checkroll=[[ 1d20 + [[ @{Arkcowl Dagda|fortitude} ]] ]]}&#125 {{note=@{Arkcowl Dagda|fortitudenote} |Ref,Reflex check }} {{checkroll=[[ 1d20 + [[ @{Arkcowl Dagda|reflex} ]] ]]}&#125 {{note=@{Arkcowl Dagda|reflexnote} |Will,Willpower check }} {{checkroll=[[ 1d20 + [[ @{Arkcowl Dagda|willpower} ]] ]]}&#125 {{note=@{Arkcowl Dagda|willpowernote} }}}
Thanks for following up Kyle! To clarify on your first post, HTML equivalents are only being put into the called macros, and not the primary macros? In regards to your second post, would that output all three saves simultaneously?
HTML equivalents are needed for all } , | inside of a query (?{}), not including attribute calls (@{}). This also would include any abilities (%{}), macros (#), or api calls (!). For more information see the  wiki . I'm not really clear on what you mean by primary macros. The macro that I provided will output a roll template but it asks the user for what kind of check to fill the remaining roll template information with. So it will only output the selected save. Essentially the same with what you were originally attempting without having to create separate macros for each of the saves.
Gotcha. Despite my terrible phrasing, you've answered the question. Thank you once again!
1502488048
Andrew C
Marketplace Creator
Bryan P. said: Gotcha. Despite my terrible phrasing, you've answered the question. Thank you once again! The same kind of trick works for Skill Checks using Diana Ps sheet. You create an open ended Template with a Query that finishes the rest of the Template.