Simple ERF/RIM Editor (v0.3)
EDIT(2007-03-11): Uploaded version 0.3 which should handle files of unknown types a bit better, and is capable of opening the ERF V1.1 files used by NWN2. See the readme for instructions.
EDIT(2006-10-01): Uploaded version v0.2a8, which fixes a bug where deleting a resource from an ERF/RIM would seemingly remove it, but the actual data wouldn't be deleted. Deleting resources now completely removes them from the ERF/RIM file.
EDIT(2006-08-23): Uploaded version v0.2a6, which fixes a bug while saving RIM files causing the game (but not KotorTool) to have trouble loading them. There was an error in the RIM specification I didn't know of before...
EDIT(2006-07-06): Uploaded version v0.2a5, which adds a "Yes to all" button in the confirmation dialog box when prompted to replace existing files within an archive.
EDIT(2006-05-24): Uploaded new version, v0.2a4, which allows associating files with Erf Edit in Windows explorer and drag'n'dropping files onto its icon to open them.
EDIT(2006-05-20): Uploaded new version, 0.2a2 which fixes the list sorting by clicking the column headers, which was broken previously.
EDIT(2006-05-20): Uploaded new version, 0.2a1 with RIM support and some bug fixes.
Mostly for my own use (and challenge) I've put together a simple ERF Editor, capable of creating and editing ERF, MOD, SAV, HAK and RIM files for the KotOR games. Seems to work from what I've used it for so far, but since it's fairly new there may yet be some undiscovered bugs lurking within.
Anyway, in case someone else would find it useful I've uploaded it here as well.
While KotorTool already can handle most of what this utility does currently (except RIM editing) I personally think this is a bit quicker to work with than the KotorTool ERF functionality when you want to change existing files, since you won't have to manually extract and re-package a file if you want to edit it, and files can be opened directly without being installed in the proper folder first.
If anyone does use it, and stumble across any bugs or oddities, please let me know. :)
(There is a separate version of this utility adapted to work with Jade Empire as well. See this thread to find it.)
The somewhat minimalistic readme:
What is this?
This is a simple Packer/Unpacker/Browser for the ERF/MOD/SAV/HAK/RIM format files used by the bioware engine games Neverwinter Nights and Knights of the Old Republic. The resource type list is updated to handle some types of files used by the KotOR games that were not used by Neverwinter Nights.
It is capable of creating new files or modify existing ones, as well as extract any resources found within the file. A simple search feature makes it easier to locate resources in the list within large ERF format files.
The Description field is currently not shown or editable since it is not used with the KotOR games.
User Interface shortcuts
You may drag and drop files into the list to add them instead of using the "Insert" button, or you may drag selected files from the list to the Desktop or a Windows Explorer window to extract them rather than use the "Extract" button. Selected files in the list can be deleted with the hotkeys Backspace and DEL in addition to using the Remove button.
When dragging many or large files from the ERF/RIM file to the desktop (or a Windows Explorer window), keep the mouse button pressed until the progress bar has reached 100%, then drag the files to where you want them and let go. Hopefully I'll be able to fix this quirky behavior in the future. :)
New files/resources added to an ERF file are not actually added until you Save the file. Do not move, rename or delete any files you have added before you save the open ERF/RIM file, or the resource will not be added upon save.
Resources in the list with an asterisk (*) following the ResRef are newly added and not yet saved into the file. These files cannot be extracted until the ERF file has been saved.
---> 2006-05-20 (0.2a2)
* Added support for reading and saving RIM files.
* Fixed bug with duplicate entries in resource list when replacing an existing resource with a new one with the same name.
* Fixed sorting the list by clicking the column headers to work peoperly.
---> 2006-05-24 (0.2a4)
* Added support for opening files directly specified as a commandline parameter. This makes it possible to associate the relevant file types to ErfEdit in the Windows Explorer, and to Drag n Drop files onto the ErfEdit.exe icon to open them.
* Enabled extraction progress feedback when drag and dropping a large amount of files (or very large files) from the Resource list to the Desktop or a WinExplorer window.
---> 2006-07-06 (0.2a5)
* Added a "Yes to all" button to the Replace Files confirmation dialog box when replacing a bunch of existing files in an archive.
---> 2006-07-06 (0.2a6)
* Fixed sneaky bug in the RIM handler which caused the game to have trouble loading RIM files saved by ErfEdit. Apparently there was an error in the RIM specification...
---> 2006-09-30 (0.2a8)
* Fixed bug when deleting resources from ERF/RIM files, where the resources would seemingly be removed, but the actual data still kept in the ERF/RIM file. Deleted resources are now completely removed.
---> 2007-03-11 (0.3)
* As requested: made it capable of working with files of unrecognized file types (this should only happen if using it with ERF files from another game than KOTOR or TSL). It will use the file type index prefixed by a # character instead of the (unknown) file extension of the file when extracting or importing these files.
* Made it capable of loading the ERF V1.1 files that are used with Neverwinter Nights 2. The file type lookup table may still be incorrect for new file types here for now. I'll look into making this utility more fully NWN2 compatible in the future.
IMPORTANT: If you use the ERF/RIM editor for another game than KOTOR or TSL some of types of files will be given an improper file extension, since the type<-->extension table may have changed in this game. If you plan on putting the extracted file in the override folder of this game you will have to determine the file type and change the file extension accordingly. If, however, you plan on using the ERF/RIM Editor to put the file back into the ERF you extracted it from you should leave the improper file extension as it is.
Hey Stoffe does it also recognize RIM files. If not it might be nice to allow it to do so as well. [In_Begging_Mode]Pretty Please with Sugar On Top. I'll even try to find a Cookie for you.[/In_Begging_Mode]
I'm somewhat curious what you'd need RIM files for though since the game still appears to support ERF/MOD format files for all the same purposes the RIM files are used for. :)
Mostly for the extract purposes. Although the thought of appending straight to an existing RIM has got it's appeal as well. It could just be that I like the thought of an extra option or 20.
Great work, Stoffe!
I found and fixed a few more things that weren't working as intended and have uploaded a new version (0.2a4) with those fixes.
I had forgotten to make it open a file specified as commandline parameter when the application is launched. This should now work, allowing it to be associated with the relevant file types in Windows Explorer if so desired.
Also, due to the hackish way it does things when you drag and drop files from the resource list to the Desktop or a Windows Explorer window it might give the impression that the application hanged when dragging a large amount of (or very large) files. It now shows a progress bar and hourglass cursor while it's extracting. Don't let go of the mouse button while this happens, keep it pressed until it's done and the standard Drag cursor appears, then drag to your desired destination. (Though it's probably better to use the Extract button than drag n dropping when dealing with that amount of files.) I'll try to come up with a less touchy solution for this in a future version. :)
Hey, stoffe. Nice tool you have there - especially when packaging the lip files for a module (I find KotOR Tool has issues with packaging huge numbers of files - it tends to jam up). Might I request another feature? When you are replacing files that exist already within the ERF/MOD/SAV/HAK/RIM there is no option to say "Yes to all." Sitting there clicking "Yes" a hundred odd times often isn't much fun.
It should be available as version 0.2a5 on the StarwarsKnights modding tools page now.
I have uploaded version 0.2a6 of this tool. This version only changes one thing, but it was a serious enough bug to warrant a new version of its own.
Seems like the RIM specification was incorrect as to where certain data was stored, which caused the game to have trouble loading RIM files written by this tool (though KotorTool had no problems loading them). This should now be fixed, and as far as I have been able to verify the game properly reads the content of modified/new RIM files now. (Lesson learned: don't rely on other tools to verify that your own utilities work. :))
Download link is in the first post in this thread.
I've uploaded version 0.2a8, which is another minor bugfix version. Seems like deleting a resource from an ERF/RIM file in v0.2a6 only deleted it from the index, the actual data was still kept in the file, unaccessible. While this didn't cause any trouble since the game didn't know it was there it needlessly caused bloated file sizes when deleting a lot of resources. This is now fixed and deleted resources are completely removed from the ERF/RIM file.
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. Using your tool, I've been able to extract some 2da files, edit them with the 2da editor in kotortool, and make some minor tweaks (such as unlocking the Monk Zeng character in the regular version of the game, even though he's supposedly only available in the limited edition).
Can you confirm that your tool crashes when trying to extract a file with no extension?
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.
I just downloaded and I must say that this makes up for KotOR Tool not installing for me. Good job. :thumbsup:
|All times are GMT -4. The time now is 07:20 PM.|
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.