Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

NWN2 FindRefs Utility & Gff editor

Page: 1 of 1
 tk102
01-31-2007, 3:27 PM
#1
Download NWN2 FindRefs Utility v1.4 (http://www.starwarsknights.com/forumdl/nwn2findrefs_install.zip)
Download NWN2GFF v1.2.2 (http://www.starwarsknights.com/forumdl/nwn2gff_122.rar)

(note: you'll need to click the links rather than trying to paste the URLs into your browser)


NWN2 FindRefs Utility: For those of you enjoying Neverwinter Nights 2 but not the NWN2 Toolset's lack of search functions, feel free to try out this utility.

Those of you familiar with modding KotOR may notice the similarities to KotOR FindRefs. (http://www.lucasforums.com/showthread.php?t=137588). :xp: There are some behavioral differences though:

- You can search the modules, data, or campaigns folder (the latter is searched recursively)
- You can select to search the TLK file itself for entries
- If you enter a number in the search field and uncheck the "Allow Partial Matches" box, it will be treated as a TLK reference. You can force it to be searched as a string by checking the "Allow Partial Matches" box.
- Extracting multiple files will bring up a Browse For Folder dialog. Extracting a single file will bring up a Save As dialog (where you can rename the file).
- Checkboxes and radio buttons enable/disable sections of the search criteria in what I hope is an intuitive manner.

NWN2GFF: A GFF Editor based on K-GFF. The main difference here is that NWN2GFF allows up to 32 characters for resource names (ResRefs).
 Darth333
01-31-2007, 3:29 PM
#2
Awesome :thumbsup: A good search function was seriously lacking from the toolset.

You deserve many cookies for this one! :burg1: Thanks for doing this tk!
 stoffe
01-31-2007, 3:32 PM
#3
For those of you enjoying Neverwinter Nights 2 but not the NWN2 Toolset's lack of search functions, feel free to try out this utility.


Very nice, the search functions in the toolset are pretty much non-existent so this will likely come in useful.

Does it search inside hakpaks and custom TLK files associated with modules as well?
 tk102
01-31-2007, 3:45 PM
#4
Does it search inside hakpaks and custom TLK files associated with modules as well?

Um, well, no. If I remember correctly, hakpaks are ERF-formatted files with a .hak extension. Would they be in the override folder or the campaigns folder?

And custom TLK files... :o ... just goes to show how newbie I am in relation to the NWN modding scene.
 stoffe
01-31-2007, 4:01 PM
#5
Um, well, no. If I remember correctly, hakpaks are ERF-formatted files with a .hak extension. Would they be in the override folder or the campaigns folder?

And custom TLK files... :o ... just goes to show how newbie I am in relation to the NWN modding scene.

Hakpaks go in the "hak" folder (within the game folder or my documents\gamefolder) and are referenced by the hak-list field swithin a module.ifo file of a module. They are repositories for custom content (models, textures, 2DA's etc) that's unique to the modules using that hakpak. Hakpaks should be ERF files unless they've changed how they work from NWN1 (haven't checked the formats yet).

Custom TLK files are also associated to a module and contain all StrRefs above a certain threshold (I can't remember which right now). They reside within the "tlk" folder (either in the game folder on in the My Documents + game folder).

(Unrelated but, how about a version of K-GFF that works with NWN2? :))
 tk102
01-31-2007, 4:17 PM
#6
Hakpaks go in the "hak" folder (within the game folder or my documents\gamefolder) and are referenced by the hak-list field swithin a module.ifo file of a module. They are repositories for custom content (models, textures, 2DA's etc) that's unique to the modules using that hakpak. Hakpaks should be ERF files unless they've changed how they work from NWN1 (haven't checked the formats yet).

Then would a suitable strategy for NWN2FindRefs to discover the hakpaks be to search for a folder named 'hak' within the game folder or the My Documents, and gather a list of *.hak files, and parse them as I do with the *.mod files?



Custom TLK files are also associated to a module and contain all StrRefs above a certain threshold (I can't remember which right now). They reside within the "tlk" folder (either in the game folder on in the My Documents + game folder).

(Unrelated but, how about a version of K-GFF that works with NWN2? :))Assuming the strategy for discovering .hak files is valid, I would do something similar with the TLK files -- only here, I would gather up all the TLK references that match the search term and keep track also of what TLK file they came from.

But you say that Index 0 of a custom TLK file is really 0+some offset as it pertains to StringRefs in-game? I guess I'll need to find out what that offset is before I can search against it. I think I've found it: 0x1000000 (16777216)

But it begs the question: how can you know which TLK file sting 0x1000001 comes from if you have two custom TLK files? I guess I'm answering my own questions now -- the .mod or .hak files' module.ifo references the custom TLK. That adds a whole other level of complexity.
 stoffe
01-31-2007, 4:30 PM
#7
Then would a suitable strategy for NWN2FindRefs to discover the hakpaks be to search for a folder named 'hak' within the game folder or the My Documents, and gather a list of *.hak files, and parse them as I do with the *.mod files?

Probably, though keep in mind that hakpak content only is used for modules that link to them, so there may be multiple versions of the same files in different hakpaks.


Assuming the strategy for discovering .hak files is valid, I would do something similar with the TLK files -- only here, I would gather up all the TLK references that match the search term and keep track also of what TLK file they came from.

You'd probably need to check which module uses the custom TLK as well since all custom TLK files start at the same ResRef searching for StrRef alone is pointless if you won't know which file to search in. I.e. when searching for StrRefs in a special module or its associated hakpaks you should check for the relevant StrRefs in the custom TLK file associated with that module.


But you say that Index 0 of a custom TLK file is really 0+some offset as it pertains to StringRefs in-game?

Yes, I think you OR bit 7 in the StrRef DWORD to 1 to signify that it refers to the module's custom TLK file. Was a while ago I did anything with custom TLK files though.
 tk102
01-31-2007, 4:37 PM
#8
there may be multiple versions of the same files in different hakpaks.That's fine when it comes to searching. The "found" file and its container file are both displayed.
You'd probably need to check which module uses the custom TLK as well since all custom TLK files start at the same ResRef searching for StrRef alone is pointless if you won't know which file to search in. I.e. when searching for StrRefs in a special module or its associated hakpaks you should check for the relevant StrRefs in the custom TLK file associated with that module.Yes, I see how it would be a requirement to do so for any searches that include TLK references.Yes, I think you OR bit 7 in the StrRef DWORD to 1 to signify that it refers to the module's custom TLK file. Was a while ago I did anything with custom TLK files though.
Yes... I see it now in Section 2.4 of the TLK file format .pdf. :xp: Thanks stoffe.
 stoffe
01-31-2007, 4:45 PM
#9
That's fine when it comes to searching. The "found" file and its container file are both displayed.


Would this allow you to search for all modules which uses a particular HakPak as well? Could be useful when you have lots of hakpaks sitting around and want to figure out which ones are still used by any modules you have. :)
 tk102
01-31-2007, 4:51 PM
#10
If the modules contain references to the hak pak's by name, then I could add that a search criteria for FindRefs. The utility, as it is, only searches pre-defined fields within known file types. That is, it doesn't spider through the entire gff structure looking for CResRef, CExoStrings, and CExoLocStrings. That's a design trade-off for speed, but perhaps a spider mode could make the utility more robust if the user has the patience (or other good filters in place).
 Pavlos
01-31-2007, 5:03 PM
#11
tk102 == God!

It will be nice to have a proper search tool for Neverwinter Nights 2 :).
 tk102
01-31-2007, 5:49 PM
#12
(Unrelated but, how about a version of K-GFF that works with NWN2? :))
Shooting from the hip:
Edit: see link in first post
(supports CResRef fields to 32 chars)
 Darth333
01-31-2007, 7:06 PM
#13
Shooting from the hip:
NWN2GFF.rar (http://www.starwarsknights.com/forumdl/nwn2gff.rar)
(supports CResRef fields to 32 chars)
Nice! I was just in need of this one :D

That was quick!
 stoffe
01-31-2007, 7:16 PM
#14
Shooting from the hip:
NWN2GFF.rar (http://www.starwarsknights.com/forumdl/nwn2gff.rar)
(supports CResRef fields to 32 chars)

Thanks! Seems to work fine with the files I've used it with so far that were slightly corrupted by other GFF editors. Nice work tk102. :)
 tk102
01-31-2007, 7:16 PM
#15
NWN2 FindRefs current version is now 1.2. I fixed a couple issues with the results/feedback panels when searching dialogs and the campaigns folder. It should be a bit more responsive to the halt button too.

Edit: Glad to hear the KGFF, err.. NWN2GFF editor is behaving. I was hoping it was as simple as it appeared. :)
 tk102
02-13-2007, 12:07 PM
#16
Updated to v1.3 a couple days ago. Added Deep GFF Search (full GFF tree search -- it's thorough but a little slower), the ability to recursively search the Override folder, and more generic file searches within the modules and data folder. .hak files are now recognized as ERF files as are .erf but I've not yet implemented custom TLK searches.
 tk102
06-07-2007, 4:55 PM
#17
NWN2GFF v1.2.1 released

I had a little catching up to do with some recent features I had added to KGFF to get NWN2GFF up to date.

- Better navigation through up/down left/right keys (left/right: folds/expands up/down: keeps selection anchor under control)
- Eliminated a bug where a non-existent file in the most recently used list would cause NWN2GFF to croak
- Fixed an XML bug involving strange copy/paste effects with empty Structs or empty Lists
 Pavlos
06-08-2007, 8:48 AM
#18
Hey, that's great, tk, thanks!

You may want to post the links over on the BioWare forums to get a greater amount of exposure... I think someone was looking for a GFF editor the other day, too :). But I've no idea if you've already done this or not - the BioWare forums move so fast it's difficult to keep track of them.
 ChAiNz.2da
06-08-2007, 9:38 AM
#19
Very nice tk!

Since it's a tool thread, and I'd hate for it to be lost in the mix... this thread graduates to Sticky :D
 stoffe
06-10-2007, 5:19 AM
#20
NWN2GFF v1.2.1 released

- Fixed an XML bug involving strange copy/paste effects with empty Structs or empty Lists

There still seems to be something weird with this. While copy/pasting a list from one GFF file to another now seemingly works (it gets added to the treeview) at first, doing so appears to prevent any changes to the GFF file from taking place when you save it. When closing and opening the file again the list I just pasted is gone, along with changes to the values of a few existing fields I made. :confused:

(Chosing "Save As..." won't create any file at all either after having pasted a list field.)
 tk102
06-10-2007, 12:19 PM
#21
There still seems to be something weird with this.
Aha, yes it seems so. The XML fix exposed a vulnerability in my GFF library where empty Lists and Lists with a single struct were making certain assumptions...

v1.2.2 has been released (recompiled with a fixed GFF library). Thanks for the heads up stoffe. :)
 tk102
01-09-2008, 2:33 AM
#22
NWN2FindRefs v1.2.4 released

- Fixed a long standing bug where non .dlg files were not being extracted from .mod files correctly. Thanks Darth333 for the heads-up on this.
 best_predator
03-20-2008, 2:17 AM
#23
Can someone tell me how to edit eye color? I can't find the right parameter to change.
Page: 1 of 1