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

Having issues with Macros nested in Roll Queries

October 23 (9 years ago)
Hey all!

I was hoping someone might be able to give me a little assistance here.
I am running a DnD 3.5 campaign and I was making token action macros for my players.

I have a suite of macros created for saving throws. They are set up as 

#FortitudeCheck
@{selected|fortitudecheck} 

It uses the built in macro on the DnD 3.5 character sheet for saving throws.
I have one of these for each type of throw.

Then I created a roll query

#SavingThrows
?{Which saving throw?|Fortitude,#FortitudeCheck |Reflex,#ReflexCheck |Will,#WillCheck }

Based on what I've read this should work. Thing is, when I run it I don't have the drop down menu I was expecting and I don't get an output in the chat window. Any ideas?
October 23 (9 years ago)

Edited October 23 (9 years ago)
Diana P
Pro
Sheet Author
It's due to the closing braces ( } ) in the fortitude, reflex, and will macros.  The best way to get a combined saving throw is to set it up like this:
&{template:DnD35StdRoll}{{name=@{selected|character_name} }} {{saveflag=true}} ?{Which resistance?|Fortitude ,{{subtags=braces against the attack}} {{check=Fortitude check:}} {{checkroll= [[1d20 + [[@{selected|fortitude}]] ]]}} {{notes=@{selected|fortitudenote} }}|Reflex ,{{subtags=tries to dodge}} {{check=Reflex check:}} {{checkroll= [[1d20 + [[@{selected|reflex}]] ]]}} {{notes=@{selected|reflexnote} }}|Will ,{{subtags=tries to resist}} {{check=Will check:}} {{checkroll= [[1d20 + [[@{selected|will}]] ]]}} {{notes=@{selected|willnote} }} }

all of the } type of code needs to remain intact to get this type of dropdown to work without exiting early.

(edit: fixing html entities)


October 23 (9 years ago)

Edited October 23 (9 years ago)
Diana P
Pro
Sheet Author
In the wiki about roll queries, the html entity substitution is under Advanced Usage:
https://wiki.roll20.net/Macros#Using_a_variable_with_a_Macro

Oh and if you put this in as a macro instead of a character ability, do not edit it; doing so will cause it to replace the html entities with their character and break the macro again.  If you need to edit it, do so in a separate text editor and then paste it back into the macro and save once only.
October 23 (9 years ago)
I added this section to the wiki to directly address this exact issue.
October 23 (9 years ago)
Thanks Diana, that was really helpful.

Silvyre said:
I added this section to the wiki to directly address this exact issue.

Upon re-reading it I think I figured out my main problem. When I was creating the roll query I was using the HTML entities for problem characters. The issue is that I wasn't doing that for the macros that I was trying to embed. Upon re-reading it it makes sense but I didn't understand that it was talking about the Macros that would be expanded rather than the top level macro.
October 23 (9 years ago)

Jeff B. said:

Silvyre said:
I added this section to the wiki to directly address this exact issue.

Upon re-reading it I think I figured out my main problem. When I was creating the roll query I was using the HTML entities for problem characters. The issue is that I wasn't doing that for the macros that I was trying to embed. Upon re-reading it it makes sense but I didn't understand that it was talking about the Macros that would be expanded rather than the top level macro.

I attempted to make the wording a bit clearer; thanks.
October 23 (9 years ago)
I really appreciate it. Thanks for all the hard work!
I am no coder, I can't guarantee that it will work for everyone but oddly enough this works for me. I would love to know if it works for anyone else. I'm using Chrome and I haven't tried it on any other browser. 
&{template:DnD35StdRoll} {{name=@{selected|character_name} }} {{saveflag=true}}  {{subtags=braces against the attack}} {{checkroll= ?{Save: | Fortitude, Fortitude [[ 1d20 + @{selected|fortitude}]] | Reflex, Reflex [[ 1d20 + @{selected|reflex}]] | Will, Will [[ 1d20 + @{selected|will}]]} }}
October 24 (9 years ago)

Edited October 24 (9 years ago)

Mr. Monster said:

I would love to know if it works for anyone else.
&{template:DnD35StdRoll} {{name=@{selected|character_name} }} {{saveflag=true}}  {{subtags=braces against the attack}} {{checkroll= ?{Save: | Fortitude, Fortitude [[ 1d20 + @{selected|fortitude}]] | Reflex, Reflex [[ 1d20 + @{selected|reflex}]] | Will, Will [[ 1d20 + @{selected|will}]]} }}

The Roll Template itself is supplied by the Dungeons and Dragons: 3.5 Edition Character Sheet. The Roll Query (which contains no "nested" elements) would work for any Character that possesses the three Attributes within (i.e. that uses the aforementioned sheet).
Thanks for the clarification.
October 24 (9 years ago)
Diana P
Pro
Sheet Author

Mr. Monster said:

I am no coder, I can't guarantee that it will work for everyone but oddly enough this works for me. I would love to know if it works for anyone else. I'm using Chrome and I haven't tried it on any other browser. 
&{template:DnD35StdRoll} {{name=@{selected|character_name} }} {{saveflag=true}}  {{subtags=braces against the attack}} {{checkroll= ?{Save: | Fortitude, Fortitude [[ 1d20 + @{selected|fortitude}]] | Reflex, Reflex [[ 1d20 + @{selected|reflex}]] | Will, Will [[ 1d20 + @{selected|will}]]} }}

The main difference between this macro and the one I posted above is I have the extra code in mine to display the notes associated with each of the saves as well (since for my group we put information like "Immune to sleep" or other save-related information in the notes. :).  If you don't use the notes at all, your macro is shorter and easier to maintain.