
Hi everyone!
I'm very new to building character sheets so please bear with me :)
I have two attributes-numbers that I call upon using @acrocarac and @acrorang.
I want to use javascript to test these two values and return a single value using this logic:
If @acrorang = 0 then x=0, return x
Else x = @acrocarac + @acrorang, return x.
So in the very beginning of the character sheet I declare my function:
Evidently, this does not work, but I cannot figure out why.
I'd be very grateful for any help you could give me on this :)
Thanks!
I'm very new to building character sheets so please bear with me :)
I have two attributes-numbers that I call upon using @acrocarac and @acrorang.
I want to use javascript to test these two values and return a single value using this logic:
If @acrorang = 0 then x=0, return x
Else x = @acrocarac + @acrorang, return x.
So in the very beginning of the character sheet I declare my function:
<script> function skilltest(a, b) { var x = a; var y = b; if (y = 0) { var z = 0; } else { var z = x + y; } return z; } </script>And later in the character sheet itself I try calling the function:
<input type="number" name="attr_acrobatie" value="skilltest(@{acrocarac}, @{acrorang})" disabled="true" />This should display either 0 or an integer in a disabled box.
Evidently, this does not work, but I cannot figure out why.
I'd be very grateful for any help you could give me on this :)
Thanks!