• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Overriding a derived field

frumple

Well-known member
Is there a way to override the value in a derived field?

I am working on defining a dragon's age catagories via a configurable tab. I have gotten it working except for displaying the starting HP. I want the value of that field to be dependent on which age catagory the user selects.

Here is the code I have tried (the script is within the base dragon race which the user selcted via theBackground tab... in this case Dragon, Black).

Code:
Final Phase/10000

~ adjust starting HP for base dragon race

var ageCat as number
ageCat = tagvalue[Value.?]

if (ageCat = 1) then
 field[rHPStart].value = 26
elseif (ageCat = 2) then
 field[rHPStart].value = 39
elseif (ageCat = 3) then
 field[rHPStart].value = 52
elseif (ageCat = 4) then
 field[rHPStart].value = 65
elseif (ageCat = 5) then
 field[rHPStart].value = 78
elseif (ageCat = 6) then
 field[rHPStart].value = 91
elseif (ageCat = 7) then
 field[rHPStart].value = 104
elseif (ageCat = 8) then
 field[rHPStart].value = 117
elseif (ageCat = 9) then
 field[rHPStart].value = 130
elseif (ageCat = 10) then
 field[rHPStart].value = 143
elseif (ageCat = 11) then
 field[rHPStart].value = 156
elseif (ageCat = 12) then
 field[rHPStart].value = 169
endif
 
rHPStart is only checked when the race is first added to the character - before any scripts are run, so, while you can change it later, it won't alter the race's hit points, because they've already been set.
 
Not recommended, becuse if you change a value that the user's allowed to change using a script, the user can no longer change it, meaning EVERY Adult Copper Dragon has 172 HP.
 
Back
Top