Jump to content

ADD_KIT and ToBEx


the bigg

Recommended Posts

Summary of the problem: without ToBEx, the game can only handle 256 kits. With ToBEx, the game can handle up to 1280 kits; this causes some problems that should actively be remedied by modders.

 

To prevent random game crashes when the number of kits overflows, ADD_KIT will now explicitly fail (with a message instructing people to install ToBEx) if there was an overflow.

 

Moreover, the traditional code to alter a creature's kit is now invalid, since it's using WRITE_BYTE when the kit number can be over 0xff.

Wrong code:

  WRITE_SHORT 0x244 0 // doesn't change
 WRITE_BYTE  0x246 ~%myKit%~ // the internal name of your kit, surrounded by %
 WRITE_BYTE  0x247 0x40 // doesn't change

 

Correct code:

  WRITE_SHORT 0x244 0 // doesn't change
 WRITE_SHORT 0x246 0x4000 + ~%myKit%~ // the internal name of your kit, surrounded by %

 

The ADD_KIT tutorial (here, on SHS, in the WeiDU readme, ...) should be amended to suggest the use of the latter code when altering a CRE's kit.

 

Moreover, to identify mods that use the wrong code, somebody with a collection of TP2/TPA/TPPs should grep those files for '0[Xx]244', '0[Xx]246', '580' and '582', filter out the false positives (which will probably outnumber the true positives), and report the code correction to the maintainer of the relevant mod.

Link to comment

Grep for

0[Xx]244

 

<<snip of obsolete data>>

 

If I understand correctly, READ_LONG 0x244 "current_kit_value" and WRITE_LONG 0x244 0x400d0000 (and similar) are fine, WRITE_SHORT 0x244 0 is fine too, and SAY 0x244 @29 references non-kit sources (areas and dialogs). So for an initial test pass before I update my major "ton o' mods all extracted into a big test directory" for this recheck, I see no reports needed from this particular list, right?

 

(I do understand that we are looking for stuff like SetupACBre_V4,

 

WRITE_SHORT 0x244 0

WRITE_BYTE 0x246 ~%ACSMITH1%~

WRITE_BYTE 0x247 0x40

 

to correct, just checking on the first part...)

Link to comment

The really suspicious target is 0x246, but it's better to also check 0x244 for mods that set the whole LONG in a single go in a wrong way (I doubt that'd be possible, but you never know). And yes, you're looking for stuff like the snippet you posted.

 

BTW: you should also grep tpa, tpp and tph files.

BTW 2: I've already fixed the stuff that falls under my jurisdiction (Refinements and WeiDU examples).

Link to comment
BTW: you should also grep tpa, tpp and tph files.

BTW 2: I've already fixed the stuff that falls under my jurisdiction (Refinements and WeiDU examples).

 

yep - your stuff you probably don't need reports on - I'll screen those out.

 

BTW: you should also grep tpa, tpp and tph files.

Got it - I have only got my ancient stuff on my local flash drive (weidu v215 is the clue there) and that one also has older legacy mods extracted along with newer versions (3 different chloe mods, for example).

 

I'll re-extract and rebuild the master search directory tonight, with the exception of mods that are stuck behind paywalls, and grep for those on .tp2, .tpa, .tpp, and .tph using only the latest available/newest update mods. The vast majority of these will be "no action", but where someone is adding a kit, suggest the following:

 

"Just a quick heads up - new changes in ToBEX and WeiDU have made it important to do a minor update on how kits get coded into your .cre files. The source thread is http://forums.gibberlings3.net/index.php?showtopic=21964 . For this mod,

 

ACBRE_43/Setup-ACBre_V4.tp2, line 160 - 162 inclusive:

WRITE_SHORT 0x244 0
WRITE_BYTE 0x246 ~%ACSMITH1%~
WRITE_BYTE 0x247 0x40

would become :

delete line 162, and replace lines 160 and 161 with

WRITE_SHORT 0x244 0 // doesn't change
WRITE_SHORT 0x246 0x4000 + ~%ACSMITH1%~

 

This will make sure that folks who install lots and lots of kits will not experience problems. Thanks!"

Link to comment

Oh, I am not poking at them or starting a fight, I just don't have updated copies. Seriously. I include The Grey Clan Episode 1 and ToD and lots of other BWL site mods, and I am not interested in conflict - I agree content is more important than interpersonal challenges... I just don't have access to the mods in question and won't pay to access them. The vast majority of BWL mods are available and testable, and are in there.

 

Honestly, I am fine with testing them and backing you up, but all I can do is test the older versions I have, not the new ones that I have to subscribe to a site in order to download.

 

If the modders in question are ok with sending me a (free) copy for testing/checking purposes, I'll add 'em into the mix, of course, but I am not going to provoke a flame war by downloading an "illegal" copy the modder does not want "leaked". I can even promise to delete the mods and not send them anywhere/upload them, etc.

 

On the diff reporting method, I will try to learn it - I keep seeing it, but have not kept the syntax in my memory.

Link to comment

BWL mods: I think (hope?) that only IA has a subscriber-only version. I'm certainly not going to advocate that you pay money to them and/or download 'illegal' copies (illegal being used in an extremely broad meaning of course).

 

Diff: WinMerge should be able to output correctly formatted diffs.

Link to comment

Almost done with mod prep. I'll toss the list of mods to search when I have it extracted so if I am missing something blindingly obvious someone can poke me.

 

This is just the latest versions that I have/could find and update, all dumped into a directory, and has already been partially culled (older versions, beta copies, unreleased stuff, etc.)

 

Edit: ok, list attached. filelist.txt

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...