Jump to content


Photo

[COMPLETE] Kit() Trigger Fix


  • Please log in to reply
4 replies to this topic

#1 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 12 January 2011 - 12:21 AM

Original description of problem

Apparently, the engine's *Kit() actions only read kit as a word (2-byte) value on .cre files, when it is really a dword (4-byte) value. Actually, it's only the upper half of the dword or something, not a proper word. This leads to glitches - one noted being barbarian, wildmage and in some cases, no kit or trueclass all get interpreted as "0" thus there's no way to distinguish amongst them. Is it fixable (without breaking existing behaviour, when it works)?


The coding can easily be changed to check the entire DWORD. I don't think that will break stuff, because KIT.IDS appears to be unused by the game anyway except for use by the script compiler outside the game (and it was noted that it listed the unusability flags as opposed to actual kit ID). As a result, 0x40000000 would be BARBARIAN, and 0x80000000 would be WILDMAGE.

Isn't no kit (0) distinguishable from TRUECLASS (0x4000)? The only difference here seems to be that unkitted CRE files use NO_KIT whereas chargen'd characters use TRUECLASS.

For reference, if I the kit is stored as 0x12345678 in the CRE file, the kit is read as 0x34127856 (account for big endian, and then high WORD-low WORD).

Edited by Ascension64, 19 January 2011 - 04:04 AM.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#2 the bigg

the bigg

    2083 is a prime number.

  • Modder
  • 3331 posts

Posted 12 January 2011 - 05:55 AM

I'd keep NO_KIT distinguished from TRUECLASS for the sake of consistency (although I don't think any CRE would have reason to use NO_KIT).

Also, I'd be happy to help you test this particular fix once you've developed it.

Edited by the bigg, 12 January 2011 - 06:13 AM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.


#3 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 15 January 2011 - 01:22 AM

Sure, you can test it when QUICK_MENU makes public.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#4 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 15 January 2011 - 06:55 AM

I think what you just indicated is that the game engine has always detected the WildMage and Barbarian, etc. correctly for vanilla distributed .bcs files, but that anyone adding compiling .baf (and decompiling for viewing) has had this error -

so if a user has ToBEX installed before my mod is installed, I could then finally write for and detect successfully (and compile into the game) dialog and scripts that are specific to these kits.

If i have this correct, what is the best way to detect whether this particular ToBEX fix is installed, so that I can leverage this?

#5 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 15 January 2011 - 02:04 PM

I think what you just indicated is that the game engine has always detected the WildMage and Barbarian, etc. correctly for vanilla distributed .bcs files, but that anyone adding compiling .baf (and decompiling for viewing) has had this error -

I don't think vanilla-distributed BCS files ever detected these correctly unless they used some trigger other than Kit(), since Kit() only checks the low WORD.

what is the best way to detect whether this particular ToBEX fix is installed, so that I can leverage this?

The config component number is DESIGNATED 750, if that helps. TobEx should be installed before your mod.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)