Jump to content

You crap around the kit.ids file without knowing what the hell you are doing.


Recommended Posts

ALWAYS
...
INCLUDE ~NPCKit/lib/always.tpa~

// if no fixpack, and if this hasn't been installed already
ACTION_IF ((NOT FILE_EXISTS_IN_GAME ~cddetevl.pro~) AND (NOT FILE_EXISTS_IN_GAME ~iknk0000.g3~)) THEN BEGIN

  // dummy file to allow for detection
  COPY_EXISTING ~sw1h01.itm~ ~override/iknk0000.g3~
  
  // fixing kit.ids; creature corrections are down in the creature section
  COPY_EXISTING ~kit.ids~ ~override~
    REPLACE_TEXTUALLY ~.*\bTRUECLASS\b~              ~0x4000 TRUECLASS~
    REPLACE_TEXTUALLY ~.*\bBERSERKER\b~              ~0x4001 BERSERKER~
    REPLACE_TEXTUALLY ~.*\bWIZARDSLAYER\b~           ~0x4002 WIZARDSLAYER~
    REPLACE_TEXTUALLY ~.*\bKENSAI\b~                 ~0x4003 KENSAI~
    REPLACE_TEXTUALLY ~.*\bCAVALIER\b~               ~0x4004 CAVALIER~
    REPLACE_TEXTUALLY ~.*\bINQUISITOR\b~             ~0x4005 INQUISITOR~
    REPLACE_TEXTUALLY ~.*\bUNDEADHUNTER\b~           ~0x4006 UNDEADHUNTER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_ABJURER\b~     ~0x0040 MAGESCHOOL_ABJURER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_CONJURER\b~    ~0x0080 MAGESCHOOL_CONJURER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_DIVINER\b~     ~0x0100 MAGESCHOOL_DIVINER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_ENCHANTER\b~   ~0x0200 MAGESCHOOL_ENCHANTER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_ILLUSIONIST\b~ ~0x0400 MAGESCHOOL_ILLUSIONIST~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_INVOKER\b~     ~0x0800 MAGESCHOOL_INVOKER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_NECROMANCER\b~ ~0x1000 MAGESCHOOL_NECROMANCER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_TRANSMUTER\b~  ~0x2000 MAGESCHOOL_TRANSMUTER~
    REPLACE_TEXTUALLY ~.*\bMAGESCHOOL_GENERALIST\b~  ~0x4000 MAGESCHOOL_GENERALIST~
    REPLACE_TEXTUALLY ~.*\bFERALAN\b~                ~0x4007 FERALAN~
    REPLACE_TEXTUALLY ~.*\bSTALKER\b~                ~0x4008 STALKER~
    REPLACE_TEXTUALLY ~.*\bBEASTMASTER\b~            ~0x4009 BEASTMASTER~
    REPLACE_TEXTUALLY ~.*\bASSASIN\b~                ~0x400A ASSASIN~
    REPLACE_TEXTUALLY ~.*\bBOUNTYHUNTER\b~           ~0x400B BOUNTYHUNTER~
    REPLACE_TEXTUALLY ~.*\bSWASHBUCKLER\b~           ~0x400C SWASHBUCKLER~
    REPLACE_TEXTUALLY ~.*\bBLADE\b~                  ~0x400D BLADE~
    REPLACE_TEXTUALLY ~.*\bJESTER\b~                 ~0x400E JESTER~
    REPLACE_TEXTUALLY ~.*\bSKALD\b~                  ~0x400F SKALD~
    REPLACE_TEXTUALLY ~.*\bGODTALOS\b~               ~0x4013 GODTALOS~
    REPLACE_TEXTUALLY ~.*\bGODHELM\b~                ~0x4014 GODHELM~
    REPLACE_TEXTUALLY ~.*\bGODLATHANDER\b~           ~0x4015 GODLATHANDER~
    REPLACE_TEXTUALLY ~.*\bTOTEMIC\b~                ~0x4010 TOTEMIC~
    REPLACE_TEXTUALLY ~.*\bSHAPESHIFTER\b~           ~0x4011 SHAPESHIFTER~
    REPLACE_TEXTUALLY ~.*\bBEASTFRIEND\b~            ~0x4012 BEASTFRIEND~
    REPLACE_TEXTUALLY ~.*\bBARBARIAN\b~              ~0x0000 BARBARIAN~
    REPLACE_TEXTUALLY ~.*\bWILDMAGE\b~               ~0x0000 WILDMAGE~
    BUT_ONLY_IF_IT_CHANGES
  
  APPEND ~kit.ids~ ~0x4000 TRUECLASS~
    UNLESS ~\bTRUECLASS\b~
  APPEND ~kit.ids~ ~0x0000 BARBARIAN~
    UNLESS ~\bBARBARIAN\b~
  APPEND ~kit.ids~ ~0x0000 WILDMAGE~
    UNLESS ~\bWILDMAGE\b~

