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

Conditional values

1415290841
tontione
Pro
Sheet Author
Is it a way to have conditional values on character sheets ? For exemple, in Pendragon, christian bonus (Hit Points +6) apply only if 5 attributs are >15 each. Is it a way to implemente this in Hit Points formula ?
1415314685
Lithl
Pro
Sheet Author
API Scripter
Maybe, but I'm not familiar enough with Pendragon to give a definite answer. Could to give more detail on how the hit point formula is calculated, and what attributes are present (for example, if there are exactly 5 attributes, you might be able to accomplish it with one equation, but if there are 10 attributes, you'd need something different).
1415344553
tontione
Pro
Sheet Author
TAI , CON , T1, T2 T3, T4, T5 are numerical attributs. Hit Points = TAI + CON + christian bonus christian bonus = 0 or +6 if ( T1 >15 and T2 >15 and T3 > 15 and T4>15 and T5>15 )
1415376315
Lithl
Pro
Sheet Author
API Scripter
Is there a limit to how high T1-5 can go?
1415381436
tontione
Pro
Sheet Author
yes, max value is 20.
1415389913

Edited 1415389941
Lithl
Pro
Sheet Author
API Scripter
Okay, then, that's simple enough. <input type="number" name="attr_TAI" /> <input type="number" name="attr_CON" /> <input type="number" name="attr_T1" /> <input type="number" name="attr_T2" /> <input type="number" name="attr_T3" /> <input type="number" name="attr_T4" /> <input type="number" name="attr_T5" /> <input type="hidden" name="attr_christian" disabled="disabled" value="(floor((@{T1}+@{T2}+@{T3}+@{T4}+@{T5}) / 75) * 6)" /> <input type="number" name="attr_hit-points" disabled="disabled" value="(@{TAI}+@{CON}+@{christian})" /> That's calculating the Christian bonus for TX >= 15. If you need it to be strictly > 15, change the 75 to 80.
1415397322
tontione
Pro
Sheet Author
I don't think so : say T1, T2, T3 = 16, T4= 14 and T5= 18, floor((@{T1}+@{T2}+@{T3}+@{T4}+@{T5})/75) = 1 but the result must be 0, because each Tx must be > 15. But you're idea is ok, with floor(@{T1}/16)*floor(@{T2}/16) * ... *6 Thanks a lot ! :)
1415427535
Lithl
Pro
Sheet Author
API Scripter
Well that's just me being derp-faced. Sorry about that, and glad you found a solution! =)