PDA

View Full Version : FindRefs Utility (Latest version: v4.4)


tk102
10-04-2004, 09:13 AM
FindRefs v4.4 6/23/2007
A file search and extraction tool for KoTOR and TSL resources

Download from starwarsknights.com (http://www.starwarsknights.com/tools.php)

Icon by svösh!

v4.4 Extended the search to include the inventories of merchants, placeables, and creatures.
v4.3 Added ability to search/extract .2da files
If search term is numeric and TLK references are enabled, the utility will assume the search term is an index to dialog.tlk and will search accordingly.
Source code for .exe and .dll included
v4.2 Bug fix: Under certain search criteria, some .bif files were being searched twice needlessly.
Bug fix: Under certain search criteria, some resources in models.bif, templates.bif, and scripts.bif were being shown as found in multiple bifs.
DLL version numbering now in sync with EXE.
DLL compiled with Perl 5.8.8.
v4.1 Bug fix! Fixed searches in templates.bif and scripts.bif
v4.0 Search extended to .git/.mdl/.mdx/.tpc/.tga files
Added filename-only search toggle
Multiple selection/extraction now possible

T7nowhere
10-04-2004, 09:21 AM
I just went to pcgm for another reason and saw this posted :) Nice. I'll try it out and report back to ya as soon as I can. It looks very cool.

tk102
10-04-2004, 09:32 AM
I hope it does save people some time. I know that searching for these kinds of references can be frustrating.

The global variable detection was actually a side-effect... since .ncs files are not .gff files, I just do a full search of the files looking for strings. Since Global Variables are strings within .ncs, they are just as detectable as those scripts called by the ExecuteScript. Likewise, you can also search for tagnames within .ncs files for the same reason (that just now occurred to me...).

Anyway, I apologize somewhat for the command-line format of this utility -- but on the upside, it only took about 4 hours to write. :)

Darth333
10-04-2004, 09:37 AM
This is great :thumbsup: ( as I already commented at pcgamemods :) ) and as you say this will save us time and frustration...

I'll make a good use of it... once I find time to mod again :(

tk102
10-04-2004, 11:46 AM
v0.2 released already...

Increased the search speed (greatly) over v0.1.

MTV2
10-04-2004, 03:45 PM
Aw man is the great:D Real helpful tk102:cool: ;)

beancounter
10-04-2004, 04:03 PM
Very nice work TK, it will save a lot of time.

RedHawke
10-04-2004, 09:09 PM
Very cool utility TK! :D

And as others have said it will definately be a timesaver. :)

tk102
10-04-2004, 10:30 PM
Thank you for the positive responses. Like I said, I'm quite sorry I didn't make it sooner... like back in March. :rolleyes:
Better late than never, I suppose.

For those of you who simply detest command line utilities, I wrapped this one up into an ActiveX object and stuffed it into a simplistic Visual Basic form. You can now download the GUI version from the first post in this thread.

Darth333
10-05-2004, 06:39 AM
After the programmer who codes faster than his shadow, we now have the programmer who codes faster than lightspeed :p (err..that's about the same I think :D )

Thanks tk102 :)

tk102
10-06-2004, 01:48 PM
FindRefs GUI v1.1 released.

You can now extract the resource from the .rim/.bif file by double-clicking on it in the results listbox.

Darth333
10-06-2004, 03:58 PM
Nice one again!

The only thing you forgot is to mention that findrefs is case sensitive ;)

svösh
10-06-2004, 04:12 PM
Thanks TK :D Another excellent tool of yours, this will come in handy. Keep it up :)

svösh

tk102
10-07-2004, 12:19 AM
The only thing you forgot is to mention that findrefs is case sensitive
Oh, yeah.
Keep it up
Ok.
v1.2 released -- added case sensitivity and partial matching toggles
Screenshot (http://webpages.charter.net/krumsick/kotor/findrefs_gui12.jpg)
:)

DarthBuzzard
10-07-2004, 12:21 AM
Saveth by a nerf herder! :D

but really, nice stuff :D

