After testing with the new abs() function, it's become apparent that it won't work for the GURPS sheet (as described in issue #83), since it results in a division by 0 if the user wants to keep their attribute at default (and naturally that will cascade and invalidate the vast majority of other calculations on the character sheet).
It would seem this is only solved by either implementing a fix
function, or adding tertiary operators, in which case I can do
x != 0 ? abs(x) * x/abs(x) : 0
or x >= 0 ? floor(x) : ceil(x)
I also have another problem, which would require tertiary operators to solve. Unless someone can suggest an alternate way to compute it, which would be amazing.
GURPS has a slightly complicated system for calculating skill levels, the first few levels cost fewer points than the later levels.
Points |
Level |
1 |
1 |
2 |
2 |
4 |
3 |
8 |
4 |
12 |
5 |
+4 |
+1 |
The only way I can think to accomplish this right now is with a tertiary operator.
(x >= 1 ? 1 : 0) + (x >= 2 ? 1 : 0) + floor(x / 4)
of course this would also work in a much more simple fashion if those booleans could be evaluated as a 1 or 0.
(x >= 1) + (x >= 2) + floor(x / 4)
x = 1
(1) + (0) + floor(0.25) = 1
x = 3
(1) + (1) + floor(0.75) = 2
x = 10
(1) + (1) + floor(2.5) = 4
I was trying to think of a way to do it with modulo, but to no avail.
If that's too much too ask, then the GURPS character sheet will have to be very minimal in it's use of auto-calc. Or supported by an API script.