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

Automatically determine hit, remove Damage/MP

November 14 (8 years ago)
Kiyomi N.
Sheet Author
Greetings! I have been working on a custom sheet for some time now that helps with automating a great deal of functions in combat. The only way it could be more streamlined is if my macro could figure out whether the attack hit or not, calculate and remove damage from the target's HP attribute if successful as well as reduce the user's MP automatically if necessary. As of right now the system works by making a d100 die roll and checking for crits while also populating a 'threshold' field that shows what the roll needs to be less than (based on the characters accuracy and weapon skill, or magic accuracy, or dexterity, or whatever). I

s there a way to get the macro to compare these two (the die roll vs the threshold) in order to determine whether or not the attack was successful? Is there a way for a damage roll to be automatically removed from the target's HP attribute?

Taking this one step further, if I could allow it to determine whether a status effect triggered or not and if so, to reduce the target's related attributes for the duration of the status.

Can this be done via the API? Is there, perhaps, a script that already exists that would handle this request?
November 14 (8 years ago)
Lithl
Pro
Sheet Author
API Scripter
Depending on the game system, whether the attack hits or not can be achieved without the API (using syntax like [[d100<@{target}]] to produce 1 for hit, 0 for miss). However, automatically deducting from HP/etc. is not possible without the API.

Aaron's Ammo script or TokenMod can probably do what you need without the need for a custom script, though.
November 14 (8 years ago)
Kiyomi N.
Sheet Author
Well I certainly have access to the API and wouldn't mind putting that benefit to use. I'll have a look at the scripts you mentioned and see what they can do.
November 15 (8 years ago)
Kiyomi N.
Sheet Author
So did you mean for us to continue this conversation here, Aaron? :D As far as getting the script to recognize whether an attack was successful so it knows whether to apply damage or not?
November 15 (8 years ago)

Edited November 15 (8 years ago)
I have actually been attempting to do just this for the past few hours :D

I am using Extended Expressions to do it. Its fairly easy (Given that i finally figured out the correct order of things) The only problem with the Extended Expressions API script though is that it is a bit dated and has problems depending upon how you use it :/

November 15 (8 years ago)
If someone can work something like this out, let me know!
I would put it to use soooo fast.
November 15 (8 years ago)
The Aaron
Pro
API Scripter
Eastwood, you might enjoy this thread:  https://app.roll20.net/forum/post/4243504/token-mod-deduct-x-hp-for-tokens-with-a-red-dot
November 15 (8 years ago)

The Aaron said:

Eastwood, you might enjoy this thread:  https://app.roll20.net/forum/post/4243504/token-mod-deduct-x-hp-for-tokens-with-a-red-dot

Oh, I certainly am!! I've been watching it and refreshing it every 10 minutes or so!

The possibility of what's happening in that thread is getting me so pumped up!

November 15 (8 years ago)
Kiyomi N.
Sheet Author
Me too!