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.

TalkEd v1.0.4b (TLK editor)

Page: 1 of 1
 stoffe
09-15-2005, 8:22 PM
#1
(There is a separate version of this utility adapted to work with Jade Empire as well. See this thread (http://www.lucasforums.com/showthread.php?t=177647) to find it.)

EDIT: While TalkEd was made as a helper application for the TSLPatcher (http://www.lucasforums.com/showthread.php?t=149285) I figured it might be worthy of its own thread since it can be used as a stand-alone TLK file editor as well.

TalkEd is a dialog.tlk (or any TLK v3.0 file for that matter) editor that works with both KotOR1 and TSL. It can add new entries to a TLK file and edit or delete existing ones. It can create new TLK files from scratch or edit existing ones, and is capable of merging two TLK files together.

In addition it can be used to search among the entries in a TLK file for matches to a number of criteria.

(Dialog.tlk is the file that contains all the standard text strings in the game. It also links sound files to certain text strings.)

* * *

In a sudden burst of inspiration I finished a whole bunch of things I had planned for TalkEd but never gotten around to. I have uploaded the resulting TalkEd v1.0.4b version here (http://www.starwarsknights.com/tools.php#de).

What has changed in this version? Some things off the top of my head:


It now keeps track of the file it has loaded and can save it without every time popping up a Save dialog asking you to name the file.
You can doubleclick an entry in the grid to edit it without having to use the Menu or keyboard shortcut.
It will only warn about closing a file or the application if you've actually made changes to that file.
Added a "drag thing" (what are they called?) between the grid and the text display box, making them independently resizable.
Added displaying sound Resrefs for an entry in a separate column in the main listing.
Added new search filter to only list entries which has a sound file referenced.
Added new command in the Tools menu (http://img93.imageshack.us/img93/1319/talked7uh.jpg) to delete TLK entries.
Added new command in the Tools menu (http://img93.imageshack.us/img93/1319/talked7uh.jpg) to mass-add blank padding entries.
Fixed some minor bugs I discovered.
Lots of minor interface annoyances making it a little easier to work with.


Since my programming skills leaves a lot to be desired I'm sure there are still a bug or two which I haven't spotted during my testing. As such this is still considered a beta version. If anyone uses this and spots any problems, please let me know.
 TheOssusKeeper
09-16-2005, 5:09 AM
#2
Awesome, just downloaded it :thumbsup:
 Bunk
11-16-2005, 1:56 PM
#3
Hi Stoffe,

I was looking for something in particular regarding tlk files, and I'm wondering if this tool might help me.

I need a way to compile a list (hopefully in excel) of every character's lines in the game, and the name of the sound file associated with it.

Essentially, I'd like to reuse the existing dialog tracks in the game in new ways, but trying to figure out what lines are available and which sound file goes with which line of dialogue would be a huge task. Do you think there is any way I could generate a list?
 stoffe
11-16-2005, 4:00 PM
#4
I was looking for something in particular regarding tlk files, and I'm wondering if this tool might help me.

I need a way to compile a list (hopefully in excel) of every character's lines in the game, and the name of the sound file associated with it.

Essentially, I'd like to reuse the existing dialog tracks in the game in new ways, but trying to figure out what lines are available and which sound file goes with which line of dialogue would be a huge task. Do you think there is any way I could generate a list?

You can use TalkEd to search for all entries which has a sound associated with it by doing a search where you only check the "Match entries with any sound" checkbox. There is currently no way of exporting the listed entries though, but if there is interest I could add a command to save the listed entries to a text file.

However, there's no way of knowing from dialog.tlk alone where the entries are used (dialogs, soundsets, interface etc).

Further, most spoken lines in DLG files have their voiceover files set in the DLG file for each node, and have no sound associated with the text in dialog.tlk. Thus if you are only interested in which VO sound files are used in conversations in the game you'd have to go through all DLG files in the game, rather than the dialog.tlk file, and check the values of the VOresref(sp?) fields.

If this is what you want, and there is no easier way of doing it, I could make a quick tool which opens a DLG file and dumps all the values in the Conversation text and VO-resref fields to a text file. You'd need to open each file manually though since I've been too busy recently to find the time to finish my RIM and BIF reading classes (which would be needed to automatically check all DLG files in the game), so it would still be loads of work involved.
 Bunk
11-16-2005, 4:30 PM
#5
If this is what you want, and there is no easier way of doing it, I could make a quick tool which opens a DLG file and dumps all the values in the Conversation text and VO-resref fields to a text file. You'd need to open each file manually though since I've been too busy recently to find the time to finish my RIM and BIF reading classes (which would be needed to automatically check all DLG files in the game), so it would still be loads of work involved.

This sounds like about the only option I would have. Essentially what I want to do is compile a big list of:

"Speaker","Text String of what is said","File Name of the VO-resref that goes with it"

If you could write something that would just let me open the file, and display the relevent info (or even better, copy it to the clipboard) - that would be amazing. I'll do the work of opening all the dialogues and combining all of it in to one list.

If you do feel like writing it, I'll certainly share the end results here. A list like this will make things so much easier for reusing existing dialogue within the game, whether it be for new dialogues for existing characters, or creating simple dialogues for new NPCs.
 stoffe
11-16-2005, 6:27 PM
#6
This sounds like about the only option I would have. Essentially what I want to do is compile a big list of:

"Speaker","Text String of what is said","File Name of the VO-resref that goes with it"

If you could write something that would just let me open the file, and display the relevent info (or even better, copy it to the clipboard) - that would be amazing. I'll do the work of opening all the dialogues and combining all of it in to one list.

If you do feel like writing it, I'll certainly share the end results here. A list like this will make things so much easier for reusing existing dialogue within the game, whether it be for new dialogues for existing characters, or creating simple dialogues for new NPCs.

I've now thrown together a quick tool that (hopefully) will do what is described above. You can get it here (http://www.algonet.se/~stoffe/DLGDump.rar).

Be warned however that it is very minimally tested so it's possible there are bugs around which I haven't spotted yet. It also has essentially no error handling at all, so if it for some reason can't read a DLG file you have opened the whole operation will likely stop. If you spot anything that's obviously broken let me know and I'll have a look at it.

That said, start the EXE and click the Open DLG files button. You will first be asked to open your dialog.tlk file, which it'll need to fetch the conversation text. Then you will be asked to select the DLG files to read. You can use the standard techniques of holding down SHIFT and/or CTRL to select multiple DLG files in the open box.

When the files have been selected the application will go through them and list all dialog entries which has a value (ie sound file) set in the VO_ResRef field. The results will be listed in the box below the buttons in the format:

"filename","speaker","dialog text","VO resref"

Speaker will be displayed as OBJECT_SELF if the field is empty in the DLG file. Filename is the name of the DLG file the entry was found in. You can either select the text in the box and copy/paste it, or click the button above the box to save its content to a text file. It will be saved as results.txt in the same folder as the EXE.

Since this tool is only an hour old its very rough around the edges, but hopefully it will be of some help at least. :)

Finally, be warned that this thing is not optimized at all, so if you select many or large files at a time it may take quite some time to finish working. It will pop up a message box when it's done to inform you of the fact.
 Bunk
11-16-2005, 6:30 PM
#7
Amazing stuff, thank you very much. I'll test it out tonight.
 Pavlos
07-08-2006, 1:07 PM
#8
Nice tool, stoffe (Pretty much, as always).

Is there any chance that rather than having to double click on a StrRef to bring up the editing form, we can just edit it in the text box space beneath it? You could also place the options for sounds et cetera along side this box. This just makes committing things to the .TLK that much easier.

Another little request is: Can you cause the "Text present" option to be automatically selected. Sometimes it gets a little annoying when you forget to check that box :).

Thank you for your time.
 stoffe
07-09-2006, 7:12 AM
#9
Is there any chance that rather than having to double click on a StrRef to bring up the editing form, we can just edit it in the text box space beneath it? You could also place the options for sounds et cetera along side this box. This just makes committing things to the .TLK that much easier.


I'm not sure I agree it would be "much easier" to only have to singleclick rather than doubleclick, which would be the only difference. :) I prefer trying to avoid the "web page" syndrome for user interface design where everything is crammed into the same window. Still, I suppose I could make the preview text box editable if others prefer it that way instead. I'll add it to the ToDo list to have a look at when I'm in the mood for some Delphi programming. :)


Another little request is: Can you cause the "Text present" option to be automatically selected. Sometimes it gets a little annoying when you forget to check that box :).


Hmm, when does this happen? If I pick "New entry" in the Tools menu all three "flags" checkboxes start out being already checked. Which version are you using?
 stoffe
10-03-2006, 9:25 AM
#10
I have uploaded an updated version of TalkEd, v1.0.4b, which fixes a couple of problems related to loading and saving TLK files containing very long (4000+ character) text entries, where they would get truncated instead of read and saved properly. (Big thanks to tk102 for pointing out this error.)

There were no such long strings in dialog.tlk for TSL so it would only affect long entries added by mods for that game. The dialog.tlk file for KotOR1 however did contain a few very long string entries, so if you plan on using TalkEd with that game you should get this version to avoid messing up those entries in the TLK file.

Aside from that I've fixed a few minor interface annoyances as well. The download link is in the first post in this thread if you want it.
 Eldir
12-19-2006, 10:59 PM
#11
Hi, I'm trying to translate some parts of the dialogue into Korean for personal use. I've tried inserting a few Korean words into a line to see how it worked. The changes were indeed reflected into the game, but the problem is, the characters were not encoded properly and were incomprehensible. (They show up fine in the editor, though.) Is there some way I could add Korean support to the program, or maybe to the game itself?
 stoffe
12-20-2006, 7:23 AM
#12
Hi, I'm trying to translate some parts of the dialogue into Korean for personal use. I've tried inserting a few Korean words into a line to see how it worked. The changes were indeed reflected into the game, but the problem is, the characters were not encoded properly and were incomprehensible. (They show up fine in the editor, though.) Is there some way I could add Korean support to the program, or maybe to the game itself?

I am unfamiliar with how written Korean language works so I am not sure if it is possible.

However, the game does not use regular fonts for the text shown in-game, but rather a set of images that contains the letters it displays. Look in swpc_tex_gui.erf with KotorTool for the images whose names start with fnt_ (for example fnt_d16x16.tpc). You'd probably need to replace the roman letters with korean ones at the very least. Don't know if that is enough though.
 tk102
12-20-2006, 11:41 AM
#13
I believe you're correct on this point stoffe -mkb- in the fact that the strings returned from the TLK file for display are interpreted byte-to-character ratio of 1:1. That is to say, although the TLK file appears that it could support Unicode, the rendering of the characters by the game engine does not.
 Eldir
12-28-2006, 9:48 PM
#14
I believe you're correct on this point stoffe -mkb- in the fact that the strings returned from the TLK file for display are interpreted byte-to-character ratio of 1:1. That is to say, although the TLK file appears that it could support Unicode, the rendering of the characters by the game engine does not.

Oh, I see. I guess that explains why no one's done a Korean-language patch. Thank you kindly for your answers. :)
 renanbianchi
09-01-2009, 1:07 PM
#15
stoffe, is there a way to separate the Xbox version text strings from the PC version text strings?

I noticed that they use different strings for each version when i ported the Brazillian portuguese pc translated file to the Xbox.
 stoffe
09-07-2009, 6:12 AM
#16
stoffe, is there a way to separate the Xbox version text strings from the PC version text strings?

I noticed that they use different strings for each version when i ported the Brazillian portuguese pc translated file to the Xbox.

I'm afraid I have no idea, I don't have the X-box versions of the games so I have no idea how they store the data or how you can mod it. The standard TLK files used by the PC versions can only contain a single string for each entry in the TLK file, and it uses different TLK files for different language versions of the game.
Page: 1 of 1