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 .
×

Custom Ability Help - Heat Stroke Check

Hi – I am trying to create a custom character sheet ability that rolls a save against heat for a desert campaign. This check is a modified Fortitude save that applies a -4 penalty if the character is wearing medium or heavy armor, no penalty for light or no armor. I can use the armor check penalty (ACP) value from the character sheet (this is Pathfinder first edition using the Pathfinder by Roll 20 character sheets) to determine what level of armor a character is wearing. However, ACP values range from 0 (no armor) to some negative value. Light armors ACP range from -1 to -3, while heavier armors ACPs are -4 or below. I tried to create this custom ability using the formula below, but it does not seem to handle comparing negative values well at all (i.e., determining which of two negative values is “higher”, or closer to 0) and therefore does not correctly apply the -4 check value when ACPs are negative. [[1d20+@{Fortitude} + {{-4,@{armor_check_penalty}}>0}*(0+4) - 4 ]] Maybe what I am trying to do can’t be done, I just wanted to see if anyone had any suggestions to fix this text to make it work as expected.
This should work based on what you described: [[1d20+@{Fortitude} + [[{0,[[@{armor_check_penalty}*-1]]}>1]]*-4 ]]
Thanks Jarren, that still seems to apply the -4 though regardless of the ACP value when its less than 0 (e.g., a -1 ACP still applies the -4 to the check).  Weirdly, and for anyone's future reference, this seems to work: [[1d20+@{Fortitude} + {{-4,(4+@{armor_check_penalty})}>0}*(0+4) - 4 ]
Robert M. (Lone Wolf) said: Thanks Jarren, that still seems to apply the -4 though regardless of the ACP value when its less than 0 (e.g., a -1 ACP still applies the -4 to the check).&nbsp; Yeah I misunderstood and thought it was always a static -4, based on your phrasing of "This check is a modified Fortitude save that applies a -4 penalty if the character is wearing medium or heavy armor, no penalty for light or no armor." I missed the part about Light Armor having an ACP of -1 to -3.&nbsp; Because I can't understand how your code works, as it does not follow Roll20 dice syntax. It's missing a closing bracket, as well as not computing things correctly.&nbsp;&nbsp; <a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a> I just reread your first post, and I just realized that what you want is a static -4 if the armor_check_penalty is -4 or higher? You just need to change the &gt;1 to be &gt;4. Here's a version that also adds a label that will explicitly show the ACP value with a mouseover, and some error correction if the ACP is blank: [[1d20 + @{Fortitude} + [[[[ [[{0,0@{armor_check_penalty}*-1}&gt;4]] ]]*-4]][ACP = @{armor_check_penalty}] ]] Here's a macro to demonstrate the math for the ACP: ACP of @{armor_check_penalty} = [[ [[[[ [[{0,0@{armor_check_penalty}*-1}&gt;4]] ]]*-4]][ACP = @{armor_check_penalty}] ]]