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
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old March 8th, 2010, 10:56 AM
I am working on Elephant's Hide, a wild feat that sets the druid's natural armor to 7, which supercedes any natural armor they already have. This is the script I wrote.

Phase: PreLevels (Users) 11000
if (field[hIsOn1].value <> 0) then
if (hero.child[ArmorClass].field[tACNatural].value >= 7) then
done
else
hero.child[ArmorClass].field[tACNatural].value = 7
endif
endif

Unfortunately, rather than setting the natural armor to 7, it is adding 7... What is going wrong here?
Lawful_g is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old March 8th, 2010, 11:33 AM
It's likely running before something else that adds natural armor. Therefore, the natural armor is already set to 7 by this before the other thing runs.

In the "Floating Info Windows" option in the Develop menu, select "Show Selection Tasks", and then find "Armor Class" in that list. That will tell you when the scripts involved in the armor class are running (well, actually, only the ones that are on the Armor Class pick itself, not external things that modify the armor class). Try putting your script immediately before (10 or 100 priorities before) one of the scripts listed there. You should be able to find a point at which you can set the AC before it's used, which is still after everything else that's adding natural armor.

P.S. Here's a simpler way to write your script:

if (field[hIsOn1].value <> 0) then
hero.child[ArmorClass].field[tACNatural].value = minimum(hero.child[ArmorClass].field[tACNatural].value, 7)
endif
Mathias is online now   #2 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old March 8th, 2010, 12:18 PM
I am using the Gargoyle race since that was included in the HL base files

The Task list for Armor Class has 4 things on it, a "field calculate - field (AC from natural armor)" at Post Attributes 10000, an Eval Script 1 at Final 10000, and then 2 at Final 99999 that are probably unconnected.

Moving the script to be after either of those (Post Attributes 10100 and Final 10100) results in no change when the button is clicked.
Lawful_g is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old March 8th, 2010, 12:55 PM
100 before - Post-Attributes 9900 or Final 9900.
Mathias is online now   #4 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old March 8th, 2010, 02:07 PM
Still no effect when placed 100 before.

Last edited by Lawful_g; March 8th, 2010 at 02:11 PM.
Lawful_g is offline   #5 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old March 8th, 2010, 02:17 PM
Ah, I found the reason there was no effect. I was using your script above, but I think you must have meant "maximum(hero.child[ArmorClass].field[tACNatural].value, 7)"... the fact that it was minimum meant that nothing was being changed, because the Gargoyle has a 4 nat armor which is lower than 7.

Upon switching it to maximum, and putting the script at Post Attributes 10100 the thing works.
Lawful_g is offline   #6 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old March 8th, 2010, 02:31 PM
It wasn't stacking with enhancement bonuses to Natural Armor, so I switched it to modify mNatural. It now correctly modifies base Natural Armor, which can then be modded by Amulets of natural armor, etc.

For the curious, this is what I came up with at the end.

PreLevels : 500

if (field[hIsOn1].value <> 0) then
hero.child[mNatural].field[Bonus].value = maximum(hero.child[mNatural].field[Bonus].value, 7)
endif
Lawful_g is offline   #7 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 12:13 PM.


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