Jump to content

How to create a mage kit with multi-barred school in EE ?


Recommended Posts

in oBG2, if I want to create a mage kit with two forbidden schools: necromancer and evocation, I can write ~0x00000600 1~ in the kit setup routine. (enchanter + illusionist)
But in BG2EE, I can't do it. No matter what I write in the installation routine, the kit always has a number 0x40XX aligned after Soul_monk, Grizzly_Bear, ohtyr and ohtempus in kit.ids.
How to find this code system in BG2EE to ban schools to a mage kit?

 

Link to comment

That old hardcoding is still partially active; if the kit ID has the enchanter and illusionist bits, then those kits' banned schools will be unavailable at character creation and during sorcerer level-ups.

But if you want to deliberately ban schools, you should instead use the specialist kits' unusability bits in the item unusability field (UNUSABLE, column 7) of KITLIST.2DA. A mage kit with 0x00000600 there will be unable to learn necromancy and evocation spells, and also unable to cast those spells from scrolls unless they're also a rogue with UAI. Regardless of their kit ID.

Link to comment
2 hours ago, jmerry said:

That old hardcoding is still partially active; if the kit ID has the enchanter and illusionist bits, then those kits' banned schools will be unavailable at character creation and during sorcerer level-ups.

It seems not. I tried this old code on oBG2, it works. I tried it on BG2EE, it doesn't ban anything.

As the code ~0x00000600 1~ already corresponds to what should be written in kitilist.2da by the kit installation routine, how to do "more" on EEs edition?

Note : i try to make a mage kit with "only evocation spells" allowed.

Edited by deratiseur
Link to comment

The item usability flags are what matters for spell learning from scrolls. Character creation and sorcerer level-ups use the kit ID, which is something you can't control directly with the standard (EE) tools. Item usability is a parameter in the kit creation functions, or can be altered later by editing the 2DA.

And since I have no idea what tools you're trying to use, or what the "code" you're talking about refers to, I can't say much more about things.

Link to comment
7 hours ago, deratiseur said:

in oBG2, if I want to create a mage kit with two forbidden schools: necromancer and evocation, I can write ~0x00000600 1~ in the kit setup routine. (enchanter + illusionist)
But in BG2EE, I can't do it. No matter what I write in the installation routine, the kit always has a number 0x40XX aligned after Soul_monk, Grizzly_Bear, ohtyr and ohtempus in kit.ids.

Pretty sure that is true in oBG2 as well. The usability flag value (0x00000600) is a different thing from the IDS value (0x000040xx). The vanilla wizard kits are oddities in that their IDS values look like usability flag values; but this is coincidental. 

4 hours ago, jmerry said:

Character creation and sorcerer level-ups use the kit ID, which is something you can't control

Ah, I didn’t realize that. And it is rather unfortunate. 

This is a fraught proposition anyway, because choosing which school the kit can use relies on which schools cannot be used by other kits. If a player installs a mod that changes opposition schools, it could inadvertently change your kit. 

Limiting a mage kit to one school is a pretty extreme design goal; I might consider using more extreme methods to achieve it. Like, if the kit can only know Evocation spells, how important is learning from scrolls? Why not just put all Evocation spells in their spellbook, and bar other ones? Worst comes to worst you could apply a spell removing all non-Evocation spells and just tell players in the Readme “you have to pick spells during character generation but these picks are meaningless; once you get in the game you will only know spells from the Evocation school.” This is not ideal, but it’s what I do to make multiclass sorcerers get through character generation. 

Link to comment

On barred schools during character creation ... I think that anything barred through the item usability flags will be barred during character creation and sorcerer level-ups. I'm not sure what happens if there's a barred school that way and the kit ID also runs into the specialist bits. I am sure that if you don't bar any schools with the item bits and have a kit ID that's too high, you'll have barred schools from the kit ID during character creation and sorcerer level-ups.

Testing needed for the case in which both item usability and kit ID have some of the specialist bits.

Link to comment
4 hours ago, jmerry said:

On barred schools during character creation ... I think that anything barred through the item usability flags will be barred during character creation

Okay, this is what I thought as well, but your earlier remark suggested otherwise:

12 hours ago, jmerry said:

Character creation and sorcerer level-ups use the kit ID

...but I may have misconstrued it.

