• 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

Touch AC

Dastir

Well-known member
I am adding a feat that adds the AC bonus from a shield to the wielder's touch AC. I am using this script, which is a modified version of a script I found on this site:

Code:
var bonus as number

~find all our shields
foreach pick in hero from BaseArmor where "EquipType.Shield"
  ~if it's equipped
  if (eachpick.field[gIsEquip].value <> 0) then
    bonus = eachpick.field[mAC].value
    debug "Shield bonus = " & bonus
    debug "Touch AC before = " & hero.child[ArmorClass].field[tACTouch].value
    hero.child[ArmorClass].field[tACTouch].value += bonus
    debug "Touch AC after = " & hero.child[ArmorClass].field[tACTouch].value
  endif
nexteach

When I equip a shield, my debug statements show me that the AC bonus is indeed being added to the hero's touch AC, but the change is not reflected in the display. I am sure this is a timing thing, but after trying all of them, I can't for the life of me figure out which phase/priority to use.

Help?
 
tACTouch is calculated at Final/10000, and unfortunately, it's using an equals, rather than a +=, so it's overwriting any changes before then.

Try Final/11000.
 
Back
Top