Jump to content

Dreaded Unusability Flags


Recommended Posts

Posted

No matter how you add a new kit, there is going to be a point where it becomes necessary to deal with the unusability flags.  A Google search reveals hints of the power of this hexadecimal.  However, only @CamDawg's tutorial gives any real description of this parameter.  There is also a weidu tutorial on unusablity, also made by @CamDawg, but also Bigg and @Wisp., and it shows the awesome power of these flags; but it is also written way above my head.

However, I cannot figured out where to get those kit values to be added.  I have looked at the flags on IESDP, but I cannot match them up the hexagonal values for Cavalier and Shapeshifter, 0x00000008 and 0x10000000 respectively, and that @CamDawgreports in his tutorial.  Unfortunately, I am probably wrong and misunderstood something.  Can someone help me?

I want my fighter/mage to have the usability of the Blade kit for the Bard for purposes of weapon and armor.  It is just about perfect; except I do not want it to have access to the bard musical items.  Any help is 

Posted

Kit usability flags are split among four different eight-bit fields in ITM files (offsets 0x29, 0x2b, 0x2d, 0x2f). So really, Cavalier is BIT3 = 0x08 in the fourth field at offset 0x2f, and Shapeshifter is BIT4 = 0x10 in the first field at offset 0x29. To convert from the form in KITLIST.2DA to the form used in the ITM files, you would need to split up that 32-bit number into four eight-bit numbers. For example, the Blade's 0x00200000 becomes 0x00 0x20 0x00 0x00, or BIT5 = 0x20 in the second field.

The problem is that giving your kit the Blade's unusability flags would absolutely not do what you want. Here's a complete list of all items in BGEE (with SoD) that have the Blade unusability flag set: BDasdag1.itm. For the record, that's an unused clone of a basic dagger flagged to be unusable by all kits and by all race/class/alignment combinations other than lawful neutral human fighter/thieves. I don't know why it exists in the SoD files, but it does.

The actual usability rules for the Blade, and the other bard kits, are "they can use anything a standard bard can use, so we'll never add an extra unusability flag for the kit". So what you'd have to do to get your new kit that bard usability pattern is to, in addition to assigning one of the bard kit flags to your new kit, is to go through all items and flag the ones that bards can't use with that kit's unusability flag. It won't break anything for bards because an item being unusable in two ways is the same as it being unusable in one way, and bards can't multiclass or dual-class.

The bard instruments are flagged to be usable by bards and unusable by all other classes. As your proposed kit won't have the bard class, it won't be able to use those items. No special effort required for that part.

Posted (edited)

Usability is a combination of the kit flags and the class. You can control the kit flags, but of course you cannot control the class - the character’s class is whatever it is, end of story. 

To align a multiclass ‘bard’ kit with existing bard kits’ usability, you have to get pretty involved. My mod does that, it looks like this (lines 1946-2050).

Edited by subtledoctor
Posted (edited)

That looks like a more complicated scheme, using effects on the item to forbid them to "bards" rather than repurposing a mostly unused kit flag. And since it converts existing bards to other multiclasses, it has to enable the bard-only items for the new classes, while forbidding them for non-bard members of those classes. Adding a new kit with bard-like usability while leaving existing bards alone can be simpler.

Also, I spotted a bug in the code. Line 1961:

((%bard_use% BOR 0b10111111) = 0b10111110)

Always false, since that's the inclusive OR. Which means that the whole IF block that's a condition for never runs. That can't possibly be intended.

Edited by jmerry
Posted

Ah, I misread the top post - I thought OP wanted to enable the F/M kit to use equipment that a Blade can use.

1 hour ago, jmerry said:

Also, I spotted a bug in the code

Good eye! Fixed now.

Posted
14 hours ago, jmerry said:

Kit usability flags are split among four different eight-bit fields in ITM files (offsets 0x29, 0x2b, 0x2d, 0x2f). So really, Cavalier is BIT3 = 0x08 in the fourth field at offset 0x2f, and Shapeshifter is BIT4 = 0x10 in the first field at offset 0x29. To convert from the form in KITLIST.2DA to the form used in the ITM files, you would need to split up that 32-bit number into four eight-bit numbers. For example, the Blade's 0x00200000 becomes 0x00 0x20 0x00 0x00, or BIT5 = 0x20 in the second field.

Thank you, now I understand how to reverse engineer 0c10000008 unusability flag.  Unfortunately, I do not know how to proceed from here.

14 hours ago, jmerry said:

The problem is that giving your kit the Blade's unusability flags would absolutely not do what you want. Here's a complete list of all items in BGEE (with SoD) that have the Blade unusability flag set: BDasdag1.itm. For the record, that's an unused clone of a basic dagger flagged to be unusable by all kits and by all race/class/alignment combinations other than lawful neutral human fighter/thieves. I don't know why it exists in the SoD files, but it does.

The actual usability rules for the Blade, and the other bard kits, are "they can use anything a standard bard can use, so we'll never add an extra unusability flag for the kit". So what you'd have to do to get your new kit that bard usability pattern is to, in addition to assigning one of the bard kit flags to your new kit, is to go through all items and flag the ones that bards can't use with that kit's unusability flag. It won't break anything for bards because an item being unusable in two ways is the same as it being unusable in one way, and bards can't multiclass or dual-class.

The bard instruments are flagged to be usable by bards and unusable by all other classes. As your proposed kit won't have the bard class, it won't be able to use those items. No special effort required for that part.

Your logic makes perfect sense.  There is no other kit whose class allows armor heavier than chainmail but the kit restricts to chain.  I am not sure how to proceed.

11 hours ago, subtledoctor said:

Ah, I misread the top post - I thought OP wanted to enable the F/M kit to use equipment that a Blade can use.

I am making a fighter/mage kit.  I am trying to restrict armors to no heavier than chainmail.  Might rethink.  Any suggestions.

Posted

The short answer to how to proceed? Edit the items. If there's no flag that does what you want, you make one.

And I described how to do that; you choose one of the bard kits, assign its flag to your kit, and then go through all items to assign the kit unusability flag to everything that has the bard class unusability flag.

Posted (edited)
8 hours ago, MindTyrant said:

trying to restrict armors to no heavier than chainmail.  Might rethink.  Any suggestions.

Could give it the barbarian flag - no armors heavier then splint. (And once you get into the game and you have magic armor, most is either magic plate or magic chain, so this effectively becomes a restriction to chain.) I don’t think the barbarian flag blocks anything else that would be problematic. 

Edited by subtledoctor
Posted

Actually, the barbarian flag does block tons of things that would be problematic. Such as spell scrolls. You won't be much of a fighter/mage if you can't learn any spells.

Posted

Spell learning is not governed by item usability. But that aside, it’s a bit weird that scrolls would block the barb kit. Isn’t that already covered by being unusable by fighters? In which case you could remove the barb restriction. 

Or is there some leftover engine weirdness with barbs once having been a distinct ‘class’ that makes the fighter flag not work for them?

Posted

Definitely leftover weirdness from when barbarians were labeled as a separate class. I don't think they ever were engine-wise, but the designers put that barbarian exclusion flag on basically everything not usable by single-class fighters.

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...