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

Adding up roll results in a template

Hello all! Hopefully this will be a simple & straightforward question/answer for you guys! I found and tweaked a couple of very simple templates to make attack rolls & damage rolls for the D&D 5e Animate Objects spell (specifically using ten Tiny objects): &{template:default} {{name=Ten Tiny Animate Objects Attacks (No Adv) }} {{[[1d20+8]] [[1d20+8]]  [[1d20+8]]  [[1d20+8]] [[1d20+8]] [[1d20+8]]  [[1d20+8]]  [[1d20+8]] [[1d20+8]] [[1d20+8]]  }} &{template:default} {{name=Ten Tiny Animate Objects Attacks (With Adv) }} {{[[2d20kh1+8]] [[2d20kh1+8]]  [[2d20kh1+8]]  [[2d20kh1+8]] [[2d20kh1+8]] [[2d20kh1+8]]  [[2d20kh1+8]]  [[2d20kh1+8]] [[2d20kh1+8]] [[2d20kh1+8]]  }} &{template:default} {{name=Ten Tiny Animate Objects Damage (Not Incl. Crits)}} {{[[1d4+4]] [[1d4+4]]  [[1d4+4]]  [[1d4+4]] [[1d4+4]] [[1d4+4]]  [[1d4+4]]  [[1d4+4]] [[1d4+4]] [[1d4+4]]  }} How can I modify that last template so that it also adds up all ten roll results, showing total damage from this spell in one turn? I know I can just type /r and add up the rolled results manually after pasting the template, but I would like to build that into the template to skip that step. Thank you! :)
1609116013
Jordan C.
Pro
API Scripter
This should do it! Basically add plus symbols between all the rolls then wrap them in more brackets ("[[ ... ]]") &{template:default} {{name=Ten Tiny Animate Objects Damage (Not Incl. Crits)}} {{ [[ [[1d4+4]] + [[1d4+4]] + [[1d4+4]] + [[1d4+4]] + [[1d4+4]] + [[1d4+4]] + [[1d4+4]]  + [[1d4+4]] + [[1d4+4]] + [[1d4+4]] ]] }}
1609116635

Edited 1609116686
Ah, that should do nicely :D Thanks very much! It is a pity that hovering over the template result makes it look like it's just adding integers, though: I did try the template multiple times and it is actually doing the rolls & producing different results, but the mouseover text just doesn't show the "1d4+4"s for some reason?  Ultimately that's a very minor quibble, though. I'd be interested in an alternate template that shows the "1d4+4"s, but I can work with this just fine. Thanks again!
1609116836
GiGs
Pro
Sheet Author
API Scripter
When you nest inline rolls inside each other (like [[ [[1d4]] ]]) the system cant show the roll formatting of the nested rolls any more.
1609118976
Jordan C.
Pro
API Scripter
This will show the dice separately in a new row: &{template:default} {{name=Ten Tiny Animate Objects Damage (Not Incl. Crits)}} {{Total= [[ [[1d4+4]] + [[1d4+4]] + [[1d4+4]] + [[1d4+4]] + [[1d4+4]]  + [[1d4+4]] + [[1d4+4]] +  [[1d4+4]] + [[1d4+4]] + [[1d4+4]] ]]}} {{Dice= $[[0]] $[[1]] $[[2]] $[[3]] $[[4]] $[[5]] $[[6]] $[[7]] $[[8]] $[[9]]}}
1609119164
GiGs
Pro
Sheet Author
API Scripter
You could use that technique to show the dice after. &{template:default} {{name=Ten Tiny Animate Objects Damage (Not Incl. Crits)}} [[ [[1d4+4]] + [[1d4+4]] + [[1d4+4]] + [[1d4+4]] + [[1d4+4]]  + [[1d4+4]] + [[1d4+4]] +  [[1d4+4]] + [[1d4+4]] + [[1d4+4]] ]] {{Dice= $[[0]] $[[1]] $[[2]] $[[3]] $[[4]] $[[5]] $[[6]] $[[7]] $[[8]] $[[9]]}} {{Total=$[[10]]}}
Ah wonderful! Thank you both!