• 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

Swap natural armor to deflection how?

bodrin

Well-known member
From the tome of horrors

HTML:
Incorporeal Form (Su) A shadow rat can, as a standard
action, assume an incorporeal form for up to 1 hour per
day. In this form, the shadow rat loses its natural AC bonus
but gains a +2 deflection bonus to AC. While in this form, the
shadow rat is AC 16 (+2 deflection, +2 Dex, +2 size), touch
15, flat-footed 13. The shadow rat can still attack corporeal
opponents while in its incorporeal form, but its attack
only inflicts Strength damage and cannot cause physical
damage. The shadow rat gains the incorporeal subtype
while using this ability.

I've tried this code but get this error

Post attributes 5000

Code:
~if we're not active, just get out now
doneif (field[pIsOn].value = 0)

~ Swap the natural armor to a deflection bonus

  perform hero.child[mNatural].assign[Helper.NoArmor]

   hero.child[ArmorClass].field[tACDeflect].value = maximum(hero.child[ArmorClass].field[tACDeflect].value, +2)

Hero Lab was forced to stop compilation after the following errors were detected:
Syntax error in 'eval' script for Thing 'raCTIncFor' (Eval Script '#1') on line 8
-> Error parsing parameter 2 of function


Any ideas HL community?
 
My guess is that it does not like the idea of +2 as it should just be 2.

Doh!!!

arggh I cant think straight too little sleep.

another error

HTML:
Attempt to access field 'pIsOn' that does not exist for thing 'raCTIncFor'
 
Last edited:
HTML:
Attempt to access field 'pIsOn' that does not exist for thing 'raCTIncFor'
The field pIsOn is only for "Adjustments" it does not exist on a Racial Special. For a "Racial Special" the field you want I assume is "abilActive" this would be the one that gets check marked on the In-Play tab when you setup "Show in Activated Abilities List?"
 
pIsOn is reserved for adjustments. It appears you are trying to access a field that is for adjustments only, while not scripting an adjustment. If this is a Special that is always active, you can just delete the pIsOn line.
 
Last edited:
Back up - you don't want to assign the deflection bonus yourself. There's a way to have Hero Lab do it for you.

What you want to do is use the existing incorporeal subtype (and therefore incorporeal ability) - bootstrap it with a condition that will make it live while this ability is active. That ability already includes the code to add the deflection bonus.
 
Back up - you don't want to assign the deflection bonus yourself. There's a way to have Hero Lab do it for you.

What you want to do is use the existing incorporeal subtype (and therefore incorporeal ability) - bootstrap it with a condition that will make it live while this ability is active. That ability already includes the code to add the deflection bonus.

This is what I intended the script is almost a direct copy. I just edited it slightly.

I'm v tired so I'm not thinking straight at moment can't grasp the activation method.
 
Bootstrap the subtype from your ability.

On that bootstrap, click the "Condition" button, and enter the following:

phase: First, priority: 500

Code:
fieldval:abilActive <> 0
 
Bootstrap the subtype from your ability.

On that bootstrap, click the "Condition" button, and enter the following:

phase: First, priority: 500

Code:
fieldval:abilActive <> 0

Thanks I'll get this done as soon as possible!
:)
 
Possible problem with bootstrapping incorporeal subtype. The ability adds a straight +2 deflection bonus not the CHA bonus as standard.
 
Still can't get this script to work correctly for the Shadow Rat Incorporeal Form (SU) ability
If i remove the doneif code check then the armor class deflection bonus overrides the natural AC bonus as it should but it's always active!!

First 500

Code:
~if we're not active, just get out now
doneif (fieldval:abilActive = 0)

~ Swap the natural armor to a deflection bonus

  perform hero.child[mNatural].assign[Helper.NoArmor]

   hero.child[ArmorClass].field[tACDeflect].value = maximum(hero.child[ArmorClass].field[tACDeflect].value, 2)
The error message I get is

HTML:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'raCTIncFor' (Eval Script '#1') on line 2
  -> Reference to undeclared variable: 'fieldval'
The attached screenshot shows that I have the show in activated ability ticked!:( My brain hurts:confused:
 

Attachments

  • Shadow Rat.JPG
    Shadow Rat.JPG
    206.7 KB · Views: 5
Last edited:
Make a copy of something else in Hero Lab that has an activated ability - how does it test whether the ability is activated or not?

"Reference to undeclared variable" means your code is wrong, and Hero Lab can't figure out what you're trying to do.
 
Back
Top