Jump to content

Recommended Posts

You know all the IDS and 2DA files that use hex as markers? STATE.IDS is the best example. Here's a sample:

0x00200000 STATE_NONDETECTION
0x00400000 STATE_IMPROVEDINVISIBILITY
0x00800000 STATE_BLESS
0x01000000 STATE_CHANT
0x02000000 STATE_DRAWUPONHOLYMIGHT

Now let's say that, for whatever reason, you want to do a StateCheck in a script for a creature with one of these States (which are always hardcoded set by an opcode). You could do a check for each one, or, you could get your handy hex calculator (built-in Windows calculator can) and... add them together, giving us

0x03E00000 NAMEITWHATEVERYOUWANT

Great, right? AI mods did this ages ago to make target checking easier. But what does this have to do with kits and their restrictions? Well, if you look at KITLIST.2DA, each kit's restrictions (under the label UNUSABLE) is in hex. This means if you want to make a variant bard kit* that can't learn/cast Invocation spells, you could combine *Blade and Enchanter, giving an UNUSABLE of

0x00200200

This also means you can combine mage specialists, though this just restricts their spells more. The only thing to consider is that the main/starting kit is still going to have its own restrictions. For most kits, there's nothing hardcoded besides item usability. But some have little quirks like thief skills added in, so know what your starting point is.

Edited by Fiann of the Silver Hand
Link to comment

All this has happened before, and all this will happen again.

 

 

As promised, part two of the ongoing BG2 kit creation series. This section is going to cover the various files involved with kit creation, what they do, and how to avoid common pitfalls. To view these files, use an editor such as Near Infinity, DLTCEP, or Infinity Explorer. Don't worry too much abot modifying these files--the next part of the tutorial will discuss how to use WeiDU to do this for you.

 

Game Files

 

2da files are text files that contain tables of data used to define rules and parameters for the game. Kits rely on data specificaly in many of these tables:

 

KITLIST.2da - The master list of kits in the game. The kits are referred to by their "internal name" in the first column. Most should be easy to recognize save the FERALAN--this was a ranger kit that was cut and replaced by the archer ranger kit. It's internal name was never changed though. The LOWER, MIXED, and HELP columns contain the string references from dialog.tlk that provide the name and description of the kit that you see in the game. [Dialog.tlk is a collection of every line of text in the game--be it dialogue, item descriptions, names, etc.--indexed by a number. Spells, items, creatures, etc. do not actually contain their description in the file itself, instead they carry a string reference (STRREF for short) that points to the correct entry in dialog.tlk.] The ABILITIES column points to a CLAB****.2da file that contains the abilities that are gained by the kit on leveling up. The PROFICIENCY column is unknown, save that every kit has a unique value. UNUSABLE is a hex value that matches the kit to the proper unusable flag in item files. Item files have a series of flags that determine which classes and kits can use them. One value not listed is 0x00004000, which will give the kit the exact same restrictions as its parent class, i.e. a fighter kit will use the same restrictions as a vanilla fighter. One other note of interest is that these values can be added (use a hexadecimal calulator if you're not familiar with hex numbers) to combine restrictions. If you want a kit that has the item restrictions of a Cavalier and a Shapeshifter (lord knows why!) you would add their respective unusable values: 0x00000008 + 0x10000000 = 0x10000008. The final column, CLASS, refers to the parent class of the kit--i.e. Assassins, Bounty Hunters, and Swashbucklers would have the value for thief in this column. Valid values are 1 (Mage), 2 (Fighter), 3 (Cleric), 4 (Thief), 5 (Bard), 6 (Paladin), 11 (Druid), and 12 (Ranger). The missing values are for the various multi-class and unkittable single-class characters.

Link to comment

Oh god(s), Mike is one of the Five! Everybody run! He's going to... um...sing Beatles songs and reincarnate Starbuck! Or something.

 

Yes. That is very useful when creating kits. Rather than using some arcane method to restrict your bard to leather armor, or using one of the three precious, precious, untouchable unused usability flags :nono: (ahem, which my mod is doing :devlook: ), you can just use the Stalker flag.

 

1) What I wish you could do, is make a kit match the usability restrictions of another class.

 

2) I'm curious: does the method Fiann mentioned strike people as a good way to make a bard kit that cannot learn wizard spells? Give it all of the wizard kit usability flags, so that every school is restricted? I'm dying to figure out a way for a mod to completely control the bard spellbook and restrain players from learning new spells...

Link to comment

1) What I wish you could do, is make a kit match the usability restrictions of another class.

Can you give me an example of how you can't ? :hm:

Say a fighter that abides ALL the restrictions of a mage, aka quarter staff, mage robes and so forth should be as easy as setting the kit usability as the main class: 0x00004000, and the class to be 1...

 

So that ends up being: 0x00004000 1 as the usability flag ... you set the class in the k_x_y.2da table ... and if you need to, you can also do a lot of in kit class changes with scripts and other cheese.

Of course cause you are not a mage you can't cast spells, being a fighter.

Link to comment

But... then it will be a mage kit, not a fighter kit...!

 

I thought that last digit doesn't just set usability, it sets the class of the kit.

 

Also I have been told (but have not personally confirmed) that if you put a kit from a different class into a k_x_y.2da table, it won't work in-game. Like, code up a kit as 0x00004000 1 and add it to K_F_H.2da, then clicking on it will not work.

Link to comment

Valid values are 1 (Mage), 2 (Fighter), 3 (Cleric), 4 (Thief), 5 (Bard), 6 (Paladin), 11 (Druid), and 12 (Ranger). The missing values are for the various multi-class and unkittable single-class characters.