That's a humongous mistake:

Here's a fairly much better solution for this fuckup, that doesn't rely on the fact that the BG2Fixpack needs to be installed or you could throw the whole thing to the river:

COPY_EXISTING ~kit.ids~ ~override~ 
/* snip */
  REPLACE_TEXTUALLY ~0x0000 BARBARIAN~			  ~0x40000000 BARBARIAN~
  REPLACE_TEXTUALLY ~0x0000 WILDMAGE~			   ~0x80000000 WILDMAGE~
BUT_ONLY

CLEAR_INLINED

APPEND ~kit.ids~ ~0x4000 TRUECLASS~ UNLESS ~\bTRUECLASS\b~
APPEND ~kit.ids~ ~0x40000000 BARBARIAN~ UNLESS ~\bBARBARIAN\b~
APPEND ~kit.ids~ ~0x80000000 WILDMAGE~ UNLESS ~\bWILDMAGE\b~

Why, cause if you install this in EE games, nothing is done, if you install it in BG2, the Barbarian and Wildmages now actually have a unique .ids number. Even if the game can't detect the long variable without the ToBEx, installing that will allow it to, and if it's not, the kit.ids is 0x0000 by default.

 

You have no idea what for example the next line does to a kit named "blademaster"

REPLACE_TEXTUALLY ~.*\bBLADE\b~ ~0x400D BLADE~

So instead of that, you really have to read the whole line you intent to replace, and use the same values as those in BG2EE if it goes to that.

 

Time to get to this century, and not copy coding from old mods that have been updated years ago.

Edited by Jarno Mikkola
Link to comment

Eh, that's just how Jarno talks. He doesn't mean any harm.

 

The bigger issue is that there IS a bug in this mod, in an ALWAYS block, and lots of people use this mod, and the bug can cause problems that will be very hard to track down to this source. And there are other bugs, and the mod author is not around to fix any of them. I caught a few - stuff that was blamed on my mod, and I tracked the bugs down to this one. And then I wrote a hotfix here and posted it in the forum... but no one has bothered to update the main download with my fix.

 

*Someone* ought to take ownership of this and fix it up... unfortunately I don't have the time to do it.

Link to comment

Here's what Wisp had to eventually say about this towards the BWS makers(as a fix for all of the mods that try to do things to the kit.ids):

 

 