Fred Tetra
10-07-2004, 06:13 AM
You're catching up on the features! ;) Now I have to get the BIF searching done :D

tk102
10-07-2004, 07:38 AM
I'm glad that we are helping each other reach our full potential. It keeps things interesting.

Edit:
Just realized something -- I had turned off the 'auto increment' of version control when I made v1.2 -- it still says v1.1 in the title bar. Doh! So if you're upgrading from v1.1 to v1.2 and you're not sure which is which, v1.2 has the Partial Match/Case Sensitive checkboxes and v1.1 does not. Sorry about that.

tk102
10-07-2004, 09:36 AM
FindRefs v0.3 (command line) released.

Adds case sensitivity and partial matching just like the GUI version.

Also adds the ability to search the Tag field in the *.ut* files and expands the search to include *.uti files. (The GUI version does not yet offer that.)

The new command line options are:
-I (search .uti files)
-C (search is case sensitive)
-P (allow partial matching)

Darth333
10-07-2004, 10:11 AM
Thanks :) This new function will be very useful to verify if our npc, item or placeable has a "clone" somewhere in another module :thmbup1:

Edit: And here are some news concerning findrefs: http://www.starwarsknights.com/

tk102
10-07-2004, 01:39 PM
And thank you: for the nice write up in starwarsknights.com and for the suggestion regarding Tags! :D

The GUI will be enhanced with the .uti search/Tag field search tonight.

tk102
10-08-2004, 12:20 PM
FindRefs GUI 1.3 released.
- Adds .uti to list of file types to be searched
- Adds "Tag" to list of fields searched
- Output more readable, using fixed with font in listbox

FindRefs (command line) 0.4 released.
- Added -q (quiet mode) which makes output more readable when multiple results are found.

tk102
12-08-2004, 01:29 PM
Updated both the console and GUI versions of FindRefs to fix a bug that ignored .utp-only searches.

RedHawke
12-08-2004, 06:15 PM
Very cool TK, thanks for the hard work! :D

Darth333
12-09-2004, 06:01 AM
Thansk again :) I love this utility. It's very useful!

tk102
12-14-2004, 07:11 PM
FindRefs v2.1 has been released (command-line). The important addition to this utility is the -T option which will extend your search to TLK references as well (ExoLocStrings). Examples of this include Item Descriptions, Area Names, and Dialog text.

So the following command:findrefs -DTq Sleheyron will find all Dialogs that have Sleheyron will return

korr_m35aa_s.rim kor35_yuthuraban.dlg Entry 12 Text
'Let's see... after escaping from Sleheyron I was found by the Jedi. They took me in and trained me eve
n though I was a bit older than most Padawans.'

The -T option slows the search noticeably, especially when used in conjunction with the -D option. However, this function in essence merges my KTLK, DLGSearch, and FindRefs utility in one tool.

Darth333
12-15-2004, 06:09 AM
Thanks for the hard work tk102 :) . This new feature is going to be very useful. I used FindRefs countless times and now I'm going to loose the count even more :D

Darkkender
12-15-2004, 07:24 AM
So should we expect this update feature being added to the findrefs gui edition as well sometime soon?

tk102
12-15-2004, 07:35 AM
Yes you should Darkkender. :)

Darkkender
12-15-2004, 08:08 AM
Originally posted by tk102
Yes you should Darkkender. :)
:elephant: YES! :sheepdanc

tk102
12-15-2004, 03:05 PM
FindRefs GUI v2.1 released.

- Added ability to search TLK file references

I added a separate scrolling TextBox to the right of the Listbox to contain the references found. In the case of Dialog and Descriptions, this was necessary to preserve the readability of the results.

I'd recommend uninstalling the old version of FindRefs GUI if you have one. Probably will work either way, but it's safer.


Yay! 1000 posts! 950 of them on this forum!

tk102
03-12-2005, 04:39 AM
The command line version of this utility has been updated to v3.0.

Two new option switches have been added.

-2 This switch will tell Findrefs to search for TSL files instead of KotOR files.

