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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Macro Help for GURPS

1524880120

Edited 1524880163
I have created the following macro for automating damage rolls (I hate doing math during play), and it generally works perfectly fine... as long as the end result is a positive amount of damage being inflicted: /em causes [[ceil((?{Base Dice}d6 + ?{Adds} - (?{Target DR} / ?{Armor Divisor|Default, 1|Paintball (0.2), 0.2|Hollowpoint (0.5), 0.5|Armor Piercing (2), 2|Shaped Charge (10), 10})) * ?{Damage Type|Crushing (cr), 1|Cutting (cut), 1.5|Impaling (imp), 2|Small Piercing (pi-), 0.5|Piercing (pi), 1|Large Piercing (pi+), 1.5|Huge Piercing (pi++), 2|All Skull Hits, 4})]] points of damage (after armor). If, however, the target is wearing some obscene amount of armor and the wounding multiplier is more than 1, the end result is often something ridiculous like "Player causes -40 points of damage (after armor)." I am trying to figure out how to tweak the macro so that any negative number results will display "0" instead.  Any guidance?
1524881269

Edited 1524881332
GiGs
Pro
Sheet Author
API Scripter
You need to use the Keep Highest modifier, like this: /em causes [[ {ceil((?{Base Dice}d6 + ?{Adds} - (?{Target DR} / ?{Armor Divisor|Default, 1|Paintball (0.2), 0.2| Hollowpoint (0.5), 0.5|Armor Piercing (2), 2|Shaped Charge (10), 10})) * ?{Damage Type| Crushing (cr), 1|Cutting (cut), 1.5|Impaling (imp), 2|Small Piercing (pi-), 0.5| Piercing (pi), 1|Large Piercing (pi+), 1.5|Huge Piercing (pi++), 2| All Skull Hits, 4}),0d0}k1]] points of damage (after armor). (I added line breaks for clarity, you'll probably need to delete those)
I suspected that would be the answer... I just couldn't figure out how to incorporate it.  Everything I tried resulted in a no-go.  Thanks! Tested it out, and it works perfectly.
1524882491
GiGs
Pro
Sheet Author
API Scripter
Glad to help :)