Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
coyote6
Member
 
Join Date: Sep 2007
Location: Salinas, CA
Posts: 64

Old November 30th, 2009, 07:25 PM
Okay, I have Heavy Armor Optimization kind of working -- it decreases the armor check penalty, and increases the armor bonus, both by 1 -- except for two things.

First, here's the Eval Scripts code, which I've got running at Post-Level (users) at 10500:

Code:
~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

~ if we haven't equipped heavy armor, we're done
doneif (hero.tagis[Hero.EquipArmor] < 1)
~ must fix


~Improve the armor check penalty and armor bonus stats of our armors.
foreach pick in hero where "EquipType.Armor"
 eachpick.field[mAC].value += 1
 eachpick.field[mArmorChk].value += 1
 nexteach
So, the problems:

1) It does it for all armor, not just heavy armor. How do I identify if it's heavy armor in the second doneif and the foreach?

2) It's also adding to natural armor! I noticed it was adding two to AC, instead of 1; but on the Armor tab, it shows the armor values increased by 1. So I opened the Pick Fields floating window for Armor, and scrolled through it. Lo and behold -- tACNatural is getting a value of +1. So somehow EquipType.Armor is registering as a pick for natural armor in the foreach statement.

It just occurred to me, though -- if I can fix problem #1, that should also take care of #2. So, maybe I only need one clue this time.

(Plus, once I have it fixed, it should be simple to get Greater Heavy Armor Optimization to work. Two feats for one answer -- what a deal!)

Thanks,

-Bob
coyote6 is offline   #1 Reply With Quote
coyote6
Member
 
Join Date: Sep 2007
Location: Salinas, CA
Posts: 64

Old November 30th, 2009, 07:34 PM
And as soon as I hit post, I find what I needed. I changed the foreach line to:

foreach pick in hero where "EquipType.Armor & mClass.Heavy"

and that seems to have done it. Light & medium armor stay as they are, and natural armor doesn't get bumped.

For elegance, I'd like to fix the second doneif to check for heavy armor, but I can live with it as-is. If anyone has a suggestion on how to fix that, let me know!

Edit: This seems to work.

doneif (hero.tagis[Hero.EquipArmor] + hero.tagis[mClass.Heavy] < 1)

Woo, I feel all cleever.

Last edited by coyote6; November 30th, 2009 at 07:50 PM.
coyote6 is offline   #2 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old December 1st, 2009, 09:10 AM
Heh, I still feel the same way when I figure something in HL out.
Lawful_g is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,380

Old December 1st, 2009, 10:00 AM
Writing an email to Rob and Colen is one of my best ways to get through a problem, because organizing my thoughts about the problem in order to explain it well often leads me to the solution.

Since you've mentioned elegance, I thought you might appreciate some style and optimization notes.

In terms of style, I'd use = 0 in the doneif, instead of <1 - just a programming style thing - 0 means no, not 0 means yes.

An optimization that you could use is to restrict the foreach to only look through armors, and not every pick attached to the character:

Code:
 
foreach pick in hero from BaseArmor where "mClass.Heavy"
The "from <component>" option in foreach-es is relatively new, so you may not see it in everything you look at for examples. I left out the EquipType.Armor, since it seemed redundant, once we're checking for the component.

FYI, a piece of armor exists and is equipped on every character to store the natural armor values, so that's why your script found it when you were searching for all armors.

In the develop menu, make sure the first option, "Enable Data File Debugging" is selected, then add a couple pieces of armor to your character, along with a shield and on the gear tab, something else. Right-click on each and select "Show debug tags for XXX". You'll be shown a menu that displays all the tags that thing has at the end of the evaluation cycle. That's where you can figure out that all the armors use the BaseArmor component, but the gear doesn't.
Mathias is offline   #4 Reply With Quote
coyote6
Member
 
Join Date: Sep 2007
Location: Salinas, CA
Posts: 64

Old December 1st, 2009, 07:33 PM
That worked great. Thanks, Mathias.

I did come up with another question -- as I understand it, Heavy Armor Optimization should still work with mithral (and similar "reduce the armor weight category" materials) full plate or other heavy armors. The MIC says they count as the lighter categories for "movement, proficiency, and other limitations"; it seems counter to the intent to make it hurt a character.

