BG2 Creature Inventory Checker

Version 1 - Check for the most recent version

Overview

This utility was something I developed while working on the BG2 Fixpack. Near Infinity has some excellent debugging tools which were used as a first pass in corrections to creature files. However, after running (and correcting) the couple hundred errors that turned up, I found there was no tool for finding, say, creatures with a weapon in their weapon slot but not equipped, or a creature with armor in a shield slot, and a number of other miscellaneous errors I wanted to correct.

Installation

Windows
The BG2 Creature Inventory Checker is packaged and installed with WeiDU and is distributed as a self-extracting archive. To install, simply double-click the archive and follow the instructions on screen.

Alternatively the files can be extracted from the archive using WinRAR. If properly extracted, you should have a BG2_Creature_Inventory_Checker folder and Setup-BG2_Creature_Inventory_Checker.exe in your BG2 folder.

To use this utility, run Setup-BG2_Creature_Inventory_Checker.exe in your BG2 folder. The utility will search through all creature files present in the game and report errors to the DEBUG file.

Mac OS X
If the mod was previously installed, uninstall it before extracting the new version. The BG2 Creature Inventory Checker is packaged and installed with WeiDU. To install, simply extract the contents of the mod into your BG2 folder.  If properly extracted, you should have a BG2_Creature_Inventory_Checker folder, Setup-BG2_Creature_Inventory_Checker, and Setup-BG2_Creature_Inventory_Checker.command in your BG2 folder.

To use this utility, run Setup-BG2_Creature_Inventory_Checker.exe in your BG2 folder. The utility will search through all creature files present in the game and report errors to the DEBUG file.

Contents

The BG2 Creature Inventory Checker is a WeiDU mod, in a sense. The uility uses WeiDU to search and run checks against creature files, but does not leave a weidu.log entry so it can be run multiple times without interfering with mods. The utility uses a series of PATCH_PRINT commands to report errors. These reports will appear in the installation window, but will be too fast to be caught by the eye. Fortunately, they're logged in the DEBUG file.

Note: The utility works by searching through the resources in a creature's inventory by loading up the referenced items and performing automated checks on the item files. As a result, if the item reference is incorrect and the item does not exist, the utility will fail and exit with an error message. It is recommended that you run Near Infinity's "Find Illegal ResourceRefs..." (under Tools) on creature files and correct any mistakes there before proceeding with this tool. Random treasure items (rndtre01, rndtre02, etc.) are ignored by this utility and will not cause the program to halt.

The error messages are all prefixed with ItemErr: to allow for easy searching within the DEBUG file.

ItemErr: Bow with no arrows; ItemErr: Sling with no bullets; ItemErr: Crossbow with no bolts

These errors are all caused by a similar issue: the creature has a launcher in its weapon slot, but lacks the requisite ammunition in the quiver slots.

ItemErr: Arrows with no bow; ItemErr: Bullets with no sling; ItemErr: Bolts with no crossbow

Similar to the previous errors, but in this case the creature has ammunition in its quiver slots but no weapon with which to use it.

ItemErr: Invalid Helm; ItemErr: Invalid Armor; ItemErr: Invalid Amulet; ItemErr: Invalid Ring; ItemErr: Invalid Cloak; ItemErr: Invalid Gloves

All of these errors are caused by having an invalid item equipped. For example, if a creature has an item not of the type armor (2) in its armor, this error will be reported. Many of the rings and amulet errors will be spurious, as BioWare tended to use these slots for special items that give creature immunities and other special abilities for their creature type. As many of these items are not flagged with proper item types you will see a number of errors.

ItemErr: Invalid Weapon

You will see this error if the creature has an item in its weapon slot that does not have a melee (1), ranged (2), or launcher (4) ability. Originally, this was only a check against item type, but there were a number of spurious errors resported as many of the creature paws (such as b1-8.itm) are of the type Miscellaneous (0).

ItemErr: Invalid offhand

This error is caused by having an item in the offhand/shield slot that is not a one-handed weapon or a shield. The offhand weapon must be melee-only (ranged weapons are not allowed offhand) and not flagged as two-handed.

ItemErr: Invalid quiver

This error is generated by an item in the quiver slot that is not arrows, bullets, or bolts.

ItemErr: Invalid weapon equipped

The utility will perform a compare against the equipped weapon value and the weapon slots. This error is reported if there is 1) a valid weapon available and 2) either no weapon selected or the selected slot has no valid weapon. So if a creature has weapon slot 1 set as equipped but has no weapons at all, this error will not be generated as condition #1 is not satisfied.

ItemErr: Two-handed weapon and offhand item

This error is triggered by one of the weapons in the weapon slots being flagged as two-handed while the offhand/shield slot is filled. This would cause a hard crash in BG2 if such a creature were encountered.

ItemErr: Possible equippable item in inventory

The utility is also looking for items that were possibly meant to be assigned. As such, it performs a check in a creature inventory for armor, shields, helms, etc. to see if an item could be equipped rather than left in inventory.

Contact Information

Thanks and Acknowledgements

This utility would not be possible without the research effort that is the IESDP and tools such as Near Infinity. Thanks to the still active and vibrant Infinity Engine modding community.

Tools Used in Creation
WeiDU by Wes Weimer
Near Infinity by Jon Olav Hauglid
IESDP maintained by igi

Credits and Copyright Information

This utility may not be sold, published, compiled or redistributed in any form without the consent of its author. BG2 Creature Inventory Checker is ©2006 "Cam" Camagna.

Version History

Version 1 - January 22, 2006