A module Corruption System

Hello, I am Sir_Mathis_Kyngston. I am posting this topic to inspire some creator to come up with
add on to the Neverwinter Nights 2 Packer utility program. The NWN packer 2 works great on repairing
corrupted modules,by picking and choosing bad files in a module. We need a utility that scans each file
and fixes the damage files. Either it can scan .erf, mod, and delete the damage file by the file not
responding to opening up command. So, the program needs to be able to scan all of the Module files and
troubleshoot the problem. I am little UN-knowledgeable on the inner workings of a utility program and
would love some guides and help.To guide me on software programing or become a self-taught
programmer.

If anybody needs help with the project. I have some advanced amount of detail I could share, but this
is a general inspiration for other Neverwinter night 2 players. I am new at compression and
decompression utility tools / programs. Best regards Sir_Kyngston.

I suggested something like that for Xoreos-Tools, but I fear it would require a significant amount of work to fully implement. You would need to be able to check each file type and variant in the game and know when something isn’t correct.

But possibly a simple tool could be built that just does some basic checking of each file type in the archive? At least for an initial version.

The existing tools can do a pretty good job of dumping the known file types so you know what to check for.

2 Likes

I just modified a bit my ERF tool to allow recovering as much data as possible from a truncated ERF file. It will extract files when possible, print messages for missing files, and create a .part file if a file is incomplete.

It’s a command line tool, so you’ll be forced to use either the command-line, or create a bat file on windows. Usage is nwn-erf extract --recover yourfile.erf -o output_dir

The output_dir can then be opened with the toolset (in directory mode), with one exception: the toolset requires a module.ifo file, and maybe also repute.fac and module.jrl. I think you can copy those files from another module and it should work.

2 Likes

Thanks Rjshae and CromFr,

I appreciate your input and feedback on this. I can see it’s going to be easy with scripting. I love it, when a good team of scriptwriter comes together. I am helping (angry_yard_gnome) Dave with a corrupt module file. I can’t remember what happened, but on saving the module it got corrupt. I was able to save a little bit of it for him. Of course, I am running Windows Vista 32 bit. And that NWN2 Toolset gave me some message of the file begin damaged or corrupt. I just clicked through all of those 20 plus message and got some results to save has much of it as I could. I ran across some message in red in NWN 2 Toolset that let me know some areas were damaged and would come up in NWN 2 Toolset and I had to delete those areas. I was able to get it to work in NWN2 Toolset, but I was unable to get it to come up in the NWN2 game console, but no errors in NWN 2 Toolset. From this I decide to share my knowledge in hopes a scriptwriter could come up with a good tool to help a player / DM. I also used NWN 2 Packer utility program first, before using it to make an .erf file. I had to delete some know damaged areas before saving an .erf file in NWN 2 Packer. Then I made a new Module and area and used the .erf to add the additional areas that came up from before and were not bad. While I was in NWN 2 Toolset, I deleted the area I created in module and wow I was able to help a player out. I checked it several times and got it to work. It only cost me 3 hours. I saved the repair file several times with other tries on getting it to work better or at least come up in NWN2 Toolset. I would like to Thank you once again for your post.

1 Like

You can also go further by trying to parse the extracted files with external tools (i.e. GFF parser for git, gic, utc, uti, ifo, … and a TRN parser for trn, trx), and find those that are damaged. I can adapt my command line tools to only perform checks, if you need them.

Also, even if it’s a bit out of topic and it probably already have been said, here’s some good practice for avoiding corruptions:

  • Always save your module in directory mode. mod files are locked by the game when starting a new module and can make the toolset crash. Also since a mod file is generally very large, it takes a long time to write and if anything happen to your PC or toolset in the meantime, you’ll lose your work.
  • Use the “save current view” feature from the Grinning Fool’s Usability Tools Plugin as much as possible. It makes really quick saves when you are editing areas, scripts and conversations (does not save blueprints), and I never seen it crash.