Anyways, I think that's the way we're playing it. So, is there a way to make it work for formerly-heavy-but-now medium armors?

I see that mithral appends the word mithral to the item's name; is there a function that can string match? Of course, then you'd have to string-match for every lightening material, which I can see easily being obnoxious. (I.e., every time something is added from a splat book, or someone comes up with a freaky combo -- ironwood spell + permanency + darkwood.)

I saw that mithral reduces armor weight category at First 11000, so I tried changing the timing of the eval script to First (users) 10500, but that caused it to not do anything. Too bad -- if I could have had the feat do its thing before the materials de-heavied the armor, it would have been simple.

So, is there a function that can check for mithral-ization of medium armors? Any other ideas?

I could use the adjust tab to fix the AC bonus as a workaround, but I don't see any options in Adjust that'll let me tweak the ACP.

Last edited by coyote6; December 1st, 2009 at 07:36 PM.
coyote6 is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,380

Old December 1st, 2009, 07:48 PM
I haven't tried this out yet, so I don't know if I missed anything.

Near the bottom of the editor entry is a section for user tags. Go in there for your feat and define one, for example, ArmorOptim.

Now, in a script on your feat, running before Mithril reduces the armor category (First/10500), use the same foreach you're using above to find all the heavy armors, and then execute the following:

Code:
perform eachpick.assign[User.ArmorOptim]
You've now tagged all the heavy armors with something that won't be altered when mithril operates.

For the later search, look for that tag alongside everything else:

Code:
 
foreach pick in hero from BaseArmor where "mClass.Heavy | User.ArmorOptim"
Now, you'll find all the armors that are heavy armor at this point, or were heavy armor before mithril was applied.
Mathias is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,380

Old December 1st, 2009, 07:56 PM
A note on the earlier script - the doneif checks you run for the main script shouldn't be on the earlier script. None of the conditions they're checking for will have been set yet, so

Code:
 
doneif (hero.tagis[Hero.EquipArmor] + hero.tagis[mClass.Heavy] < 1)
Will always fail if it's run that early.
Mathias is offline   #7 Reply With Quote
coyote6
Member
 
Join Date: Sep 2007
Location: Salinas, CA
Posts: 64

Old December 2nd, 2009, 08:26 PM
That worked perfectly. Thanks (again)!

New question: Timing -- with the timing I was using (Post-Levels (users) 10500), the reduced armor check penalty wasn't being applied to skills; the original ACP was. I didn't notice that right away.

I tried various earlier timing values, but for the ones that work (so that the modified ACP is used for skills), the second doneif (checking if Hero.EquipArmor and mClass.Heavy) fails -- as you mentioned -- causing everything to fail. Presumably, the earlier times are before the armor is equipped, thus it fails.

I can get it to work by removing that doneif, and just letting the adjustments apply to all heavy (or formerly heavy) armor on the hero, whether or not he's wearing it.

So, right now, I'm skipping the second doneif and running the eval at user Pre-Levels 10000, and it's working fine. But I'm curious -- when is the ACP applied to skills? When is armor equipped? There has to be a time where armor is equipped but the ACP hasn't been applied -- but when is it?
coyote6 is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,380

Old December 3rd, 2009, 12:39 PM
The same script, at PreLevel/10000, assigns Hero.EquipArmor and adds the armor check penalty from that armor to herofield[tArmorChk].value - it's that field that's applied to the skills.

I think drop the second doneif entirely - if you have this feat, don't you want to see all the heavy armors you are carrying, not just the one you're wearing, modified to display the adjusted armor and armor check values?

I think you can move the whole process to First/10500, and skip the User tag hassle. By that time all the FtDisables will have been set, so if you add this feat to a character, them make him a skeleton, the feat will be properly disabled by the first doneif. (BTW, the skeleton and zombie templates disable feats at First/10000 - so that's the earliest point where doneif(tagis[Helper.FtDisable] <> 0) is useful.)
Mathias is offline   #9 Reply With Quote
Reply

Thread Tools
Display Modes

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 05:27 AM.


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