COPY_EXISTING ~kit.ids~ ~override~
REPLACE_TEXTUALLY ~.*[ %TAB%]TRUECLASS[ %TAB%]*~              ~0x4000 TRUECLASS~
REPLACE_TEXTUALLY ~.*[ %TAB%]BERSERKER[ %TAB%]*~              ~0x4001 BERSERKER~
REPLACE_TEXTUALLY ~.*[ %TAB%]WIZARDSLAYER[ %TAB%]*~           ~0x4002 WIZARDSLAYER~
REPLACE_TEXTUALLY ~.*[ %TAB%]KENSAI[ %TAB%]*~                 ~0x4003 KENSAI~
REPLACE_TEXTUALLY ~.*[ %TAB%]CAVALIER[ %TAB%]*~               ~0x4004 CAVALIER~
REPLACE_TEXTUALLY ~.*[ %TAB%]INQUISITOR[ %TAB%]*~             ~0x4005 INQUISITOR~
REPLACE_TEXTUALLY ~.*[ %TAB%]UNDEADHUNTER[ %TAB%]*~           ~0x4006 UNDEADHUNTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_ABJURER[ %TAB%]*~     ~0x0040 MAGESCHOOL_ABJURER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_CONJURER[ %TAB%]*~    ~0x0080 MAGESCHOOL_CONJURER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_DIVINER[ %TAB%]*~     ~0x0100 MAGESCHOOL_DIVINER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_ENCHANTER[ %TAB%]*~   ~0x0200 MAGESCHOOL_ENCHANTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_ILLUSIONIST[ %TAB%]*~ ~0x0400 MAGESCHOOL_ILLUSIONIST~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_INVOKER[ %TAB%]*~     ~0x0800 MAGESCHOOL_INVOKER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_NECROMANCER[ %TAB%]*~ ~0x1000 MAGESCHOOL_NECROMANCER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_TRANSMUTER[ %TAB%]*~  ~0x2000 MAGESCHOOL_TRANSMUTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_GENERALIST[ %TAB%]*~  ~0x4000 MAGESCHOOL_GENERALIST~
REPLACE_TEXTUALLY ~.*[ %TAB%]FERALAN[ %TAB%]*~                ~0x4007 FERALAN~
REPLACE_TEXTUALLY ~.*[ %TAB%]STALKER[ %TAB%]*~                ~0x4008 STALKER~
REPLACE_TEXTUALLY ~.*[ %TAB%]BEASTMASTER[ %TAB%]*~            ~0x4009 BEASTMASTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]ASSASIN[ %TAB%]*~                ~0x400A ASSASIN~
REPLACE_TEXTUALLY ~.*[ %TAB%]BOUNTYHUNTER[ %TAB%]*~           ~0x400B BOUNTYHUNTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]SWASHBUCKLER[ %TAB%]*~           ~0x400C SWASHBUCKLER~
REPLACE_TEXTUALLY ~.*[ %TAB%]BLADE[ %TAB%]*~                  ~0x400D BLADE~
REPLACE_TEXTUALLY ~.*[ %TAB%]JESTER[ %TAB%]*~                 ~0x400E JESTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]SKALD[ %TAB%]*~                  ~0x400F SKALD~
REPLACE_TEXTUALLY ~.*[ %TAB%]GODTALOS[ %TAB%]*~               ~0x4013 GODTALOS~
REPLACE_TEXTUALLY ~.*[ %TAB%]GODHELM[ %TAB%]*~                ~0x4014 GODHELM~
REPLACE_TEXTUALLY ~.*[ %TAB%]GODLATHANDER[ %TAB%]*~           ~0x4015 GODLATHANDER~
REPLACE_TEXTUALLY ~.*[ %TAB%]TOTEMIC[ %TAB%]*~                ~0x4010 TOTEMIC~
REPLACE_TEXTUALLY ~.*[ %TAB%]SHAPESHIFTER[ %TAB%]*~           ~0x4011 SHAPESHIFTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]BEASTFRIEND[ %TAB%]*~            ~0x4012 BEASTFRIEND~
REPLACE_TEXTUALLY ~.*[ %TAB%]BARBARIAN[ %TAB%]*~              ~0x40000000 BARBARIAN~
REPLACE_TEXTUALLY ~.*[ %TAB%]WILDMAGE[ %TAB%]*~               ~0x80000000 WILDMAGE~
BUT_ONLY

