Hero Lab 4e

Herolab D&D 4e Development => Herolab 4e Development => Herolab 4e Bugs => Topic started by: ledeir on October 23, 2014, 12:38:06 PM

Title: Armor at Paragon and above
Post by: ledeir on October 23, 2014, 12:38:06 PM
Howdy.
Great work on the datafiles! You don't know how excited I was when I booted up herolab on a new machine and found I no longer needed to run the downloader.

I did encounter one surprising issue though. I transfered my DnD Insider character to HL and my armor dropped 2 points.

Apparently Wizards issued errata on how armor worked. Once you get to Paragon tier and above the base value of armor increases.

I only know scale specifically, but I'm told it is the case for all armor.
Scale: Lvl 6-10 +8, Lvl 11-15 +9, Lvl 16-20 +10, 21-25 +11, 26-30 +13 (yes, 13)

I'm not sure how that would be implemented in HL but I wanted to let you know.

Keep up the good work!
Title: Re: Armor at Paragon and above
Post by: Cryptoknight on November 05, 2014, 04:38:28 PM
I've heard that before... but I can't find it in the errata..

http://archive.wizards.com/dnd/files/UpdateCompiled.pdf

I no longer have a compendium account to log into... which makes it hard to look up.
Title: Re: Armor at Paragon and above
Post by: ledeir on November 05, 2014, 04:51:36 PM
I had my friend sent me a screenshot from it since I don't have a subscription either.

Unfortunately I only have it for scale.
Title: Re: Armor at Paragon and above
Post by: Cryptoknight on November 13, 2014, 09:31:22 PM
So wait... on this one... only magic armor gets this inherent bonus?  Not mundane?

i.e. if I was level 8 wearing scale I don't get this unless it's Scale +2?
Title: Re: Armor at Paragon and above
Post by: dracusmage on January 27, 2015, 04:25:42 PM
I always figured that higher level magic armor would use the better quality materials, which then gives the bonuses to AC.

Do we know what the bonus is based on? Item level or character level? I think it's based on item level, but I can't find it in the errata, so all I have to go on is the blurb in the listing. From what I can see, all grades of basic armor get bonuses, but it depends on how heavy the armor is how soon it starts (cloth, for example, is +1 at 16-25 and +2 at 26-30).

This probably should be fixed at the magic item level, but that sounds like a lot of copy pasting a lot of the similar logic into a ton of items. ddi_armor has all of the base pieces, but I don't know if logic checking the magic item level (mgLevel) from the magic added on top would fire in time to change the AC value. I'll have to look at the code to figure it out, or else just try it. Hopefully this week.

If that doesn't work, thing_magic_items.dat might have to be fixed to modify the AC after pulling all of the item stats, or tab_armory.dat. We are, however, rapidly spirally out of my comfort zone.
Title: Re: Armor at Paragon and above
Post by: Cryptoknight on January 29, 2015, 06:36:56 AM
I think the trick would be to fix it at the armor level (Cloth, Plate, Scale, etc)

Some kind of conditional script to detect if the item in question was magical... then based on the item level apply an extra bonus to it.
Title: Re: Armor at Paragon and above
Post by: dracusmage on January 29, 2015, 12:59:38 PM
That's exactly what I'm going to try, probably today. Just throw a script together and hope that it triggers after the magic part is selected. Otherwise I will have to put it at a lower level, which will make it fire way more often.
Title: Re: Armor at Paragon and above
Post by: dracusmage on January 29, 2015, 01:45:06 PM
If you are curious, the armors I found in the compendium affected by this are:

Cloth Armor -- 16-25 AC 1, 26-30 AC 2
Leather Armor -- 16-25 AC 3, 26-30 AC4
Hide Armor -- 16-25 AC 4, 26-30 AC 5
Studded Leather -- 16-25 AC 4, 26-30 AC 5
Ring Mail -- 16-25 AC 4, 26-30 AC 5
Chainmail -- 11-15 AC 8, 16-20 AC 9, 21-25 AC 10, 26-30 AC 12
Scale Armor -- 6-10 AC 8, 11-15 AC 9, 16-20 AC 10, 21-25 AC 11, 26-30 AC 13
Splint Mail -- 6-10 AC 8, 11-15 AC 9, 16-20 AC 10, 21-25 AC 11, 26-30 AC 13
Plate Armor -- 6-10 AC 9, 11-15 AC 10, 16-20 AC 11, 21-25 AC 12, 26-30 AC 14
Banded Mail -- 11-15 AC 8, 16-20 AC 9, 21-25 AC 10, 26-30 AC 12
Spiked Plate -- 6-10 AC 9, 11-15 AC 10, 16-20 AC 11, 21-25 AC 12, 26-30 AC 14
Full Plate -- 6-10 AC 9, 11-15 AC 10, 16-20 AC 11, 21-25 AC 12, 26-30 AC 14
Title: Re: Armor at Paragon and above
Post by: dracusmage on January 29, 2015, 05:47:32 PM
I'm not stumbling upon the correct script code to grab the information I need to set the right AC value, and without knowing that it's the right code, I can't be sure if it's in the right place with bad code, or if it's good code that just happens too soon/late to make the change it needs.

