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

Macro Request for Damage Threshold

Roll20, Is there a way to macro damage with Damage Threshold? This is where if there was a DT of 15, and 1-14 points of damage was inflicted, then 0 damage, but if 15 or more was inflicted, then all damage would be inflicted. I have this macro but it simply reduces the damage, which is not correct: [[ ( {{ 3d10 -14, 0 + 0d0}kh1, 30 + 0d0}kl1 ) ]] Thank you!
1672413648

Edited 1672414536
Gauss
Forum Champion
If you are using this in a template my suggestion would be to do a success/fail check, then use $[0] to display the roll.  It won't be automatic but it will provide the information you need. 
Gauss, Below is what I would insert your solution into. Does that help? [[ [$Dmg] ( {{ 3d10cf<0cs>20 -?{Damage Threshold|14}, 0 + 0d0}kh1, 30 + 0d0}kl1 ) ]]
1672415548

Edited 1672416747
Gauss
Forum Champion
That isn't a template...it is just a straight macro.  Here are the ones I've come up with for you.  The first one is a simple template macro, it tells you if you succeeded by showing a 1 or a 0.  &{template:default} {{name=Damage}} {{Damage Threshold=[[?{Damage Threshold|15}]]}} {{Success?=[[{[[3d10cf<0cs>20]],0}>?{Damage Threshold|15}]]}} {{Damage=$[[1]]}} Second template requires setting up two basic tables. &{template:default} {{name=Damage}} {{Damage Threshold=[[?{Damage Threshold|15}]]}} {{Success?=[[1t[[[{[[3d10cf<0cs>20]],0}>?{Damage Threshold|15}]]SuccessFail]]]}} {{Damage=$[[1]]}} Table #1: Name: 1SuccessFail Single Entry named: Damage! Table #2:  Name: 0SuccessFail Single Entry named: No Damage! You can name them anything you want of course, just make sure if you change "SuccessFail" you do it in both the tables and the macro.  This is what they look like:  The first one is the first macro, the second and third rolls are the second macro. Edit: I should point out that one of the Macro gurus may come along and come up with a better option. OR you can use an API script to do this since you have a Pro account. The main problem here is that you really need to use the damage twice. Once as a check, once to display. Roll20 is simply not set up to reuse rolls in calculations...or at least not easily. 
Thank you Guass, I appreciate your interesting solution but I am looking for a more automated solution that will automatically deduct damage from the target such as what !powercards will accomplish. If I need to use a more "damage reduction" solution such as what I have imployed I will but would rather have "damage threshold" such as what Spelljammer has for ship battles. Thank you again!
1672417538
Gauss
Forum Champion
Then yes, you will need either an API script or someone like RainbowEncoder who comes up with some obscure mathematics way of doing this. 
Obscure parser halting method [[0 -[[3d10 -?{Damage Threshold|14}]]*-1 +?{Damage Threshold} ]] Below the Damage Threshold this will return 0 otherwise the full 3d10
Thank you RainbowEncoder! :)
1672451952
Gauss
Forum Champion
Speak the name and like magic RainbowEncoder appears! :)
1672479632
GiGs
Pro
Sheet Author
API Scripter
Hehe, I saw the request and thought, "That's a RainbowEncoder question."