Jump to content


Photo

[info/discovery/repost]

kit restrictions

11 replies to this topic

#1 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Modders
  • 387 posts
  • Gender:Male
  • Location:MURICA

Posted 22 February 2016 - 03:19 PM

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, 01 April 2016 - 11:34 PM.


#2 Mike1072

Mike1072
  • Gibberling Poobah
  • 2341 posts
  • Gender:Male
  • Location:Canada

Posted 22 February 2016 - 04:59 PM

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.



#3 subtledoctor

subtledoctor
  • Modders
  • 2113 posts
  • Gender:Male

Posted 22 February 2016 - 07:04 PM

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


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#4 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6119 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 22 February 2016 - 07:36 PM

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.


Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#5 subtledoctor

subtledoctor
  • Modders
  • 2113 posts
  • Gender:Male

Posted 22 February 2016 - 08:06 PM

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.


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#6 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Modders
  • 387 posts
  • Gender:Male
  • Location:MURICA

Posted 22 February 2016 - 08:12 PM

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, 22 February 2016 - 08:16 PM.


#7 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6119 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 22 February 2016 - 09:40 PM

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, 22 February 2016 - 09:43 PM.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#8 Grammarsalad

Grammarsalad
  • Modders
  • 445 posts
  • Gender:Male

Posted 23 February 2016 - 02:39 PM

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

#9 Grammarsalad

Grammarsalad
  • Modders
  • 445 posts
  • Gender:Male

Posted 23 February 2016 - 02:41 PM

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

...


How would this work? How would you restrict wild mages from this school, for example?

#10 Mike1072

Mike1072
  • Gibberling Poobah
  • 2341 posts
  • Gender:Male
  • Location:Canada

Posted 23 February 2016 - 03:11 PM

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.

#11 subtledoctor

subtledoctor
  • Modders
  • 2113 posts
  • Gender:Male

Posted 24 February 2016 - 06:34 AM

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

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#12 Fiann of the Silver Hand

Fiann of the Silver Hand
  • Modders
  • 387 posts
  • Gender:Male
  • Location:MURICA

Posted 24 February 2016 - 03:22 PM

Sounds neato. I've always loved the idea of psionics, but never got it meshed well in magic environments. Usually better (for me) in low/no-magic, tech-oriented schemes. Still, The Psionicist's Handbook and Dark Sun setting were real high points for 2e, imo.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users