Jump to content

Where can I find BG2 chitin.key on the CDs?


Recommended Posts

Hello everyone,

I'm new here so let me know if this is not the right place for this!

I'm writing a script to export BG2 maps to other formats such as PNG, JSON etc (for my web-based client). I would like it to work directly from the game CDs so I don't depend on other tools (I otherwise used DLTCEP for that).

Reading BIF files is fine, however, it looks like I need a KEY file to map the "resource locator" values to proper file names. I believe this is the famous "chitin.key". Is that correct?

If yes, where can I find this file on the installation CDs?

Link to comment
INFO: Signature: b'KEY ', Version: b'V1  ', BIF count: 128, Resource count: 35200, BIF entries offset: 24, Resource entries offset: 3834
INFO: BIF Entry 0/128: Length: 5847739, Filename: data\Default.bif, Location Flags: 1, CD number: 1, In cache: False, In data: False
INFO: BIF Entry 1/128: Length: 659688, Filename: data\Items.bif, Location Flags: 1, CD number: 1, In cache: False, In data: False
INFO: BIF Entry 2/128: Length: 26137603, Filename: data\OBJAnim.bif, Location Flags: 1, CD number: 1, In cache: False, In data: False
INFO: BIF Entry 3/128: Length: 150408, Filename: data\Effects.bif, Location Flags: 1, CD number: 1, In cache: False, In data: False
INFO: BIF Entry 4/128: Length: 94931128, Filename: data\CHAAnim.bif, Location Flags: 1, CD number: 1, In cache: False, In data: False
INFO: BIF Entry 5/128: Length: 35328021, Filename: data\CREAnim.bif, Location Flags: 57, CD number: 1, In cache: False, In data: False
INFO: BIF Entry 6/128: Length: 13746432, Filename: data\Portrait.bif, Location Flags: 1, CD number: 1, In cache: False, In data: False
...
INFO: Resource Entry 35197/35200: Resource Name: FESTH04, Resource Type: .wav, Resource Locator: 133169337
INFO: Resource Entry 35198/35200: Resource Name: FESTH05, Resource Type: .wav, Resource Locator: 133169338
INFO: Resource Entry 35199/35200: Resource Name: FESTH06, Resource Type: .wav, Resource Locator: 133169339

Ok this looks good! I guess I just map all resources from their "resource locator" value to their name in the Chitin.key file, right? is their a single key file or do i need to concatenate this with other files?

Link to comment

You do realize you're reinventing the wheel, right? With unshield you can fake a full install and then use existing tools to extract files from BIFs, script the conversion of TIS/MOS/BAM files to other image formats or extract other details.

There's a single KEY file, but of course some entries will not exist.

Link to comment

I do realise I'm reinventing the wheel, yes. I was using DLTCEP etc in the past for this but this type of tools never does exactly what I want, some of them require a specific OS, and also I enjoy figuring out how things work in more details.

I basically want to make python scripts that will do the whole process, turning data from the install CDs to assets I can use in web browsers, end to end.

What do you mean about some entries not existing?

Edited by MasterScrat
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...