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

Need help creating a macro / script

I am attempting to create a macro for my TTRPG's damage calculation. After a hit is determined, a roll is made to determine Impact Damage based on the weapon. This is then cross referenced with a d100 roll to determine the location of the hit, then depending on the armor the target is wearing in that location, then the Total Damage is given. so for example if I hit someone with an axe and deal 3 damage on their unarmored head it'd deal 30 Total Damage.

My question is, is this possible with a macro, or will I need to get into scripting, I'm sorry I'm very ignorant to the more intricate use cases for Roll20 and I'd like some advice or at the very least be told this isn't possible. I've already got a macro setup for the attack with different weapons and even a simple rollable table that it references to output hit location. 

&{template:default} {{name=Broadsword Stab}} {{attack= [[1d100+?{Modifier?}]]}} {{damage= [[1d3]]}} {{hit location= [[1t[StabHitLocation]]]}}

This seems to work fine, but i'd like something that would automate the rest of the process.

July 06 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter

That sounds like something you'll need to get into scripting for, especially if the damage is variable.

I the damage was fixed, I could see building a separate hit location table for each weapon (lots and lots of work, but doable), but if the damage varies that multiples the number of tables needed (or the size of each table) and quickly becomes unfeasible.

If you are building te character sheet with this roll in it, you could use custom roll parsing (scripting for character sheets), and then once the sheetis finished, you can stop paying for it.  But if you go the scripting route, you'd need to pay each month to continue using it.


GiGs said:

That sounds like something you'll need to get into scripting for, especially if the damage is variable.

I the damage was fixed, I could see building a separate hit location table for each weapon (lots and lots of work, but doable), but if the damage varies that multiples the number of tables needed (or the size of each table) and quickly becomes unfeasible.

If you are building te character sheet with this roll in it, you could use custom roll parsing (scripting for character sheets), and then once the sheetis finished, you can stop paying for it.  But if you go the scripting route, you'd need to pay each month to continue using it.


Thanks for the reply, I think you're right. I did want to avoid scripting, but I feel like if I don't it'll get infinitely more complex and more work than it needs to be.

The damage is variable, depending on the weapon a slash could be a d8 but a stab could be a d3, then depending on the armor you'd need to do more impact damage to do more actual damage. So if you're wearing no armor if you rolled 5 impact damage you could do almost 30 actual damage, but if you were wearing armor it could take 10 to 15 impact damage to do 30 actual damage.

Regardless, thanks for the information, I am paying for roll20 so I'll try diving into scripting this afternoon.


July 06 (1 year ago)

Edited July 07 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter


Jonathan M. said:


Regardless, thanks for the information, I am paying for roll20 so I'll try diving into scripting this afternoon.


Make sure you are paying enough. Scripting is a Pro subscriber perk, and costs more than Plus.

July 07 (1 year ago)
timmaugh
Forum Champion
API Scripter

Once you're a Pro-sub, you can do this with metascripts and a fair amount of setup. (Difference being when I hear "scripting" I am thinking javascript programming, but the metascripts would keep you in the realm of the Roll20 VTT interface... rollable tables and ability macros and the like.)

I can mock something up, but would need some more concrete examples to know all of the parameters.

July 07 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter

That's an offer you should not ignore, Johnathan, if you do have access to scripts. Tim is really good at this.

Understood, I'd love to take you up on that offer. Thank you both for the help!