• 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

Template Intelligence issue

frumple

Well-known member
I am having an issue with a template that is lowering a base creature's intelligence.

My template lowers the hero's Int by 4. If it lowers it to 0 or below I want to assign Helper.NoScore to aINT. The script is simple enough, but I am having an issue with the timing.

Here is the script
Code:
if (#attrvalue[aINT] <= 0) then
  perform hero.child[aINT].assign[Helper.NoScore]

  endif

The issue is that a validation rule gets triggered if the templated creature's intelligence is lower than 0. However, if I try to move the script to early enough that the validation rule doesn't get triggered, then my script will always run and assign Helper.NoScore to aINT no matter what it's value is.

What timing can I run this so that this doesn't happen?
 
I have tried all over the place. If I place it before Attributes or Post-Attributes the script will not trigger. However, if I place it after that I get the validation error that Intelligence is less than zero.
 
What if you you added the fields together very late pre-attributes?

Code:
var attr as number

foreach pick in hero from BaseAttr
  
   attr = eachpick.field[XXXX] + eachpick.field[XXXX] + etc
   
   if (attr <= 0) then
     perform hero.assignstr["NoScore." & eachpick.idstring]
     endif
   nexteach

Or something like that. You'll have to test and see what the fields equal at say Pre-attr 99999999, but really that should only take a couple of minutes to create a debug script to do that.
 
Back
Top