Jump to content
Sign in to follow this  
Smoketest

Correct BG2 KIT.IDS

Recommended Posts

The modified version I posted was for testing with AddKit(), which I never got around to, so thanks Sim. :) I still use the word-sized values in my personal copy of KIT.IDS, although without the SPECIAL_CLASS entry.

 

It makes sense AddKit() won't work with those values, when it comes to barbarians and wildmagi, since those two kits expect values in the lower dword.

 

Igi, regardless of how many versions there are floating around, it'd be nice to have a corrected, tested standard posted in the IESDP for reference. Since the latest data posted by Sim has been tested and confirmed to work with Kit() and AddKit(), I think it's safe to say it's the most correct version for use in the game, and is superior to the completely nonfunctional current contents of IESDP. :)

Share this post


Link to post

Yep, I agree and if has tested it, and it works, it will be in the next update.

I just didnt see the point in posting an incorrect version instead of the default (incorrect) version.

Share this post


Link to post

Well, I've thrown together some standard code which we can hopefully all use to patch our IDSes. Admittedly it doesn't work yet because I can't seem to make REPLACE_TEXTUALLY work with regexps as it's suppose to, but the principle's correct...

 

COPY_EXISTING_REGEXP GLOB ~anomen.*cre~ ~override~
       ~imoen.*cre~ ~override~
       ~mazzy.*cre~ ~override~
READ_LONG 0x244 "current_kit_value"
SET "patched" = 0
WHILE (("%current_kit_value%" = 0x00000000) AND ("%patched%" = 0)) BEGIN
WRITE_LONG 0x244 0x40000000
SET "patched" = 1
END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~haer.*cre~ ~override~
READ_LONG 0x244 "current_kit_value"
SET "patched" = 0
WHILE (("%current_kit_value%" = 0x00000020) AND ("%patched%" = 0)) BEGIN
WRITE_LONG 0x244 0x400d0000
SET "patched" = 1
END
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~korgan.*cre~ ~override~
READ_LONG 0x244 "current_kit_value"
SET "patched" = 0
WHILE (("%current_kit_value%" = 0x00010000) AND ("%patched%" = 0)) BEGIN
WRITE_LONG 0x244 0x40010000
SET "patched" = 1
END
BUT_ONLY_IF_IT_CHANGES

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

APPEND ~kit.ids~ ~0x4000 TRUECLASS~
UNLESS ~TRUECLASS~
APPEND ~kit.ids~ ~0x0000 BARBARIAN~
UNLESS ~BARBARIAN~
APPEND ~kit.ids~ ~0x0000 WILDMAGE~
UNLESS ~WILDMAGE~

 

To make sure everything's fair, the coding should be credited to:

- SimDing0

- Smoketest

- Idobek

- Dyara

- CamDawg

- Littiz

- Ghreyfain

- Tomas

- TeamBG because THEY STARTED ALL MODDING BLAH BLAH BLAH

- Some other people

- The Umar Hills Chickens

Edited by SimDing0

Share this post


Link to post

Sim, there's no need to mock me with that, that was not the point and you know it.

You will see that I can live pretty well even with the methods of the jungle, from now on.

Lots of time spared, for sure :)

Share this post


Link to post

A couple of corrections to Sim's patching code--the regexps were just a bit loose so I addressed them. For example, a kit named DARKBLADE would be patched atm, whereas this should help get rid of that by requiring the kit names be preceded by a space or tab. :)

 

COPY_EXISTING_REGEXP GLOB ~anomen.*\.cre~ ~override~
      ~imoen.*cre~ ~override~
      ~mazzy.*cre~ ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00000000) BEGIN
   WRITE_LONG 0x244 0x40000000
 END
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~haer.*\.cre~ ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00000020) BEGIN
   WRITE_LONG 0x244 0x400d0000
 END
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~korgan.*\.cre~ ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00010000) BEGIN
   WRITE_LONG 0x244 0x40010000
 END
 BUT_ONLY_IF_IT_CHANGES

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

APPEND ~kit.ids~ ~0x4000 TRUECLASS~
UNLESS ~TRUECLASS~
APPEND ~kit.ids~ ~0x0000 BARBARIAN~
UNLESS ~BARBARIAN~
APPEND ~kit.ids~ ~0x0000 WILDMAGE~
UNLESS ~WILDMAGE~

Share this post


Link to post

Tightened up the REGEXPs as much as possible; this is confirmed as working with WeiDU v168.

 

COPY_EXISTING_REGEXP GLOB ~^anomen[0-9]*\.cre~ ~override~
                         ~^imoen[0-9]*\.cre~  ~override~
                         ~^mazzy[0-9]*\.cre~  ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00000000) BEGIN
   WRITE_LONG 0x244 0x40000000
 END
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^haer[0-9]*\.cre~ ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00000020) BEGIN
   WRITE_LONG 0x244 0x400d0000
 END
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^korgan[0-9]*\.cre~ ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00010000) BEGIN
   WRITE_LONG 0x244 0x40010000
 END
 BUT_ONLY_IF_IT_CHANGES

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~  ~0x0000 WILDMAGE~
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~

Share this post


Link to post
Guest your Name
COPY_EXISTING_REGEXP GLOB ~^anomen[0-9]*\.cre~ ~override~
                         ~^imoen[0-9]*\.cre~  ~override~
                         ~^mazzy[0-9]*\.cre~  ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00000000) BEGIN
   WRITE_LONG 0x244 0x40000000
 END
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^haer[0-9]*\.cre~ ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00000020) BEGIN
   WRITE_LONG 0x244 0x400d0000
 END
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING_REGEXP GLOB ~^korgan[0-9]*\.cre~ ~override~
 READ_LONG 0x244 "current_kit_value"
 PATCH_IF ("%current_kit_value%" = 0x00010000) BEGIN
   WRITE_LONG 0x244 0x40010000
 END
 BUT_ONLY_IF_IT_CHANGES

Meh... too much work.

COPY_EXISTING_REGEXP GLOB ~Anomen..?\.cre~ ~override~
                          ~Haer1.\.cre~ ~override~
                          ~Imoen..?\.cre~ ~override~
                          ~Korgan..?\.cre~ ~override~
                          ~Mazzy..?\.cre~ ~override~
 READ_LONG 0x0244 KIT_VALUE
 PATCH_IF (KIT_VALUE = 0x00) BEGIN
   WRITE_LONG 0x0244 0x40000000
 END
 PATCH_IF (KIT_VALUE = 0x20) BEGIN
   WRITE_LONG 0x0244 0x400d0000
 END
 PATCH_IF (KIT_VALUE = 0x010000) BEGIN
   WRITE_LONG 0x0244 0x40010000
 END
BUT_ONLY_IF_IT_CHANGES

I don't think '^' or '$' have any effect in WeiDU's regexp filename searches.

Share this post


Link to post
I don't think '^' or '$' have any effect in WeiDU's regexp filename searches.

 

Yes they do.

Share this post


Link to post
Guest Guest
Yes they do.

Ooh, you're right. It's been a long time since I've tried it...

 

Rather than "..?," that should be ".+" (if it works right, it won't match IMOEN.CRE like ".*" would).

Share this post


Link to post

Ok, so, if we're all done pointing to other versions, arguing about who made the wrong fix first, and posting random weidu tp2 scripts, then, I'll add this in the next update.

Ok?

Or does someone want to add anything else?

Gah.

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...