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

Addition of dice results in a roll template

I am looking for a way to pull results of my dice rolls from the columns of a roll template and add them up to output the total sum of all dice rolls in the upper columns in a results column. Unfortunately I have not found anything in the forum (or searched wrong). Does anyone have a tip for the implementation?
1635612592

Edited 1635612608
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
How, or even if, this is possible depends on your use case. Are you creating a custom character sheet? or is this for a custom macro for your character in a game? And, can you share the macro you are currently working with?
1635614741

Edited 1635614797
&{template:default} {{name=Magischer Schaden:}} {{Hit-Check=[[1d8!]]}} {{Angriff=[[1d6!]]}} {{(+Soft-Crit)=[[1d4!]]}} {{(+Full-Crit)=[[1d6!]]}} {{(+Höhenbonus)=[[ ?{Hoehenbonus?|No, 0|Yes, 1d4!} ]]}} It is part of a macro for a DMG output First goal should be to add column 2 to 5 in a sixth column Big goal would be to generate different sums for soft-crit, full-crit and other bonuses *and I hope it is ok that it is in german otherwise I can also translate it for a better understanding
1635619747
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, this is doable using the reuse rolls trick . It requires a little rejiggering of how you have your rolls set up. I'm assuming that when you say columns, you mean the roll template fields and that by add 2 and 5 together in a 6th, you mean add Hit-Check  to (+Full-Crit)  in a new field I'll call Total . If that's all correct, you'd do this like so: &{template:default} {{name=Magischer Schaden:}}[[ [[1d8!]] + [[1d6!]] ]] {{Hit-Check=$[[0]]}} {{Angriff=[[1d6!]]}} {{(+Soft-Crit)=[[1d4!]]}} {{(+Full-Crit)=$[[1]]}} {{(+Höhenbonus)=[[ ?{Hoehenbonus?|No, 0|Yes, 1d4!} ]]}} {{Total=$[[2]]}} The roll indexing starts at 0 with the deepest, furthest left roll. It then progresses left to right and up through the layers of nested rolls. You can read more about it in the linked trick.
Angriff to Höhenbonus all added :P But anyway, I understood thanks to your answer the concept and have familiarized myself with this also by your link even further. However, neither helped me with my idea to draw multiple sums. Is that even possible with this concept? Let's say: sum of Angriff and (+Soft-Crit) (so rather a subtotal of Angriff and (+Soft-Crit) . Then the roll of the Höhenbonus as another addition to the already generated sum ( Subtotal ) to another sum (total). The idea behind this is that this bonus is granted only sometimes and therefore I want to show already the subtotal So it looks like Hit-Check a throw that takes place independently Angriff (+Soft-Crit) Subtotal Angriff + (+Soft-Crit) Höhenbonus Total Subtotal + Höhenbonus
1635625541
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
That is possible, just requires a little extra nesting (Showing with including full crit and hohenbonus at the same level): &{template:default} [[ [[ [[1d6!]] + [[1d4!]] ]] + [[1d6!]] + [[?{Hoehenbonus?|No, 0|Yes, 1d4!}]] ]] {{name=Magischer Schaden:}} {{Hit-Check=[[1d8!]]}} {{Angriff=$[[0]]}} {{(+Soft-Crit)=$[[1]]}} {{Subtotal=$[[2]]}} {{(+Full-Crit)=$[[3]]}} {{(+Höhenbonus)=$[[4]]}} {{Total=$[[5]]}}
You are a genius :) Works perfectly. Unfortunately, I didn't consider in my idea that Soft-Crit and Full-Crit depends on the opponent's resistance. Therefore, in this case, soft and full crit is not an additive link but either a soft crit or a full crit . I then tried to subtract the soft crit again, so that I finally have a sum with the result subtotal + soft-crit throw and a second sum with the result subtotal + full-crit throw (respectively subtotal + soft-crit + full-crit - soft-crit ) but the macro didn't like that at all. Also a tinkering with the brackets did not bring the desired success. And before I take up any more of your time here, I have then removed the hit-check (which answers the question about the crits in connection with the opponent's resistance) from this macro in order to clarify with the GM beforehand which type of crit I am using. Afterwards I have also packed it like the Höhenbonus   in a dropdown menu. In the end, it now looks like this: &{template:default} [[ [[ [[ [[1d6!]] + [[?{Hoehenbonus?|No, 0|Yes, 1d4!}]] ]] + [[?{Krit?|No, 0|Soft, 1d4!|Full, 1d6!}]] ]] ]] {{name=Magischer Schaden:}} {{Angriff=$[[0]]}} {{(+Höhenbonus)=$[[1]]}} {{Schaden=$[[2]]}} {{(+Krit)=$[[3]]}} {{SCHADENTOTAL=$[[4]]}} Not quite how I imagined it, but I probably should have thought about that sooner - sorry. And thanks for your help Normal 0 21 false false false DE X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Normale Tabelle"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}