MasterScrat Posted May 17, 2023 Posted May 17, 2023 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? Quote
MasterScrat Posted May 17, 2023 Author Posted May 17, 2023 I'm still not sure if this is the file I need, but I found a Chitin.key in a .cab file on CD1: unshield l /Volumes/BG2_CD1/data2.cab | grep "key" 496634 hd0_cab\Chitin.key Let's see what I can get out of it... Quote
MasterScrat Posted May 17, 2023 Author Posted May 17, 2023 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? Quote
lynx Posted May 17, 2023 Posted May 17, 2023 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. Quote
MasterScrat Posted May 17, 2023 Author Posted May 17, 2023 (edited) 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 May 17, 2023 by MasterScrat Quote
lynx Posted May 17, 2023 Posted May 17, 2023 404 For python, I think iesh is the only parser written in that (still python2 though): https://github.com/gemrb/iesh Quote
Recommended Posts
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.