View Single Post
Old 03-11-2007, 09:52 AM   #14
Network Caretaker
stoffe's Avatar
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Originally Posted by schmobag
Thanks for creating this tool. However, when I open up a RIM and try to extract something, the tool crashes if the file I'm extracting has no extension (ie, the "Type" field in your tool). I can list the RIM contents just fine, and extract anything with the "Type" field set, but nothing with that field unset.

It's actually Jade Empire (xbox version) that I'm trying to mod. (snip)
Sorry I havent' seen this before (the "view new posts" function of these forums is highly unreliable it seems).

The problem with this is how files are stored within the ERF/RIM files. The actual file extensions are not stored, instead it stores a numerical index value that represents a certain file format. To extract a file it uses a combination of the file name with this index (since files of different types can have the same name).

Thus, if the ERF file contains a resource with a file type index this utility doesn't know about (since it isn't used in KotOR) it won't know what type of file it is. This may be difficult to fix without having access to one of those ERF files in question to analyze what index number they use.

At any rate I should make it react a bit better when encountering a file with an unknown type. It should still be able to extract the file, even if you will have to guess at what the file extension should be yourself.

Thanks for pointing it out, I have added this to the To Do list.

Edit: I've now added rudimentary support for files of unknown types. It will extract them when a file extension made up of the Type Index, prefixed by a "#" character. If you keep the file extension like this it will be able to import the file back into the ERF file with the proper type ID set. (If you want to extract a file and put it in the game's override folder you'll have to figure out what the proper file extension should be and rename it though.)

You should also keep an eye on the file extension of any file it does import with a proper extension. It's possible the file type lookup table has changed between Jade Empire and KotOR, so it may give some files the wrong extension. You should peek into the files to make sure they have the proper extension. Since I don't have Jade Empire and little knowledge of what file types it uses this is hard for me to do anything about.

Edit again: Since I've now bought Jade Empire for PC I've done a separate version of this tool for JE, which should handle its file type mapping a bit better. You can find it in this thread.

Last edited by stoffe; 04-21-2007 at 02:39 PM.
stoffe is offline   you may: quote & reply,