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

Positive numbers only in a Macro?

Hello, Is there a way to force unsigned values only? For instance, if I want 5-13 = 0 instead of -8. I'm trying to set up a macro for rolling damage in 40k RPG. Weapon penetration negates armor, but does not negate toughness bonus. I would like to have (Armor-Penetration)+TB where if penetration is higher than armor, the result is just TB. Is this possible?
1393102728

Edited 1393102792
Gauss
Forum Champion
This would pretty much be the realm of the API, sorry.
For shame Gauss. :P Rollable groups: {Armor-Penetration,0}kh1 + TB
1393194116
Gauss
Forum Champion
Bah, yeah...I should have thought of that. :)
1393195503

Edited 1393195511
Thanks, that's a big help Brandon. Not a moment too late, I'm running this game in an hour so I've still got time to update the macros.
Sorry I'm new and I don't understand that macro - can someone explain it to me? I play 40krpg too and this is one of the things that I've had trouble figuring out.
1394171235
Lithl
Pro
Sheet Author
API Scripter
kh1 will keep the highest 1 value from among the values "rolled". The values it's looking at are (Armor - Penetration), and 0. Therefore, if Penetration > Armor, the value used will be 0 (since 0 is higher than a negative number).
Very cool. Is there a list of operators like that somewhere?
AJ T., you might find this wiki page useful for more dice roller information: <a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a>