Jump to content

Home

Various Modding Tools (2DA, TLK, DLG, Search)


Recommended Posts

Here are several utilities I wrote while working on Cantina Bastila. Included are:

 

  • 2da Editor - includes some extra features I wanted. (Delete row, asterisk out a row, asterisk out a column, add column, delete column...) Note that using some of these features if you don't know what your doing will likely result in total chaos in your game. (Deleting a row, for example.)
  • Dialog Editor - This was the product of extreme boredom and no internet connection. It turned into a full featured dialog editor with some extra functionality. (Like listening to the actual audio of dialog lines when you select a line, test drive with full audio, extract the appropiate lip file for a dialog line, as well as the ability to edit anytag in the dialog as well as adding your own tags.) It will also extract the appropriate lip file and copy the selected wav to the folder of your choice.
  • Dialog TLK search - I know this has been done, but this one includes the ability to play audio if it exists. It will also extract the appropriate lip file and copy the selected wav to the folder of your choice.
  • Find In Files - This program will search inside files for specific text. I use this quite a lot hunting for specific code on my hard drive.
  • KT Wav Res Helper - This will allow you to play the audio of dialog lines from the Kotor Tool Conversation Editor. It will also extract the appropriate lip file and copy the selected wav to the folder of your choice.
  • Search For NPC's in Dialogs - If you do wav modding (hacking existing wavs to make new ones) then you want as much audio content from an npc as possible. This will search the game resources and list any occurences of the the name of the npc you specify (what dialog in what rim, erf, or mod.) Once you make a search you can then generate a list of all dialog lines from the npc specified. You can then save this list to disk. THIS list can be reloaded anytime you want. From this list you can browse the dialog lines, hear the wav resources and easily copy the wav / lip to the destination of your choice.
  • Wav Manipulator - This is mainly for making your own wav files. It allows you to convert wav or mp3 files to or from the kotor format (with prepended headers) by simply dragging and dropping a file onto the form. If Drag Drop Play is checked it will play the sound instead of converting it.

 

Two controls are included and required for most of the programs to run. They come straight from the Microsoft Visual Studio 6.0 Service Pack 5.

 

Available from my FileFront page.

 

Available from my web site.

Link to comment
Share on other sites

Holy Sweet BeJezus is right. Now all we need is a working "BIF" builder utility for the Kotor series and we could be set.

 

Edit: Hey KK we have a problem. 3 of the utilities are returing errors. The 2da Editor, KT Wav Res Helper, & Dialog Viewer. The first 2 return Windows Application Error windows referencing Hex memory address information. The Dialog Viewer loads however it pops a window upon load that reads "Fails to create tooltip window" you click okay and it shutsdown. Dialog Viewer also creates a Debug Log and gives the same hexcode error inside there as the other 2. The Hexcode in the log report shows it returning the following. "eErr_EXCEPTION_ACCESS_VIOLATION"

Link to comment
Share on other sites

Edit: Hey KK we have a problem. 3 of the utilities are returing errors. The 2da Editor, KT Wav Res Helper, & Dialog Viewer. The first 2 return Windows Application Error windows referencing Hex memory address information. The Dialog Viewer loads however it pops a window upon load that reads "Fails to create tooltip window" you click okay and it shutsdown. Dialog Viewer also creates a Debug Log and gives the same hexcode error inside there as the other 2. The Hexcode in the log report shows it returning the following. "eErr_EXCEPTION_ACCESS_VIOLATION"

 

Ok. The things in common with all three apps is that they are all attempting to subclass the window at the point that it gpf's. (Using the SetWindowLong api.) It also appears that CreateWindowEx failed in making the tooltip window.

 

At the moment all I know to ask is what OS are you using? And do you have any special system configurations that I might should know about? (Like what kind of cpu do you have?)

Link to comment
Share on other sites

Ok. The things in common with all three apps is that they are all attempting to subclass the window at the point that it gpf's. (Using the SetWindowLong api.) It also appears that CreateWindowEx failed in making the tooltip window.

 

At the moment all I know to ask is what OS are you using? And do you have any special system configurations that I might should know about? (Like what kind of cpu do you have?)

 

I can confirm that what has been described above happens to me as well:

 

2DA Editor: Crashes during startup with some kernel32.dll error (standard Windows application crash dialog)

 

Dialog Viewer: "Failed to create Tooltip window" + closing when pressing OK.

 

Find in Files: "RICHTX32.OCX missing" message + closing when pressing OK.

 

KT Wav Res Helper: Crashes during startup with some kernel32.dll error (standard Windows app crash box).

 

I'm using Windows XP Home with SP2 installed on a machine with an AMD Athlon 64 3500+ processor. (I've also tried it on a machine with an AMD Athlon XP 2600+ processor running Windows XP Professional with SP2 installed with similar results.)

 

The other applications seem to be working fine so far though. :)

Link to comment
Share on other sites

I've done some research and the culprit seems to be a new feature that comes with Windows XP SP2 called 'Data Execution Prevention'. Unfortunately, I don't have Windows XP SP2 and have no idea how to circumvent this problem. I've read that it can be disabled on a per program basis.

 