-f This switch tells findrefs that what follows is a file pattern that will be searched from instead of searching the entire gambit of game files. This can be useful if you know for example that you want search a particular .erf, .rim, or .bif file. Because this switch accepts a value, it should separated from the other switches like so:

findrefs -AqP2 killblaster -f *.bif

The GUI version has not been updated yet to support TSL. I expect to have it updated within the week.

Darkkender
03-12-2005, 04:41 AM
Originally posted by tk102
The command line version of this utility has been updated to v3.0.

Two new option switches have been added.

-2 This switch will tell Findrefs to search for TSL files instead of KotOR files.

-f This switch tells findrefs that what follows is a file pattern that will be searched from instead of searching the entire gambit of game files. This can be useful if you know for example that you want search a particular .erf, .rim, or .bif file. Because this switch accepts a value, it should separated from the other switches like so:

findrefs -AqP2 killblaster -f *.bif

I guess I should have waited a hour or 2 before crafting my newbit at RPGdot.com. Especially since this is a handy tool.

tk102
03-12-2005, 04:45 AM
:lol: Or I should've started an hour earlier. Thanks DK. :D

Darth333
03-12-2005, 11:52 AM
Thanks tk! I think this is the tool I use most often! :)

tk102
03-12-2005, 02:45 PM
v3.1 released (command line).
Added TemplateResRef as another searchable field for template files (*.ut*)

This should prove helpful to avoid the problems outlined by Darth333 in this (http://www.lucasforums.com/showthread.php?s=&threadid=145353) thread.

An example of how FindRefs can be used to detect the potential for overriding other templates by accident can be seen here. (http://www.lucasforums.com/showthread.php?s=&postid=1774570#post1774570)

T7nowhere
03-12-2005, 09:08 PM
Thanks man, Now go play TSL!!!

Mav
03-12-2005, 09:11 PM
^^^
Lol :lol:, agreed.

tk102
03-13-2005, 04:25 PM
Findrefs GUI v3.1 released

- Added support for TSL files
- Added TemplateResRef as a seached field
- Added NSS files for search/extraction
- Added File Pattern to Search textbox to help speed up search when the resource is known to be in a certain file (wildcards also accepted)


@T7, Mav: Yeah that's on the list. :)

tk102
03-13-2005, 09:08 PM
v3.2 (command line) released
- Added -N: search .nss files
- Added -v: view output in color

Note that if you are redirecting the output of the findrefs to a file, you should not use the -v switch becuase nothing will be output.

tk102
03-13-2005, 11:43 PM
v3.2 releaed (GUI)

- Fixed bug where .nss files were not being searched if a file pattern was specified.

- Fixed tab-key selection order so that controls highlight in an intuitive order

tk102
03-14-2005, 02:53 AM
v3.3 (command line and GUI) released

Command line version
- Fixed a bug where .erf dialogs weren't getting searched correctly

GUI version
- Fixed a bug where .erf dialogs weren't getting searched correctly
- Fixed a bug where .dlg files weren't extracting correctly.

tk102
03-18-2005, 01:13 AM
Findrefs GUI v3.5 released
A lot of changes:
- Search is non-blocking (you can interact with the form as you search)
- Halt button added
- Feedback textbox added to show search progress
- Results are now displayed as soon as they are found instead of displaying them all at the end
- Seach Timer added
- Added ability to exclusively search for TLK references (now a radio button selection)
- Eliminated duplicated search of .erf files if file search pattern was set.

Darth333
03-18-2005, 01:20 AM
Perfect! :)

tk102
03-24-2005, 12:35 AM
Findrefs GUI v3.6 released

- Added file name as a searched criteria.

(You'd think that would've been there before.)

Darkkender
03-24-2005, 12:45 AM
Originally posted by tk102
Findrefs GUI v3.6 released

- Added file name is a searched criteria.

(You'd think that would be there before.)

It's SOK Tk we don't expect you to be 100% perfect. But thank you for this.

tk102
04-05-2005, 01:51 AM
GUI v3.7, CmdLine v3.5 released

- Added Conversation to the list of fields searched for .utc, .utd, and .utp searches

tk102
07-30-2005, 10:56 AM
FindRefs GUI 4.0

- Now searches for .git/.mdl/.mdx/.tpc/.tga files (by filename)

- Toggle filename-only search mode (fast)

- Multiple selection/extraction feature added

tk102
08-01-2005, 03:00 AM
v4.1

- Bug fix! Version 4.0 had a bug that prevented searches within templates.bif and scripts.bif from being fully searched.

tk102
03-15-2006, 03:36 AM
FindRefs GUI v4.2 released
- Fixed a bug where some .bif files were being searched twice
- Fixed bug where some resoruces in models.bif/templates.bif/scripts.bif were being reported as found in multiple .bifs
- Updated findrefs.dll to v4.2 to keep .exe and .dll in sync
- DLL now compiled with ActivePerl 5.8.8

tk102
09-06-2006, 04:46 PM
v4.3 released

Added the ability to search and extract .2da files
If the search term is numeric and TLK references are enabled, FindRefs will now assume the search term is an index into dialog.tlk and will search files accordingly. (For Dashus)


I've included the VB6 source code for the .exe and the Perl source code for the .dll for those interested. I've discontinued support for the command line utility at this point and have removed its link from swk.com.

Darth333
09-06-2006, 05:04 PM
That's great news. I particularly like the ability to search .2da files. Thanks for doing this! Findrefs is one of those utilities I couldn't do without :D

glovemaster
06-18-2007, 03:40 PM
Im not sure whether this is a problem, or a function you havent added yet, but..
I notice that the program searches Lightmaps.BIF but doesn't actually show the lightmaps for extraction. Is this 'supposed' to happen?
Also, a suggestion... Seen as KotOR Tool doesn't include multiple extraction, could to possibly include a function to extract TPC files as TGA, like KotOR Tool only with lots of files rather than 1 at a time through the image viewer?
Thanks ;) ~GM

tk102
06-18-2007, 04:25 PM
Im not sure whether this is a problem, or a function you havent added yet, but..
I notice that the program searches Lightmaps.BIF but doesn't actually show the lightmaps for extraction. Is this 'supposed' to happen?
If by 'is this supposed to' you mean 'is this expected (by me)', then the answer is yes. :p Lightmaps.bif are not currently supported by FindRefs.


Also, a suggestion... Seen as KotOR Tool doesn't include multiple extraction, could to possibly include a function to extract TPC files as TGA, like KotOR Tool only with lots of files rather than 1 at a time through the image viewer?
Thanks ;) ~GMI knew this was coming. :p I'll put it on the list.

