Senior Member
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841
|
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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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.
|
#2 |
Senior Member
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841
|
Ah. How about cHP?
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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.
|
#4 |
Senior Member
Join Date: Nov 2011
Location: South Riding, VA
Posts: 841
|
Ah yes that would be bad.
|
#5 |
|
|