APPEND ~kit.ids~ ~0x4000 TRUECLASS~ UNLESS ~[ %TAB%]TRUECLASS[ %TAB%]*~
APPEND ~kit.ids~ ~0x40000000 BARBARIAN~ UNLESS ~[ %TAB%]BARBARIAN[ %TAB%]*~
APPEND ~kit.ids~ ~0x80000000 WILDMAGE~ UNLESS ~[ %TAB%]WILDMAGE[ %TAB%]*~
Also there probably should be a restrictive element to the code, something that checks if the 0x4000 - 0x4012 .ids'es are not in use already.

And if you can't see where this problem comes from, it's the fact that the original code is from BG2Fixpack, but as that's included in the EE games conceptually at least without the check files, the NOT FILE_EXISTS_IN_GAME won't find the clues that it could be fixed already, or worse, it can break things. Why's that important, because the principle that the Fixpack should be installed at the top(with the only exception being the ToBEx) of the install order can excuse the G3 Fixpack's action, but no one else's. Like mods that add existing/added kits to NPCs. Aka you can't break other peoples kits just cause you wish to try to fix the existing .. that might not even need it.

Edited by Jarno Mikkola
Link to comment

Here's what Wisp had to eventually say about this towards the BWS makers(as a fix for all of the mods that try to do things to the kit.ids):

 

 

COPY_EXISTING ~kit.ids~ ~override~
REPLACE_TEXTUALLY ~.*[ %TAB%]TRUECLASS[ %TAB%]*~              ~0x4000 TRUECLASS~
REPLACE_TEXTUALLY ~.*[ %TAB%]BERSERKER[ %TAB%]*~              ~0x4001 BERSERKER~
REPLACE_TEXTUALLY ~.*[ %TAB%]WIZARDSLAYER[ %TAB%]*~           ~0x4002 WIZARDSLAYER~
REPLACE_TEXTUALLY ~.*[ %TAB%]KENSAI[ %TAB%]*~                 ~0x4003 KENSAI~
REPLACE_TEXTUALLY ~.*[ %TAB%]CAVALIER[ %TAB%]*~               ~0x4004 CAVALIER~
REPLACE_TEXTUALLY ~.*[ %TAB%]INQUISITOR[ %TAB%]*~             ~0x4005 INQUISITOR~
REPLACE_TEXTUALLY ~.*[ %TAB%]UNDEADHUNTER[ %TAB%]*~           ~0x4006 UNDEADHUNTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_ABJURER[ %TAB%]*~     ~0x0040 MAGESCHOOL_ABJURER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_CONJURER[ %TAB%]*~    ~0x0080 MAGESCHOOL_CONJURER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_DIVINER[ %TAB%]*~     ~0x0100 MAGESCHOOL_DIVINER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_ENCHANTER[ %TAB%]*~   ~0x0200 MAGESCHOOL_ENCHANTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_ILLUSIONIST[ %TAB%]*~ ~0x0400 MAGESCHOOL_ILLUSIONIST~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_INVOKER[ %TAB%]*~     ~0x0800 MAGESCHOOL_INVOKER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_NECROMANCER[ %TAB%]*~ ~0x1000 MAGESCHOOL_NECROMANCER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_TRANSMUTER[ %TAB%]*~  ~0x2000 MAGESCHOOL_TRANSMUTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]MAGESCHOOL_GENERALIST[ %TAB%]*~  ~0x4000 MAGESCHOOL_GENERALIST~
REPLACE_TEXTUALLY ~.*[ %TAB%]FERALAN[ %TAB%]*~                ~0x4007 FERALAN~
REPLACE_TEXTUALLY ~.*[ %TAB%]STALKER[ %TAB%]*~                ~0x4008 STALKER~
REPLACE_TEXTUALLY ~.*[ %TAB%]BEASTMASTER[ %TAB%]*~            ~0x4009 BEASTMASTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]ASSASIN[ %TAB%]*~                ~0x400A ASSASIN~
REPLACE_TEXTUALLY ~.*[ %TAB%]BOUNTYHUNTER[ %TAB%]*~           ~0x400B BOUNTYHUNTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]SWASHBUCKLER[ %TAB%]*~           ~0x400C SWASHBUCKLER~
REPLACE_TEXTUALLY ~.*[ %TAB%]BLADE[ %TAB%]*~                  ~0x400D BLADE~
REPLACE_TEXTUALLY ~.*[ %TAB%]JESTER[ %TAB%]*~                 ~0x400E JESTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]SKALD[ %TAB%]*~                  ~0x400F SKALD~
REPLACE_TEXTUALLY ~.*[ %TAB%]GODTALOS[ %TAB%]*~               ~0x4013 GODTALOS~
REPLACE_TEXTUALLY ~.*[ %TAB%]GODHELM[ %TAB%]*~                ~0x4014 GODHELM~
REPLACE_TEXTUALLY ~.*[ %TAB%]GODLATHANDER[ %TAB%]*~           ~0x4015 GODLATHANDER~
REPLACE_TEXTUALLY ~.*[ %TAB%]TOTEMIC[ %TAB%]*~                ~0x4010 TOTEMIC~
REPLACE_TEXTUALLY ~.*[ %TAB%]SHAPESHIFTER[ %TAB%]*~           ~0x4011 SHAPESHIFTER~
REPLACE_TEXTUALLY ~.*[ %TAB%]BEASTFRIEND[ %TAB%]*~            ~0x4012 BEASTFRIEND~
REPLACE_TEXTUALLY ~.*[ %TAB%]BARBARIAN[ %TAB%]*~              ~0x40000000 BARBARIAN~
REPLACE_TEXTUALLY ~.*[ %TAB%]WILDMAGE[ %TAB%]*~               ~0x80000000 WILDMAGE~
BUT_ONLY