ddi_magic_armor.user is where it pulls the armor's magic powers (compset "MagicArmor"). Each option has a field="mgLevel" which specifies the level of the magic.

ddi_armor.user is where the mundane base item is pulled from (compset "Armor). This is also where someone with just mundane armor gets the information, including field="arAC" which specifies the AC bonus of the armor.

thing_magic_items.dat is where the custom magic armor building starts, I think (lines 111-128).

Finally (I think), form_magic_armor_create.dat is where the actual construction occurs. It is also entirely possible that it occurs somewhere else, and the form just shows the results.

Ideally each basic armor type affected (posted above) has the correct code for the following (written in pseudo code currently, for chainmail):

Doneif NotMagic
If mgLevel >= 11 then
  arAC = 8
endif
If mgLevel >= 16 then
  arAC = 9
endif 
If mgLevel >= 21 then
  arAC = 10
endif
If mgLevel >= 26 then
  arAC = 12
endif

Although, as I look around, this maybe should be going into thing_defenses.dat -- if we do the work there, it will not show the armor as having the higher AC, but it would definitely be occurring at the right time to appear on the character correctly. The dual wielding with defensive weapon(s) scripting to give +1 AC is in thing_defenses.dat, so it will clearly add the value in time. It will have a lot of script that runs each time, but only for the equipped armor.

Any ideas? Either in proper tag category/names or location to have the script?

Title: Re: Armor at Paragon and above
Post by: dracusmage on January 30, 2015, 02:56:16 PM
There are 91 types of enchantable armor (not including barding) and 12 types of basic armor that you can just wear (not including barding or shields). Hero Lab keeps this straight by using a value in the enchant only armors called arMinBonus which specifies a minimum enchantment bonus to be valid.

+1 Enhancement bonus maps to Magic Level 1-5, +2 is 6-10, +3 is 11-15, +4 is 16-20, +5 is 21-25, and +6 is 26-30.

Cloth, Leather, Hide, Studded, and Ring all have a bonus that spans the range of +4 and +5, but all other bonuses are 1 modifier range. I'm not really sure why they didn't just say in the errata and compendium that it gets a bonus if enchanted with +x value, but that's neither here nor there.

This means that we can just make a stack of additional armors that will only appear and be valid for higher levels of enchantment. The downside is that you will be able to pick worse grades of armor, but it will at least allow for the correct values now.

It may be worth figuring out where arMinBonus starts (procedures.dat, I think) and add in a arMaxBonus that could then act as a cap on the validity of the basic armor. It would then have to be integrated into forms and tabs wherever it needs to, but that's probably not actually vital - if you want to pick sub-par basic armor to enchant, that's your prerogative, I guess. I mean, that's already what is happening by not using one of the fancier enchantment only armors instead anyway.

Attached is the arMinBonus fix version. You just have to make sure you pick the highest AC version of the armor you want as the underpinnings. It's not particularly elegant, but it will do the job.

Possibly there is a script option to hide valid but inferior versions of armor in the magic armor form without a arMaxBonus. Something like If +6, hide +5 and +4 and +3 and basic versions. Maybe another day.
Title: Re: Armor at Paragon and above
Post by: Charlie on February 02, 2017, 07:15:42 PM
Well, crap. We just hit this in our campaign, and I was really hoping that I could find a decent way to address this.

No offense to dracusmage, but at this point I think we're happier tossing a Permanent Adjustment to make up the difference on the characters it affects.

Mind you, I haven't come up with anything better.
Title: Re: Armor at Paragon and above
Post by: dracusmage on February 02, 2017, 08:59:45 PM
The file attached to the last post has a fix, if not the best fix. It doesn't hide inferior grades of whatever armor type, but it doesn't let you pick one that is too good. Just make sure you pick the best base armor you can of the type it is (hide, chain, whatever) and it should give the right bonuses. Additionally if the magic armor is a better class of base armor (with the bonuses and special features) it should be correct.

I don't remember off the top of my head where you need to stick the .User file to make it work, but that's probably somewhere in this forum or at most a Google search away. Once it's in the right folder, open the program (or close it then open it if it's already open) and you should have more armor choices (the relevant bonus versions) when picking the magic armor.

