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

[5E Shaped] Is it possible to nest multiple roll templates into a query?

October 05 (9 years ago)
Hello,

I was trying to add a wand with multiple spell functions to my character sheet(class action) , and I thought i might be able to just add multiple roll templates into a query. I have not had much success so far and was wondering if it was even possible. I have tried all sorts of combinations in my attempts including inserting them as macros and then trying to nest it inside the query. Also have tried substituting the html equivalent of characters to no avail. The funny part is that i can get one to work within the query but as soon as I add a second part to the query (even just a regular inline roll) it does not want to work no error or anything. 

Am I just banging my head against a wall or is there a way to do this?? To give you an idea of what i was trying to do a test example is provided (Different level casting of the same spell). Thanks in advance!


?{Wand of Winter | RayofFrost, &{template:5eDefault} {{character_name=@{character_name}}} {{title=Ray of Frost}} {{subheader=Wand of Winter}} {{subheaderright=Range 60 Ft}} {{subheader2=Instant}} {{subheaderright2=0 Charges}} {{targetName= 1 target}} {{freetext=A frigid beam o f blue-white light streaks toward a creature within range. Make a ranged spell attack against the target. On a hit, it takes 1d8 cold damage, and its speed is reduced by 10 feet until the start of your next turn.}} {{rollname=Attack}} {{Attack=[[d20+5+@{intelligence_mod}+@{pb}]] | [[d20+5+@{intelligence_mod}+@{pb}]]}}{{rollname=Damge}} {{Damage=[[1d8]]}} {{rollname=Critical Hit}} {{Critical Hit=[[1d8]]}} | FrostRay, &{template:5eDefault} {{character_name=@{character_name}}} {{title=Ray of Frost}} {{subheader=Wand of Winter}} {{subheaderright=Range 60 Ft}} {{subheader2=Instant}} {{subheaderright2=1 Charges}} {{targetName= 1 target}} {{freetext=A frigid beam o f blue-white light streaks toward a creature within range. Make a ranged spell attack against the target. On a hit, it takes 1d8 cold damage, and its speed is reduced by 10 feet until the start of your next turn.}} {{rollname=Attack}} {{Attack=[[d20+5+@{intelligence_mod}+@{pb}]] | [[d20+5+@{intelligence_mod}+@{pb}]]}} {{rollname=Damge}} {{Damage=[[2d8]]}} {{rollname=Critical Hit}} {{Critical Hit=[[1d8]]}} }
October 05 (9 years ago)

Edited October 05 (9 years ago)
&{template:5eDefault} {{character_name=@{character_name}}} ?{Wand of Winter|

RayofFrost, {{title=Ray of Frost}} {{subheader=Wand of Winter}} {{subheaderright=Range 60 Ft}} {{subheader2=Instant}} {{subheaderright2=0 Charges}} {{targetName= 1 target}} {{freetext=A frigid beam of blue-white light streaks toward a creature within range. Make a ranged spell attack against the target. On a hit, it takes 1d8 cold damage, and its speed is reduced by 10 feet until the start of your next turn.}} {{attack=[[d20+5+@{intelligence_mod}+@{pb}]]}} {{attackadv=[[d20+5+@{intelligence_mod}+@{pb}]]}} {{action_damage=[[1d8]]}} {{can_crit=1}} {{action_crit_damage=[[1d8]]}} |

FrostRay, {{title=Ray of Frost}} {{subheader=Wand of Winter}} {{subheaderright=Range 60 Ft}} {{subheader2=Instant}} {{subheaderright2=0 Charges}} {{targetName= 1 target}} {{freetext=A frigid beam of blue-white light streaks toward a creature within range. Make a ranged spell attack against the target. On a hit, it takes 1d8 cold damage, and its speed is reduced by 10 feet until the start of your next turn.}} {{attack=[[d20+5+@{intelligence_mod}+@{pb}]]}} {{attackadv=[[d20+5+@{intelligence_mod}+@{pb}]]}} {{action_damage=[[1d8]]}} {{can_crit=1}} {{action_crit_damage=[[1d8]]}} 

}
Edit: added missing can_crit field.
October 05 (9 years ago)
Thanks Silvyre for the quick reply! Works like a charm. This will help tremendously, appreciate it!
October 05 (9 years ago)

Edited October 05 (9 years ago)
Take a look a this : Macro wiki, scroll down and look in "Advanced usage"

Basically, the query stop a the first "}" that the parser encounters (yes, that's bad...). So, when you make this "?{Wand of Winter | RayofFrost, &{template:5eDefault}....", the query close because there is a "}" after 5eDefault...

To work around that you need to replace all the "}" with the HTML entitie. But, since abilities and macro are expanded first (See here), you don't need to remplace the "}" that are closing abilities/macro. The same goes for "|" that you use between rolls and "," that you use in the free text : they need to be HTML entities.

So the code should be something like that :


If you want to make macro for spells, I would suggest you using the spell fields instead, and put them in Atttributes&Abilities instead of in class actions.

Edit : Look like someone was faster :)
October 05 (9 years ago)

Edited October 05 (9 years ago)
Thank you very much for taking the time to explain, Alzam.

I added that section, and I'm glad to see that it's proving helpful.

Edit: I added can_crit fields to my above post.
October 05 (9 years ago)

Edited October 05 (9 years ago)
No worries Alzam! I will take all the help I can get! lol

Think I went through 20 versions before I posted! (the last code I had to write consisted of "line", "goto" and "run") The example will help in future endeavors. The wiki's and forums have been helpful but are lacking some more complex examples for someone of my little experience.

If I am not mistaken, is the above example missing the following before the damage?:

{{can_crit=1&#125}

Edit: Obviously it converts the html version of the brackets, so I will just write like this: {{can_crit=1}} 



October 05 (9 years ago)

DM said:

If I am not mistaken, is the above example missing [can_crit] before the damage?

It totally was (a hasty mistake). I added it in.
October 05 (9 years ago)
I definitely won't fault you for it! Thanks again for the help.
October 05 (9 years ago)
You're welcome. I'll see about adding some more examples of macros to the wiki.
October 05 (9 years ago)
That would certainly be helpful (I would never have found the HTML trick without the wiki, thanks :) ).