Member
Join Date: Aug 2009
Location: Finger Lakes Region, New York
Posts: 59
|
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 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! |
#1 |
Member
Join Date: Aug 2009
Location: Finger Lakes Region, New York
Posts: 59
|
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 This feels a little ham-handed and I'm wondering if there is a more elegant way to handle this. |
#2 |
Senior Member
Join Date: May 2016
Posts: 608
|
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 by dungeonguru; November 11th, 2017 at 08:16 AM. |
#3 |
Member
Join Date: Aug 2009
Location: Finger Lakes Region, New York
Posts: 59
|
Quote:
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. |
|
#4 |
Senior Member
Join Date: May 2016
Posts: 608
|
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 |
#5 |
Member
Join Date: Aug 2009
Location: Finger Lakes Region, New York
Posts: 59
|
Thanks very much for that additional information. I appreciate your time.
Last edited by CNYGamer; November 11th, 2017 at 09:19 AM. Reason: typo |
#6 |
|
|