Jump to content


Photo

Area CRE Checker


2 replies to this topic

#1 Miloch

Miloch

    Barbarian

  • Modder
  • 6058 posts

Posted 17 April 2011 - 04:50 PM

File Name: Area CRE Checker
File Submitter: Miloch
File Submitted: 18 Apr 2011
File Category: IE Modding Tools

Area CRE Checker v2 by Miloch
A utility for the Baldur's Gate II engine
http://www.shsforums.net/index.php

This is a small utility that scans all creature references in a particular area and its script. Its goal is to locate faulty creatures that can cause the game to crash. The main issues include:

- Creature does not exist
- Animation does not exist
- Animation is invalid
- Creature weapons cause animation glitches

The utility will output a list of creatures and animations to /areatest/arealog.txt for further analysis. A sample output from unmodded BG2's ar0406 (Copper Coronet) is:

File CRE Name Animation AnimName AnimType
ar0406.bcs escort1a Cominda nprohg1e.bam harlot_woman bg1_char_simple
ar0406.bcs escort2a Kerstia cifb1a6.bam fighter_female_halfling bg2_character
ar0406.bcs escort3a Jenthan chmb1a6.bam fighter_male_human bg2_character
ar0406.bcs copamb01 Gladiator chmb1a6.bam fighter_male_human bg2_character
ar0406.bcs copamb02 Copper Coronet Guard chmb1a6.bam cleric_male_human bg2_character
ar0406.bcs copamb03 Gladiator cemb1a6.bam fighter_male_elf bg2_character
ar0406.bcs copamb04 Gladiator cdmb1a6.bam fighter_male_dwarf bg2_character
ar0406.bcs copamb05 Copper Coronet Guard chmb1a6.bam cleric_male_human bg2_character
ar0406.bcs doug Festule the Alchemist cemb1a6.bam thief_male_elf bg2_character
ar0406.bcs bunkin Bunkin chfb1a6.bam fighter_female_halforc bg2_character
ar0406.bcs gorf Gorf the Squisher moghg1e.bam half_ogre bg1_monster
ar0406.bcs ccguard1 Copper Coronet Guard chmb1a6.bam cleric_male_human bg2_character
ar0406.bcs ccguard2 Copper Coronet Guard chmb1a6.bam fighter_male_human bg2_character
ar0406.are lehtin Lehtinan chmb1a6.bam fighter_male_human bg2_character
ar0406.are surly Surly chmb1a6.bam fighter_male_halforc bg2_character
ar0406.are wench1 Tavern Wench nprohg1e.bam harlot_woman bg1_char_simple
ar0406.are ruffian Amalas chmb1a6.bam fighter_male_human bg2_character
ar0406.are rufpal1 Ruffian chmb1a6.bam fighter_male_human bg2_character

The utility also generates a test area and script that will automatically spawn each creature to see which (if any) causes an issue. This saves you from having to go through the list and spawn each creature manually, as you can simply MoveToArea("t-test") from the in-game console.

Usage:
1. Consult bg1aref.htm or bg2aref.htm in the areatest folder to look up your area code (or use the IESDP)
2. Double-click on setup-areatest.exe in your game folder and input the area code when prompted
3. View the output of areatest/arealog.txt
4. If no issues are apparent in arealog.txt (such as UNKNOWN_CRE or UNKNOWN_BAM), start or load a game
5. In the game, select only your main character (not other party members)
6. Press Ctrl+Space to open a console window and type: MoveToArea("t-test")
7. Wait while the test area script spawns and purges each creature
8. Wait until you see either "Done and done!" or you get a freeze/crash (CTD)
9. If you encounter a crash or freeze, note the last creature the script was attempting to spawn
10. Open a command prompt to your game folder (Start > Run > cmd)*
11. Type: cd C:\Games\BG2 (substituting the path for where your game is installed)
12. Type: weidu --change-log crefile.cre --out crefile.txt (where crefile is the CRE that caused a crash)
13. Type: weidu --change-log anim.bam --out anim.txt (where anim is the Animation from arealog.txt)
14. Report the issue in the proper forum for the mod (output by the change-log) if relevant

* As an alternative, you can use the change-log utility (see http://www.shsforums...or-the-megamods).

The full IESDP is available at http://iesdp.gibberlings3.net/.

Version History:

Version 2: 17 Apr 2011
- Enhanced CRE listing (mod CREs first)
- Added animation info to arealog.txt
- Added test script to loop through spawning all creatures
- Added readme

Version 1: 18 Feb 2011
- Initial release

Click here to download this file
Mod Contributions
Aurora * BG1 NPC * Gnomes * Haiass * Infinity Animations * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"As the body itself is slow to grow and quick to decay, so also it is easier to damp men's spirits and their enthusiasm than to revive them..."
-Cornelius Tacitus, Agricola

#2 Chevalier

Chevalier

    Knight of the Realms

  • Modder
  • 2303 posts

Posted 18 April 2011 - 12:53 AM

Great tool!!!!! Thanks!
I Ride for the King!


a.k.a. Chev

#3 cmorgan

cmorgan
  • Staff
  • 2244 posts

Posted 18 April 2011 - 04:56 AM

Very much appreciated - I think I need to steal the idea and create a companion to this that lets people test cutscenes and the like!



Reply to this topic