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 with a macro

1423344545

Edited 1423344630
Tom
Pro
Sheet Author
Working on a macro for a tactical war game. Combat actions are simultaneous, so I've condensed the attack vs defense roll into a single macro. Trouble is, it can give me negative results. So I'd like to rewrite it to default to 0 in case of a negative result ({0, macro}kh1 essentially). I tried a couple of combos, but its been throwing back error messages. Can anyone help me out with this? /em attacks with [[((@{selected|Attack}d6>4)+?{bonus|0})-((@{target|Defense}d6>4)+@{target|Armor})]] successes I'd like to still keep it all as an inline roll. Thank you!
1423351261

Edited 1423351278
The Aaron
Pro
API Scripter
This seems to work (bolded my additions): /em attacks with [[ {{ ((@{selected|Attack}d6>4)+?{Bonus|0}) }d1 - { ((@{target|Defense}d6>4)+@{target|Armor}) }d1,0d0}kh1 ]] successes
1423353286
Tom
Pro
Sheet Author
Thanks Aaron!