Sometimes when people say "valid", they mean "I don't know a reason to do this". Does valid here mean that, or does it mean the engine won't recognize any other value?

 

@sd That's similar what I was attempting. I want to eliminate a useless school from mages and make it all bard (-only) spells.

 

All this has happened before, and all this will happen again.

That's too bad. Did any mods in the 12 years (minimum) ever make use of something like this? My use was a melee-focused bard, so I wanted to restrict it from typical damage spells.

Edited by Fiann of the Silver Hand
Link to comment

I thought that last digit doesn't just set usability, it sets the class of the kit.

And ? So ?

You can subject the kit to a spell that changes the characters class, without assigning a new kit, if you are sure you don't need to do other things, like setting stats for example. Max HPs for example are usually must on a fighter changeling.

 

Sometimes when people say "valid", they mean "I don't know a reason to do this". Does valid here mean that, or does it mean the engine won't recognize any other value?

The 19 works in EE. With valid, they mean that you might wish to subscribe to the valid values when making kits... cause you'll have to do all sorts of tricks to enable the others. The example ones are the ones you can assign with the associated k_x_y.2da tables...

So you wish to make a ranger, set the class to be ranger, and use the K_R_H.2da, and other K_R_*.2da's to do it.

You wish to make a fighter kit that turns to be a multi cleric/mage... Use the K_F_H.2da, and when you make the clab***.2da table, make a spell that summons a scripted creature that turns your character to be a cleric/mage ... as the usability flag means not a darn thing. Unless you are the class in the kitlist.2da ... so you might as well set it to be 14.

Edited by Jarno Mikkola
Link to comment

... The only thing to consider is that the main/starting kit is still going to have its own restrictions. For most kits, there's nothing hardcoded besides item usability. But some have little quirks like thief skills added in, so know what your starting point is.

Has anybody compiled a list of these 'specials'?

 

I know:

 

Mage: spell school restrictions (and, apparently, an undocumented bonus to learn spells of your school, and save penalties to spells if that school). Maybe penalties with other schools, but I'm not sure

 

Thief: (bg2/bgt). Skill points per level for assassin and bounty hunter. Ee: shadowdancer hips

 

Barbarian: backstab immunity

 

Paladin: +2 to saves

 

What else?

Link to comment

I think the inquisitor's inability to memorize priest spells, the barbarian's d12 HD, and possibly the blade's reduced lore value are all tied to their usability flags.

 

 

Valid values are 1 (Mage), 2 (Fighter), 3 (Cleric), 4 (Thief), 5 (Bard), 6 (Paladin), 11 (Druid), and 12 (Ranger). The missing values are for the various multi-class and unkittable single-class characters.

Sometimes when people say "valid", they mean "I don't know a reason to do this". Does valid here mean that, or does it mean the engine won't recognize any other value?

 

I haven't messed around with making a kit for a multi-class, because I assumed it wouldn't work very well (e.g. when would it fulfill the level requirements in the CLAB file?). The kit creation tutorial has several mentions of not being able to make sorcerer/monk kits. This isn't technically true for BG2, but if you did make them, they wouldn't show up in character generation and they suffered from some hardcoded issues. AFAIK, you can create sorcerer and monk kits in the EE games perfectly fine.

 

 

All this has happened before, and all this will happen again.

That's too bad. Did any mods in the 12 years (minimum) ever make use of something like this? My use was a melee-focused bard, so I wanted to restrict it from typical damage spells.

 

I can't think of any kits in particular that did this, but I'm sure there are a few out there. Everyone used that tutorial. A lot of kits would be happy with the item restrictions of one vanilla kit, so they could just set their usability value to match that kit.

Link to comment

@sd That's similar what I was attempting. I want to eliminate a useless school from mages and make it all bard (-only) spells.

My solution for this is going to be, move bards into the thief class, and give them custom innate abilities to represent musical magic spells.

 

Only downside is, innate abilities using NRD opcode to choose from a list of spells, equals an extra click. But it's the best I can come up with under the circumstances.

 

(And, it frees up the old bard class to be developed as a psionicist. The modal (stand around singing bard song" ability can work great for psionics. But, I need to prevent the psionicist from scribing wizard spells.)

Link to comment
On 2/23/2016 at 11:44 PM, Grammarsalad said:

Thief: (bg2/bgt). Skill points per level for assassin and bounty hunter. Ee: shadowdancer hips

Doesn't shadowdancer use the vanilla thief usability flag?

0x00004000       4

So, could you create a ranger kit with HIPS by using 0x00004000 4 and then setting the kit to ranger via clab file? 🤔

Link to comment

I just want to add that I'm pretty confused by this.

Setting a ranger's kit to shadowdancer does enable HIPS (but not grant any CLAB file abilities nor HLA's to the ranger, which makes it pretty useless for creating off class kits with HIPS anyway..) but the thing is, there are plenty of thief kits out there that use the vanilla thief usability flag.. if HIPS is tied to that, they all would be able to do it on EEs. (Which is not the case AFAIK)

Link to comment

I think that HIPS is tied to the Shadowdancer kit's IDS value (0x00004021), not its usability value.  The same is true of various other abilities - IIRC, specialist opposition schools are tied to their usability values, but their saving throw penalties and spell-learning bonuses/penalties are tied to to their IDS values.  I think. 

AFAIK there is no way to mimic an existing kit's IDS value, except insofar as the ~17th kit you install (0x00004040) will necessarily share some characteristics of an Abjurer (0x00000040), and the ~81st new kit (0x00004080) will necessarily share some characteristics of a Conjurer (0x00000080), and the ~113th new kit (0x00004100) will necessarily share some characteristics of a Diviner (0x00000100).

Link to comment

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...