If you find something wrong, let me know and I'll take a look at it.
Title: Re: Armor at Paragon and above
Post by: Charlie on February 03, 2017, 01:50:42 AM
I realize that your file does the job, I just think that it's confusing to use. Mind you, I haven't come up with another way to work it.  :P
Title: Re: Armor at Paragon and above
Post by: dracusmage on February 03, 2017, 08:23:58 AM
I completely agree. If you have to track everything in your character generator to make sure you are getting the right bonuses you are 90% of the way to just creating your character by hand in the first place and saving the money for the generator to be spent on better things, like fancy metal dice to ding up your friend's table.

The only thing that makes my weak sauce fix better than doing a manual adjustment is that if you don't remember the Byzantine modifier progression you will get an option that is correct when you add the magic armor. It may be burried in a half dozen less optimal versions, but at least it's there to be noticed.

Don't get me wrong though. I will not feel bad if you hate this fix and curse my name every time you add a piece of +3 plate and you have to swim in irrelevant versions. This was my best shot, but it wasn't very good, and I'm not going to be adding this to my CV. I have ADD, so when a fun new problem to fix stops making progress or would literally require making a change to every single enchantment individually because I can't get the better way to work, I peace out and move onto something less frustrating.

https://youtu.be/5q3BtIaB2Hc (https://youtu.be/5q3BtIaB2Hc)

A script to check for the best valid version of each basic type and hide the less optimal versions is probably the easiest actual fix, but I can't remember if I just couldn't get the script to work or if I just threw in the towel when it became clear that the only fix I would be proud of would require adding a new variable and all of the horror that entails. They will both do the same thing in effect, but the variable fix would automatically work with any new armors someone might add that act like the basic ones so long as they add a max value line to each grade. The script version would require an updated script for each new category of armor - the script itself would have to have a section for culling each kind individually, so new base armor means a new section in the script. Neither of those two are very likely to be needed, as Wizards isn't making new anything for this set, and I'm having a hard time imagining what a new base armor would be; chainmail bikini or something else impractical, probably.

Maybe after 2 years I'll take another stab with fresh eyes; I am less than confident I will make much progress, however. The extensible fix requires going deep in the guts of this thing, and the acceptable fix will require me finding the right bits.
Title: Re: Armor at Paragon and above
Post by: dracusmage on February 03, 2017, 04:34:10 PM
You are in luck. I was bored and people are too afraid to come downstairs to bother me because of the painting, so I have an actual, legitimate fix.

This will add the better versions of the armors and will only show the best one of each version when using the "Only valid items" option. Assuming you meet the other requirements of the armor. If you have all selected, it will give you a validation error that there is a better version you should use instead of the one you have or are trying to select.

