Jump to content

Inconsistent files, and the fix


Recommended Posts

Hi all,


I've downloaded the newest BG1NPC package v11. The PDF romance guide is beautiful, and the whole project seems to be a nice work, a real fruit of community effort.


I started checking value consistency in files, and encountered strRef issues in CRE soundslots, so I decided to take a closer and more detailed look at them.


BG1NPC\Creatures (463 issues)

BG1NPC\AJROM\Creatures (no issues, OK)

BG1NPC\Challenges\Chal_Creatures (185 issues)

BG1NPC\DYROM\CRE (519 issues)

BG1NPC\Phase2\CRE (888 issues)


The strRef problems are not serious. Simply, most strRefs that are intended to be -1 are (2^31)-1 instead. Though 1179023408 also occurs sometimes, probably due to a similar number representation/conversion issue. I guess the strRefs in these files were "blanked" by WeiDU SAY #-1 (I've just reported its bug in WeiDU forum, and The_Bigg said it must due to ocaml 31-bit integers remaining in weidu code), or for some similar reason.


As I thought it is faster than writing a TP2 with COPY_EXISTING_REGEXP and BNOT 0x0 lines, I've made a simple tool for you which can fix these strRefs. I tested it and it works properly.

I cannot add posts attachments in this forum, so I uploaded it here.

To use it, you've to copy & run it in the folder where the CRE files are located. By default, it does not fix anything, just reports strRefs. If you uncheck the "Report only" checkbox, it will also correct the strRefs. The default setting is that it considers every strRef greater than 500 000 as invalid, and replaces it with -1. Since the incorrect values are all much greater than 500k, this configuration works perfectly with the mentioned BG1NPC files.

Link to comment

Thank you! This is truly appreciated.


On investigation, I loaded a set of regular Tutu (well, actually EasyTutu files) into various editors, and forund that ALL of Tutu's cre's have this difficulty after the conversion process. Tutu must create this problem on the actual conversion;


any string that should be -1 is actually (2^31)-1



I will draw Macready's attention to this; it may make no functional difference in-game, but I find it extremely annoying to have to cycle through large numbers of error pop-up screens in DLTCEP (and screen out error messages in other editor logs/reports).


Thank you!

Link to comment

So it's related to (Easy)Tutu. This is only a "cosmetic" problem, but as you've said, it gives warning messages to modders (especially because DLTCEP arbitrarily accepts no greater strRefs than 10^6), so it's good that Macready will know about it.


Glad I could contribute at least in such a minor issue. (If I had the time, I would do some actual mod testing as well.) It's actually your achievement cmorgan, because I noticed the unusual numbers in a report you've sent me while helping me to test an IE-modding related program of mine. Without that report, we couldn't have found this.

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...