glovemaster
06-18-2007, 04:29 PM
Ah thats kwl then ;) thanks!
~GM

tk102
06-23-2007, 05:06 PM
v4.4. released
- Extended the search to include the inventories of merchants, placeables, and creatures.

ChAiNz.2da
06-24-2007, 06:09 AM
v4.4. released
- Extended the search to include the inventories of merchants, placeables, and creatures.
:worship: Much thanks! I'm toying with re-installing and this one little function will be a godsend for something I had in mind ;)

Ferc Kast
06-24-2007, 08:34 AM
I just found my problem with it, finally: the installer said it skipped findrefs.dll

Any way to get this missing file by itself?

tk102
06-24-2007, 02:12 PM
@jcoolZombie: The installer attempts to detect the version of findrefs.dll that you currently have and if it is later or the same as the one in the installer, it will skip it. Try deleting your existing version of findrefs.dll (in your C:\Windows or C:\WINNT folder) and try the installation over again.

Might also require running as administrator under Vista since it registers a new DLL.

misanthrope prime
08-04-2013, 01:42 AM
Sorry to bump this thread up from half a decade ago, but I can't seem to get findrefs to work with KOTOR 2 for me: it keeps telling me "could not locate installation directory"- which I could easily fix but I can't seem to figure out HOW to specify the directory in this program. It works fine with KOTOR 1, though. Maybe it has something to do with the fact that I downloaded them via steam?