Here's an excerpt from this Microsoft page.

For the purposes of program compatibility, you can selectively disable DEP for individual 32-bit programs when DEP is set to the OptOut policy level. To do this, use the Data Execution Prevention tab in System Properties to selectively disable DEP for a program. For IT professionals, a new program compatibility fix that is named DisableNX is included with Windows XP SP2. The DisableNX compatibility fix disables Data Execution Prevention for the program that the fix is applied to.

 

I've asked for help with this in a programming community, but what may come of that remains to be seen. So, unless someone actually happens to know about dep I'll just have to keep investigating. (Which is difficult since I can't look into it on my own machine.)

 

Oh and I forgot to include the RichTx32.ocx in the required controls. Ooops :roleyess: I'll include it soon, but I would like to get the gpf thing sorted out first.

 

And to Darkkender and Stoffe - Thank you for taking the time to bring these things to my attention rather than just saying "Oh - it doesn't work." and never bothering to say anything. I very much appreciate it :)

Link to comment
Share on other sites

To help you in your trouble shooting I've got Win 2000. Since I've got Visual Studio 2003 the debugger automatically throws me some of my exceptions. If you want I could try to recompile the programs on my machine to see If I get the same results. Since as I recall you said you made these tolls with Visual C++, which is what I have as well. I know it's not the debugger causing the error I also doubt it is the Data Execution Prevention fix with Win XP SP2 as if it was it wouldn't effect me.

Link to comment
Share on other sites

I've uploaded 2 modified versions of the kt wav resource helper here. (It was the smallest and easiest to modify for testing purposes.) They've both been modified to give more debug info to help pinpoint exactly where the gpf is occuring and the second one has been compiled to p code instead of native code. So if you could test these and let me know the results...

 

And to Darkkender...these are written in vb5.

Link to comment
Share on other sites

Crashes out immediately. Log follows:

 

1/13/2007 5:29:42 PM Form Load Started

1/13/2007 5:29:42 PM Pre Handle Exceptions

1/13/2007 5:29:42 PM Post Handle Exceptions

1/13/2007 5:29:42 PM LoadSettings

1/13/2007 5:29:42 PM SetGamePaths

1/13/2007 5:29:42 PM Set New cMCI

1/13/2007 5:29:42 PM Pre Subclass

1/13/2007 5:29:42 PM Post Subclass

1/13/2007 5:29:42 PM EVENT: UNHANDLED EXCEPTION (EXCEPTION_EXECUTE_HANDLER (TERMINATED - Not trying to continue)): (Code: -1073741819) at 7C809D92 - eErr_EXCEPTION_ACCESS_VIOLATION

 

Edit - Both versions identical. :)

 

-Kitt

Link to comment
Share on other sites

Ok...Here's another one. This one duplicates exactly the same code for subclassing I used in the console helper.

 

Not getting any Windows Crash dialog box this time, but nothing seemingly happens when running it, other than a log file being created containing:

 

2007-01-14 02:22:32 Form Load Started
2007-01-14 02:22:32 Pre Handle Exceptions
2007-01-14 02:22:32 Post Handle Exceptions
2007-01-14 02:22:32 LoadSettings
2007-01-14 02:22:32 SetGamePaths
2007-01-14 02:22:32 Set New cMCI
2007-01-14 02:22:32 Pre Subclass
2007-01-14 02:22:32 Post Subclass
2007-01-14 02:22:32 Parse Command Line
2007-01-14 02:22:32 EVENT: UNHANDLED EXCEPTION (EXCEPTION_EXECUTE_HANDLER (TERMINATED - Not trying to continue)): (Code: -1073741819) at 7C809D92 - eErr_EXCEPTION_ACCESS_VIOLATION

Link to comment
Share on other sites

Hey KK, I'm getting the same errors as Stoffe and Kitty posted. When reading the log the Exception it seems to be throwing looks to be a windows handle exception. The problem might be in the code for creating the window or it's toolbar considering the error for dialog viewer was centered around the tooltips.

 

Uggh! Darkkender hate Dial-up. Take half hour just to post replies sometimes. Then people have fixes.

Link to comment
Share on other sites

Hey KK, I'm getting the same errors as Stoffe and Kitty posted. When reading the log the Exception it seems to be throwing looks to be a windows handle exception. The problem might be in the code for creating the window or it's toolbar considering the error for dialog viewer was centered around the tooltips.

 

 

Which test program was this for? The second or third one? If it was the third the debug log should look somewhat different.

Link to comment
Share on other sites

Thank you Stoffe - you have pointed out a second factor that all 3 programs have in common - parsing the command line. I have commented out that part of the code.

 

Test #3

 

That seems to have done it. :) Now it starts without any problems or errors at least. I'll try it out some more tomorrow and see if everything works here.

Link to comment
Share on other sites

To your last inquiry KK my post was relating to test 2.

 

