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

Total Damage Box Macro/Command

December 18 (4 years ago)

A player in my campaign is using the Beyond20 plugin to link his char sheet from DnDBeyond to his sheet in the R20 campaign, and part of that plugin introduces something for his rogue character that totals all his damage into a separate and final "Total Damage" line, which is helpful for his dagger that has the d4 piercing, as well as 1d4 lightning enchantment, PLUS sneak attack. This compounds even more with a crit, but at the end of it all due to this plugin, he is given a Total Damage number to save from having to do the math.

I feel like this would soooo greatly help speed up combat, and was wondering if any of the code-minded members of the community has a relatively simple way (i have 0 macro experience but I do understand the concepts of how they work) for me to try and implement this onto the weapon attacks for my other player characters, or even my bigger enemies. Trying to search for a solution that might already exist in the forums only turned out different results than what I am actually looking for, which is to keep default/vanilla rolls still in the logs, but simply add on a Total Damage box. TYIA!


December 18 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

Such a thing might be possible with an API script, but there are some variables to consider (what do you consider it a crit? Vulnerabilities?) and it would require a pro subscription.   

December 18 (4 years ago)

Edited December 18 (4 years ago)
Oosh
Sheet Author
API Scripter

I haven't used Beyond20, do you have an example of what this looks like? Unless it's doing the rolling itself, then sending the results to chat via a hook, it would be bound by the restrictions of Roll20's dice roller. There's no simple way to total the damage from the sheet's built-in macros - you'll need API to grab all that info and manipulate it. But you can do this kind of thing:

&{template:default} {{name=Damage Roll}} [[ [[2d6 + 5[Dex]]][Base] + [[2d6]][Sneak] + [[1d4]][Fire] ]] {{Base Damage=$[[0]] slashing}} {{Sneak Attack=$[[1]] slashing}} {{Flame Weapon=$[[2]] fire}} {{Total Damage=$[[3]] slashing/fire}}

with the re-using rolls Stupid Trick.

But the macro needs to be specifically written this way - doing the total roll first, and segmenting it into separate [[ ]] inline rolls which you can call with the $[[x]] index reference. These references must be made after the roll, and cannot be operated on (as far as anyone's discovered so far....) so you can't do [[1d4]] fire + [[2d6]] frost = [[ $[[0]] + $[[1]] ]] total damage.


December 18 (4 years ago)

Just out of curiosity, why don't you ask all your players to use Beyond20?  That's what I do (except for initiative rolls) for all PC rolls, and for a few specific named NPCs.  Beyond20 is really nice for rolls because it's easy to add modifiers for things like Bless, and can be set to automatically add Sneak Attack or other bonuses.

December 20 (4 years ago)

Edited December 20 (4 years ago)

Sorry for the long wait on replies, I had been away from my computer and wanted to be able to provide screenshots.
I was actually gifted enough credit for a pro subscription by one of my players in the time since I posted this as well, so I will keep that in mind with the answers/elaborations here.


Here is a screenshot of my rogue's crit from last night. This is put into R20 by Beyond20. It still lists all the normal damage breakdown, like the piercing and lightning from the dagger, plus sneak attack, and then listed out the critical damage rolls for all three of those. Then I assume the B20 script adds in that "Totals" bar, and then has the added total of damage at the bottom. That bar at the bottom is the specific thing I am trying to see if its possible to replicate with the API or a macro or something?

EDIT: adding this hover-over screenshot of the total "roll" now that I read through the API thing Oosh mentioned. I don't know how this determined on Beyond20's end.


I would love to figure out how to do this myself without having to go and remake my custom monsters/npc's/bosses, but primarily be able to add it to my players' sheets for their sakes.

Also to answer Jarren, the others don't use Beyond20 because they prefer using sheets on R20, and this rogue player just prefers DnD Beyond. Its just simpler to have it all in R20. 

December 20 (4 years ago)

Edited December 20 (4 years ago)
Oosh
Sheet Author
API Scripter

Yeah, that's sent through with multiple templates & chat lines from the looks of it. You won't be able to recreate that unless you know how to inject your own script with a browser extension, or have access to the API. You can't reuse a completed roll for new math, otherwise.

The only non-API, non-proper-coding-your-own-plugins method is the one I used above - roll the entire thing either at the top of the macro, or in between template properties where it won't be seen. Then reference the bits you need. It's clunky and very manual work, and difficult to turn into a universal macro.


Oosh said:

Yeah, that's sent through with multiple templates & chat lines from the looks of it. You won't be able to recreate that unless you know how to inject your own script with a browser extension, or have access to the API. You can't reuse a completed roll for new math, otherwise.

The only non-API, non-proper-coding-your-own-plugins method is the one I used above - roll the entire thing either at the top of the macro, or in between template properties where it won't be seen. Then reference the bits you need. It's clunky and very manual work, and difficult to turn into a universal macro.


Is there some variation a Fighter / Warlock multiclass could use for hex, hex blades curse, non crits and crits?