• 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

Race that excludes Dexterity from AC calculation

CNYGamer

Well-known member
Hi all.

I'm trying to set up the Tortle race and I'm having some difficulty with regards to AC calculation. A Tortle has a natural AC of 17, can't wear armor (but can use shields), and gains no AC bonus from Dexterity.

I found the following script in another race's natural armor:

Code:
if (hero.tagis[Hero.EquipArmor] = 0) then
     hero.child[ArmorClass].field[tACUnarDef].value = maximum(hero.child[ArmorClass].field[tACUnarDef].value,field[abValue].value)
endif

It doesn't explicitely prevent the character from equipping armor, but it does set base AC to whatever value is stored in abValue (in this case, 7).

Unfortunately, it also increases AC by the character's Dexterity modifier. So my two questions are:

1. Is there a way for me to exclude the Dexterity modifier from AC?

2. Is there a way to explicitely prevent the character from equipping armor?

Thanks much!
 
Update:

I added the following line to the scriptand chnged it's phase from Post-Attributes to Attributes, and it seems to work:

Code:
hero.herofield[tMaxDex].value = 0 to the script
I then checked to see if the Dex modifier was still being added to dex-based weapon attack and damage rolls, and that seem to be unaffected, so that is a plus.

This feels a little ham-handed and I'm wondering if there is a more elegant way to handle this.
 
What we did for the community tortle (which will come out next update) was to catch the DEX modifier and subtract it when unarmored, if armored, we set any worn armor bonuses to 0. This leaves shields and magic bracers/rings alone as is indicated by the tortle. It's not beautiful, but it works. It also allows a tortle to wear armor of resistance and get the resistance granted, but not the AC.

Post-attributes/5000
Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.Disable] <> 0)

var dexmod as number

dexmod = #attrmod[aDEX]
~ turn it into a penalty
dexmod *= -1

if (hero.tagis[Hero.EquipArmor] = 0) then
     ~ we are unarmored, remove Dex bonus by adding it's negative value back
     hero.child[ArmorClass].field[tACUnarDef].value += dexmod
else
     ~ we are armored, strip all armor bonuses
     hero.child[ArmorClass].field[tACDexMod].value = 0
     foreach pick in hero from BaseArmor where "Helper.CurrArmor"
     ~ kill off any type of AC modifier
          eachpick.field[arAC].value = 0 
          eachpick.field[arBonus].value = 0
          eachpick.field[Bonus].value = 0
     nexteach
endif
 
Last edited:
What we did for the community tortle (which will come out next update) was to catch the DEX modifier and subtract it when unarmored, if armored, we set any worn armor bonuses to 0. This leaves shields and magic bracers/rings alone as is indicated by the tortle. It's not beautiful, but it works. It also allows a tortle to wear armor of resistance and get the resistance granted, but not the AC.


Interesting. That didn't work for me. I set it to the Post-Attributes phase with a timing of 5000 as indicated, and it left the character's AC at 10. If I wasn't cramming to get several characters set up in Hero Lab for my game this evening, I would tinker with it more.
 
, and it left the character's AC at 10.

The code I provided just negates armor and dex, so if you start with AC10, it stays AC 10. The +7 is added later in another script.

Final/1000
Code:
doneif (tagis[Helper.Disable] <> 0)

      if (hero.tagis[Hero.EquipArmor] = 0) then
        hero.child[ArmorClass].field[tACNatural].value = 7
        endif
 
Back
Top