I thought I had a good handle on this stuff, but I may have been wrong, and indeed @deratiseur may be right that the EE engine is not behaving as you might expect. On BG2EE v2.6 I changed the Abjurer unusability flag in kitlist.2da from 0x00000040 to 0x00000440 - combining the Abjurer and Illusionist bit values. Then I fired up a game and created an Abjurer. Unexpectedly:

  • I could learn Chill Touch and Larloch's Minor Drain at character generation
  • I could cast those spells in the game
  • After removing Chill Touch from my spellbook, I gave myself a copy of SCRL82.itm, and I could learn Chill Touch again.

I checked the Chill Touch .spl file and it had the proper exclusion flag, excluding Illusionists. So it seems there is something hard-coded that stops the wizard specialist kits from sharing exclusion flags. Or, maybe they do in fact use the IDS value instead of the kitlist exclusion flag value.

I tried something else, and this is actually what I suggest for @deratiseur: I again changed the Abjurer exclusion value in kitlist.2da from 0x00000040 to 0x00000048. This combines the Cavalier paladin exclusion flag: 0x00000008. Then I set the Chill Touch spell to exclude Cavaliers. In-game, this works as expected: the Abjurer could not learn Chill Touch at character generation and could not lean the spell from scrolls. (It could still be cast from scrolls, because I did not change the .itm file's exclusion flags.)

A paladin kit is pretty safe for this sort of thing, because paladins cannot multiclass with mages or bards and cannot get UAI. I know another mod uses the Undead Hunter in this way, but I'm not aware of any mods that utilize the Cavalier flag. So you could:

  • Set your kit's exclusion flag to 0x00004008
  • Find all spells of all schools except Evocation, and set them to exclude the Cavalier kit
  • Find the scrolls for all those spells and set them to exclude the Cavalier kit

A big benefit of this approach is that it will continue to work as intended even if the player installs a mod that changes specialist school exclusions. The only real dangers are:

  1. If some other mod also uses the Cavalier kit flags in a way that would disrupt this.
  2. Your kit will not be able to equip any items in the game that Cavaliers cannot equip. Actually, now that I think about it, can cavaliers not equip missile weapons? Maybe use the Inquisitor exclusion flag, instead. Or, investigate whether someone is using the Undead Hunter flag and see if it is a real conflict. (I forget which mod it is... maybe the Sorcerer Place Collection.)

I think another mod uses the Jester kit flag in this way... though again I don't remember which mod. My mod uses the Skald and Archer flags in this way. but depending on what equipment you expect your kit should be able to equip, you could also use the Stalker or Beastmaster kit flags.

EDIT - in case it isn't obvious from all that explaining, the tl;dr here is this: messing with spell exclusions is rather tricky and annoying. I wish wish wish there were something like opcode 180 or opcode 319 for spells, but there is not. Kit exclusion flags are all we have to work with, so we cannot go as far as we would like with ideas like this one, for kits with restricted spell availability.

It can be done - I do it in two different ways. But you couldn't do it in ten different ways.

Edited by subtledoctor
Link to comment

EDIT again - sorry for the complications, but this reminded me that I need to change my mod and not use the Archer kit. (The same mod contains a component to move Archers to the fighter class, which means they could dual-class to mage, which means their wizard spells would be improperly restricted.) So I'll probably switch it to use the Inquisitor flag instead. So depending on the armor implications (do you expect your kit would dual-class to fighter and put on plate mail?) you could use the Archer or Stalker flags. Again depending on the armor implications, you could use the druid kit flags as well. (My mod uses this for a "bard" mage/thief kit, so I want it to be able to wear chain mail and missile weapons, which is why I expect to use the inquisitor flag.)

Edited by subtledoctor
Link to comment
2 hours ago, subtledoctor said:

On BG2EE v2.6 I changed the Abjurer unusability flag in kitlist.2da from 0x00000040 to 0x00000440 - combining the Abjurer and Illusionist bit values. Then I fired up a game and created an Abjurer. Unexpectedly:

  • I could learn Chill Touch and Larloch's Minor Drain at character generation
  • I could cast those spells in the game
  • After removing Chill Touch from my spellbook, I gave myself a copy of SCRL82.itm, and I could learn Chill Touch again.

You should be able to do the above with added kits just fine.

It's the 8 specialists, WildMage, and Barbarian however that have hardcoded KITLIST.2da data, IIRC only their last column is read in the EE, and only to determine which kit is actually applied.

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