APPEND ~kit.ids~ ~0x4000 TRUECLASS~ UNLESS ~[ %TAB%]TRUECLASS[ %TAB%]*~
APPEND ~kit.ids~ ~0x40000000 BARBARIAN~ UNLESS ~[ %TAB%]BARBARIAN[ %TAB%]*~
APPEND ~kit.ids~ ~0x80000000 WILDMAGE~ UNLESS ~[ %TAB%]WILDMAGE[ %TAB%]*~
Also there probably should be a restrictive element to the code, something that checks if the 0x4000 - 0x4012 .ids'es are not in use already.

And if you can't see where this problem comes from, it's the fact that the original code is from BG2Fixpack, but as that's included in the EE games conceptually at least without the check files, the NOT FILE_EXISTS_IN_GAME won't find the clues that it could be fixed already, or worse, it can break things. Why's that important, because the principle that the Fixpack should be installed at the top(with the only exception being the ToBEx) of the install order can excuse the G3 Fixpack's action, but no one else's. Like mods that add existing/added kits to NPCs. Aka you can't break other peoples kits just cause you wish to try to fix the existing .. that might not even need it.

 

The problem with this code is that is is everywhere...copied and copied and copied by kit-mod makers again and again.

As documented here http://www.shsforums.net/topic/56960-bgtee/page-6?do=findComment&comment=584660 it even comes up once again in brandnew EET.

Edited by Roxanne
Link to comment

The problem with this code is that is is everywhere...

Yeah, but the intention is, that if we fix it to be the above, and not the one in the original, it will be applied correctly and the whole problem is solved. Well, unless one cheeses it up by a new mod that uses the old code.

 

This is to say that even when we know that problem and we can fix it, it shouldn't be our job alone... so it would be preferable to fix this in the mod itself, and not in the BWP Fixpack, even when it already there today.

Edited by Jarno Mikkola
Link to comment

The post immediately after that one says that one of the other NPC Kitpack components still fails to install on EE, so I guess your patch is just for the Specialist Mage Descriptions component?

 

Edit: It turns out the BWP Fixpack includes the same code changes that you made for the specialist mage descriptions component, except the BWP Fixpack also uses BUT_ONLY_IF_IT_CHANGES.

Edited by agb1
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...