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

ScriptCards: Rolling With Resistances: Avoiding Decimals

1618152218

Edited 1618152278
So I'm working on a ScriptCard default attack template that handles up to 2 damage types and I'm testing the resistance portion of it on my players, but I'm running into a bit of an aesthetic snag: While it absolutely works functionally, since the HP value can only hold integers, I just really feel gross having that 0.5 damage popping up so I'd like to avoid that if at all possible. Does anyone know a good way to round this value down? Here's what I'm currently using: --:Resist| --=Damage|[$Damage] / 2 --? [$Damage] -eq 0|>SetToOne --<| --:SetToOne|Minimum resisted damage is 1 --=Damage|1 --<| I tried adding in something with -inc to look for .5 to then subtract .5 but that didn't seem to register.
1618153542
David M.
Pro
API Scripter
Try using \ instead of / for your division in the roll variable declaration. From the wiki:
Thanks so much! Turns out I'm just completely blind. I swear I looked up and down that page for something like that but like usual my eyes fail me.
1618155708
David M.
Pro
API Scripter
Haha, there's a lot of info in there!