And as Stoffe says Test 3 works fine. I ran the program on both my win 2K machine and our win 98 machine. So whatever magic wand you waved for test 3 apply it to the other 2 utilities and things should be good.

Link to comment
Share on other sites

Unfortunately I still need to parse the command line so I rewrote that part completely.

 

So here is Test #4.

 

This version ran without any crashes as well. :) The only problem with it I've noticed so far is that it crashes if you pick the "Find Dialog.Tlk index" menu option from the system tray icon menu if the application is minimized.

Link to comment
Share on other sites

The only problem with it I've noticed so far is that it crashes if you pick the "Find Dialog.Tlk index" menu option from the system tray icon menu if the application is minimized.

 

I've fixed this. (It was reproducible on my end.) I'll repack everything and re-upload the original pack after I've (hopefully) solved the crashing issues.

 

To shift gears...I've uploaded test copies of the 2da editor and the dialog viewer.

 

Test #5

Link to comment
Share on other sites

Well So far they startup fine for me. I haven't got a chance to test them on files yet. However the 2daeditor has an interesting feature in the Tools menu, I can associate the 2daeditor with Dialog files. I think the file association for this editor might be better if it associated with 2da files don't you KK. ;)

Link to comment
Share on other sites

I've fixed this. (It was reproducible on my end.) I'll repack everything and re-upload the original pack after I've (hopefully) solved the crashing issues.

 

To shift gears...I've uploaded test copies of the 2da editor and the dialog viewer.

 

Test #5

 

Both seem to start now, though I ran into some other problems.The 2DA editor seems to have a problem when picking the "Open" menu command to load a 2DA file. A message pops up saying:

Oops!

Error: 5

Invalid procedure call or argument

LOCATION: CommonDialogShowOpen

 

The error message does not quit the application when closed though, and the Open dialog box opens, but it does not seem to actually load the file you select (nothing happens).

 

Also in the Tools menu --> Associations the text reads "Associate me with Dialog files", which seems like an odd choice for a 2DA editor. :) Also, the "Exit" menu command in the File menu appears to do nothing.

 

* * *

 

The dialog editor says Failed to create tooltip window when starting, but at least it doesn't close after you click OK. The menu bar menus are messed up though, they are too tiny compared to the content to the point where you can't see what's in them. See screenshot below:

menufailuretf6.jpg

It seems to work to load DLG files with it though (CTRL-O). But I got a "Unknown error - Bailed test drive due to error" message while trying the Test drive feature.

Link to comment
Share on other sites

I was going to mention those same problems Stoffe. An interesting thing though is when I run dialog viewer on our Win 98 machine at home there are no error messages and the Menu's are how they should appear for a normal windows menu. I suspect the incorrectly sized menu's and the tooltip creation is possibly caused by different handlers results for the OS itself since we both are getting the same result I think it might have to do with OS built on NT 5.0 or greater Otherwise known as Win 2K & Win XP. I tested it against various resolutions on my Win 98 machine with everything fine, and tried the same on my Win 2K machine and had no change with the micro menu problem, so this furthers my suspicion of the OS related problem.

 

On a sidenote I was able to load a dialog file and I really enjoy that testdrive feature.

Link to comment
Share on other sites

Also in the Tools menu --> Associations the text reads "Associate me with Dialog files", which seems like an odd choice for a 2DA editor. :)

 

Can you tell I reuse code? At least I got a laugh out of it.

 

I worked on the 2da editor and uploaded 4 programs that use diferrent methods of owner drawing menus. All I really need to know is which work and which don't. (Just the menus on them, nothing else.)

 

Test #6

Link to comment
Share on other sites

Can you tell I reuse code? At least I got a laugh out of it.

 

I worked on the 2da editor and uploaded 4 programs that use diferrent methods of owner drawing menus. All I really need to know is which work and which don't. (Just the menus on them, nothing else.)

 

Test #6

 

In the first test application the menus were broken like in the dialog editor. In the other three they worked (though the background in the menus were discolored in application number 4; they were white instead of the usual grey behind the entries, but the divider lines still had grey background).

 

As for the 2DA Editor it worked fine to load 2DA files with now. :) Though it seems like the search function highlights all rows except the one matching the search criteria. And (don't know if this is a bug) it doesn't work to scroll down the table with the mouse wheel. Looking good otherwise, so far. :)

Link to comment
Share on other sites

As for the 2DA Editor it worked fine to load 2DA files with now. :) Though it seems like the search function highlights all rows except the one matching the search criteria. And (don't know if this is a bug) it doesn't work to scroll down the table with the mouse wheel. Looking good otherwise, so far. :)

 

The row highlighting was on purpose. The control will not allow me to specifically position a certain cell in view so I chose to highlight all rows of the specified cell and all columns of the specified cell. Sort of creating an x marks the spot. (With the specified cell not being highlighted.)

 

As for the mouse not working - mine actually does. I may have to manually send scroll commands to it. But first I'd like to get the menus working on the dialog viewer. I have uploaded another program for menu testing.

 

Test #7

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...