Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Dastir
Member
 
Join Date: Sep 2008
Posts: 48

Old June 23rd, 2010, 08:39 AM
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?
Dastir is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 23rd, 2010, 10:12 AM
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.
Mathias is offline   #2 Reply With Quote
Dastir
Member
 
Join Date: Sep 2008
Posts: 48

Old June 23rd, 2010, 11:35 AM
That did it... thanks!
Dastir is offline   #3 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:12 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.