The fix is two files. One has the armors with max stats where relevant (the up to level 30 versions I didn't cap in case someone has some sort of super-epic level campaign with scads of homebrew). The other is a backend scripting/variable file. You should make a backup of your current equipment.str file before you overwrite it with mine.

If you install either of the two files it won't fix the problem, but it won't crash anything. If you only install half of the scripting chunks, you probably have a 50/50 shot at getting some errors.

Armor.BasicEnchanted.user has all of the types of basic armors that scale with magic level.
To make this document I created a version of the basic armor for every tier it has, and gave accurate min and max magic levels. This also supercedes the normal level 1 versions of the armors (they are all in here in order to add a magic max value). This version replaces my previous one, as it now includes a maximum magic power stat for these pieces of armor.

equipment.str is a special file. While you can create .user files to create or replace things in the normal data files, this one can't be modified except by actually modifying the file.
This will replace the equipment.str that you already have. If you have installed another fix that went into the equipment.str file, you should not drop this over the top.

In the zip file there is also a text file that will say what it does, and the snippets necessary to drop into the equipment.str file if you don't want to overwrite it with mine, either because there are already fixes or because you are just curious what the inside of the file looks like. I don't judge.

Let me know if you find any errors, and I'll correct them.
Title: Re: Armor at Paragon and above
Post by: Charlie on February 03, 2017, 11:47:43 PM
Wow, thank you!  :D  I think this is a keeper. One thing that I noticed was that when I was fixing my character that having the wrong level armor also gave me a "Multiple sets of armor equipped" error, but I certainly don't think that's a deal breaker.

Flagging the problem regardless of the order you build the armor in is a huge improvement. Thanks again!
Title: Re: Armor at Paragon and above
Post by: dracusmage on February 04, 2017, 01:01:14 AM
I'll have to see if I can replicate that error, but I'm not quite as concerned about extra errors when there is a problem. I'm far more concerned with error messages when the right thing is happening or no errors when the wrong thing happens.
Title: Re: Armor at Paragon and above
Post by: dracusmage on February 04, 2017, 11:47:52 AM
I can only get the multiple sets equipped error when I actually have multiple sets equipped. I've tried non-proficient armor, too low, to high, wrong enchantment type, but nothing is causing an extra error (beyond when I combine errors like low level armor, with incompatible enchantments and no proficiency).

For example +5 Agile Resolve Vestments on Spiked Plate +11 gives an inferior armor error, and two errors for the enchantment - one telling me that it is the wrong kind of magic item, and one telling me that the enchantment is incompatible with the armor. Strange that it does that twice, but it's probably just checking from both ends. Not a problem, because the errors are both correct anyway, if redundant.

Can you send me a portfolio with a hero with the multiple sets error active?
Title: Re: Armor at Paragon and above
Post by: Charlie on February 04, 2017, 07:38:48 PM
Sure, but it could be an artifact of other changes we've done to the files, and I agree that an extra error isn't that worrisome.

When I change the armor to the +8 version of Plate on my character, I see the extra error.
Title: Re: Armor at Paragon and above
Post by: dracusmage on February 04, 2017, 09:34:44 PM
Your character threw an error about a missing rules file which orphaned something, but that wasn't the problem. All of the base level armors give that error. If you have any basic armor (Cloth +0, Leather +2, Plate +8, etc) all throw a multiple armors equipped error, both when they are enchanted and completely basic and not just for your character. It doesn't do anything foolish, like give a second bonus or something, so everything on the sheet is correct, but it still shouldn't throw an error like that.

I've done some testing and I know what is causing it, but I can't fix it without merging the armor fix into the ddi_armor.user file directly.

Because I wanted to make the lowest grade armors disappear I needed to add the max stat into them, so I did what works everywhere else; I copied them into the new file, changed the id to keep them unique, and added a "replaces" to designate that instead of the normal version the program should toss it away and use this one instead, using its name and everything.

For some reason, the system sees a "replaces" piece of armor twice. The validation code is in thing_validatation.data, but it's nothing complicated that could cause a problem that I can see:
Code: [Select]
  <!-- Armor thing for validation reporting -->
  <thing
    id="valArmor"
    name="Armor"
    compset="Simple">
    <tag group="Helper" tag="Bootstrap"/>

    <!-- Make sure that we don't have multiple sets of armor equipped -->
    <evalrule index="1" phase="Validate" priority="8000" message="Multiple suits of armor equipped"><![CDATA[
      ~if we have no more than one set of armor equipped, we're good
      if (hero.tagcount[Armor.?] <= 1) then
        @valid = 1
        done
        endif

      ~mark associaated tabs as invalid
      container.panelvalid[armory] = 0
      ]]></evalrule>

    </thing>

If we "debug the tags" of the armors, the basic ones load both the fixed version from the fix file, and also the old one without the max stat. arChainmai and arChainm1, for example. Not sure why. Possibly because the armors are both a type and an item so it deletes the replaced one as far as items go, but loads it when the armor is loaded? I dunno. But putting the max stat into the version that is already in the ddi_armor.user file and removing the "1" level in the fix file makes this issue go away.
Title: Re: Armor at Paragon and above
Post by: Charlie on February 06, 2017, 06:44:27 PM
Thank you again! Since we've been concentrating on bug fixes in our group, I just went and put the new higher level armor variants into the ddi_armor.user file along with fixing the base levels.

By the way, I think you missed the base level of Studded Level in your file. I knew that Studded Leather was supposed to match Hide Armor, so it's fixed in our copy.
Title: Re: Armor at Paragon and above
Post by: dracusmage on February 09, 2017, 11:28:57 AM
At this point putting fixes directly into the data files is the right way to do it. When we were still scraping for the data and any month might mean you would be generating all new data files due to a new book or errata having the fixes in external files meant you didn't have to keep fixing the same issues. We are so far past needing to scrape that there is little reason to use a one-off file other than you don't need to do the manual additions and a package update is a long time coming.

This is why I've just started pushing for a source control system to maintain the changes. I don't have the time to go though this forum and find every fix and manually integrate them and generate a new update, and the fact that we are almost a year past the last update pack shows that that's too much time and work for anyone else to do either.

I may not upload a fixed version with Studded Leather, but I probably will integrate it into my source tree.
Title: Re: Armor at Paragon and above
Post by: dracusmage on February 13, 2017, 06:52:16 PM
Some of the fixes for equipment.str need to be placed in editor.dat to make it possible for people who don't love straight-up xml editing to change/view/create the correct field in armors to limit the magic.

I'm not fixing it right now, I just wanted to make a note somewhere so I wouldn't forget that that's an issue.

Not a huge issue, but it's important for completion's sake.