lfnetwork.com mark read register faq members calendar

Thread: Simple ERF/RIM Editor (v0.3)
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 05-18-2006, 12:17 PM   #1
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
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:


ERF/RIM Edit
Version: v0.3
Released: 2006-05-18
Updated: 2007-03-11


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.


IMPORTANT!
----------
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.


Change history:
---------------
---> 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.


Last edited by stoffe; 04-19-2007 at 04:09 PM.
stoffe is offline   you may: quote & reply,
Old 05-18-2006, 05:00 PM   #2
Darkkender
Knight of Holowan
 
Darkkender's Avatar
 
Join Date: Aug 2004
Location: In the mountains of Oregon
Posts: 2,953
Current Game: Star Wars The Old Republic
Veteran Modder 
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]


Working so, we will learn history as a tree knows it; we will climb into shapes printed in the seed; we will become time made visible, years made fragrant; we will make of concentric memory a stem of praise; we will inhabit daylight at a trees own speed; we will be travelers who remain, patriots to this ground.
OMG I only rank 62.13018% geek or a Extreme Geek as it is referred to on the geektest at Geektest
[TSL]Holowan Plugin
Darkkender is offline   you may: quote & reply,
Old 05-18-2006, 06:23 PM   #3
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Darkkender
Hey Stoffe does it also recognize RIM files? If not, it might be nice to allow it to do so as well. Pretty Please with Sugar On Top. I'll even try to find a Cookie for you.
It currently does not support the RIM format since it is not an ERF format. From what I understand RIM is essentially a "lite" variant of ERF though, so I don't think it would be too difficult to adapt it to support RIM files as well. I'll look into it during the weekend if I have the time.

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.

stoffe is offline   you may: quote & reply,
Old 05-20-2006, 10:45 AM   #4
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Darkkender
Hey Stoffe does it also recognize RIM files. If not it might be nice to allow it to do so as well.
I've uploaded a new version (v0.2a1) now that should support working with RIM files. Seems to work as far as I can tell from the testing I did but as always make backup copies of the files first just in case. Since I couldn't find any documentation for the RIM format on the bioware site and I had to rely on other less reliable sources it's possible that I have missed something. If you notice something that doesn't seem to work correctly, please let me know.

stoffe is offline   you may: quote & reply,
Old 05-19-2006, 03:01 AM   #5
Darkkender
Knight of Holowan
 
Darkkender's Avatar
 
Join Date: Aug 2004
Location: In the mountains of Oregon
Posts: 2,953
Current Game: Star Wars The Old Republic
Veteran Modder 
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.


Working so, we will learn history as a tree knows it; we will climb into shapes printed in the seed; we will become time made visible, years made fragrant; we will make of concentric memory a stem of praise; we will inhabit daylight at a trees own speed; we will be travelers who remain, patriots to this ground.
OMG I only rank 62.13018% geek or a Extreme Geek as it is referred to on the geektest at Geektest
[TSL]Holowan Plugin
Darkkender is offline   you may: quote & reply,
Old 05-20-2006, 11:52 PM   #6
Darkkender
Knight of Holowan
 
Darkkender's Avatar
 
Join Date: Aug 2004
Location: In the mountains of Oregon
Posts: 2,953
Current Game: Star Wars The Old Republic
Veteran Modder 
Will do.


Working so, we will learn history as a tree knows it; we will climb into shapes printed in the seed; we will become time made visible, years made fragrant; we will make of concentric memory a stem of praise; we will inhabit daylight at a trees own speed; we will be travelers who remain, patriots to this ground.
OMG I only rank 62.13018% geek or a Extreme Geek as it is referred to on the geektest at Geektest
[TSL]Holowan Plugin
Darkkender is offline   you may: quote & reply,
Old 05-21-2006, 06:22 AM   #7
Joris1
Rookie
 
Joris1's Avatar
 
Join Date: Aug 2005
Location: Braunschweig,Germany,Europe
Posts: 86
Great work, Stoffe!


"But the angel said to them: Do not be afraid. I bring you good news of great joy that will be for all the people. Today in the town of David a Savior has been born to you; he is Christ the Lord.", Lucas 2:10-11
Joris1 is offline   you may: quote & reply,
Old 05-24-2006, 08:42 AM   #8
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Version 0.2a4

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.


Last edited by stoffe -mkb-; 07-06-2006 at 05:31 PM.
stoffe is offline   you may: quote & reply,
Old 06-23-2006, 07:14 PM   #9
Pavlos
Scruffy Englishman
 
Pavlos's Avatar
 
Join Date: Sep 2005
Location: The real world/ivory towers
Posts: 1,974
Current Game: Viking Warrior Poets
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.
Pavlos is offline   you may: quote & reply,
Old 07-06-2006, 05:25 PM   #10
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Pavlos
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.
Must have missed this post earlier for some reason, sorry about that. Anyway, I have added a "Yes to all" button to the confirm replace files dialog box, which hopefully should work like you requested.

It should be available as version 0.2a5 on the StarwarsKnights modding tools page now.
stoffe is offline   you may: quote & reply,
Old 08-23-2006, 04:05 PM   #11
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Version 0.2a6...

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.

stoffe is offline   you may: quote & reply,
Old 10-01-2006, 06:57 AM   #12
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Version 0.2a8...

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.
stoffe is offline   you may: quote & reply,
Old 01-15-2007, 08:54 PM   #13
schmobag
Lurker
 
Join Date: Jan 2007
Posts: 1
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?

Thanks!
schmobag is offline   you may: quote & reply,
Old 03-11-2007, 09:52 AM   #14
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
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,
Old 02-02-2008, 10:27 AM   #15
Ferc Kast
Modder
 
Ferc Kast's Avatar
 
Join Date: Jan 2007
Location: Tython
Posts: 1,586
Current Game: SWTOR
Helpful! Forum Veteran Contest winner - Fan Fiction Veteran Modder 
I just downloaded and I must say that this makes up for KotOR Tool not installing for me. Good job.

Ferc Kast is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > T3-M4's Astromech Droid Center > Simple ERF/RIM Editor (v0.3)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:04 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.