PDA

View Full Version : Translating KotOR and TLS mods


Januszka
09-30-2006, 07:31 PM
Hey, I was interested in translating some mods. Are the dialogues someway located in some specific files, or that depends on the mod itself?
I saw some of them come with an "append.tlk" file (I guess this file appends that text into your dialog.tlk file) but others that dont, so I dont know where the texts could be located.
Could someone please help me? :)

stoffe
09-30-2006, 07:56 PM
Hey, I was interested in translating some mods. Are the dialogues someway located in some specific files, or that depends on the mod itself?
I saw some of them come with an "append.tlk" file (I guess this file appends that text into your dialog.tlk file) but others that dont, so I dont know where the texts could be located.
Could someone please help me? :)

Dialog is located in DLG files. A dialog file usually either keeps all conversations with a particular NPC, or a dialog for a specific occasion.

In the case of the standard game they are divided into "global" DLG files that can be accessed from anywhere (kept in dialogs.bif in KotOR2:TSL and in templates.bif in KotOR1) and module specific ones (kept in the modulename_s.rim files for each module for KotOR1, or in the modulename_dlg.erf files for each module in KotOR2:TSL).

For mods the .DLG files are usually either put in the override folder, or kept inside the .MOD or .RIM files included with the mod. How the dialog there is divided is up to the individual modder's design.

The difference between standard game DLG files and DLG files that are created by modders is usually that standard DLG files do not contain the conversation text itself, but refers to dialog.tlk entries where the text is kept. Modded DLG files however usually contain all the dialog text itself, kept within ExoLocString fields.

ExoLocString is a type of data field in GFF format files (which DLG files are) that can either reference a dialog.tlk entry, or contain one or many localized substrings of text. Each substring is associated with a language+gender ID value, and which of the substrings the game picks to display the text depends on the language setting of the game (which is set within the dialog.tlk file as well).

This is the reason why english language mods usually only show blank strings in dialog (and character/item names etc) when used with non-english language games. English modders put all their text strings in ExoLocString substrings with Language+gender ID 0 (English+Male). Since this does not match the (dialog.tlk) language setting of non-English games that substring is not used, and since no substring for the corresponding language setting is found no text will be shown.

(Hence why it's often desirable for people with non-English games wanting to play English mods to change their dialog.tlk language setting to English in order to fool the game into using the English+Male substrings those mods use to contain their text.)


About the gender part: Since the English language doesn't vary that much depending on the gender of the person or object spoken off all English text is stored in the Male variant only. For languages with different feminine forms, like French, all text is stored double in both the the masculine and feminine forms. All text must be stored double even if they are both identical though. In ExoLocStrings the female form is determined by adding +1 to the language ID. For the dialog.tlk the feminine forms are kept in a separate dialogf.tlk file in parallell with the regular dialog.tlk file. At least that's how I understand it, since I have an English language game (thankfully). :)

Januszka
10-01-2006, 05:29 AM
Oof then I have lots of things to study if I want to translate any heheh.

BTW, I dont know about french version, but spanish didnt come with dialogf.tlk so it was a mess up since original translation was random in the gender, sometimes they talked to you as if you were man and some others female. (and that's what we did in my site: creating a dialogf.tlk and correcting the gender errors :) , and some other crazy errors too)

Anyway, if I want to translate a mod, then should I just translate the .dlg files or anything else besides? I guess, with a .dlg editor of course.
And what if the dlg are kept in .mod or .rim files? And what if the mod has an append.tlk?

Thanks a lot!! :)

stoffe
10-01-2006, 01:55 PM
Anyway, if I want to translate a mod, then should I just translate the .dlg files or anything else besides? I guess, with a .dlg editor of course.
And what if the dlg are kept in .mod or .rim files? And what if the mod has an append.tlk?


I think tk102's DLG Editor has support for different language settings so you should be able to use it. Check the menus for the option to set another language to save the text for.

As for other modded files, the DLG files should contain the majority, but there are also things like item names and descriptions kept in .UTI files, character names kept in .UTC files, names of placeables (selectable objects in an area) kept in .UTP files and quest journal text kept in the global.jrl file. All those are GFF format files, so custom text tend to be kept in ExoLocString fields within them and can be translated that way.

Aside from that, some 2DA files have references to text as well. Since 2DA files usually can't store the text strings themselves they tend to contain StrRefs into the dialog.tlk file instead. This is for example for things like names and descriptions of force powers and feats. Such mods usually either come with a modified dialog.tlk file where the new strings have been added, or a mod installer that modifies the mod user's dialog.tlk file, adding the needed entries and updating the 2DA files to point to them.

The append.tlk files you mention serve this purpose for the TSLPatcher mod installer. They contain the entries that are supposed to be added to the dialog.tlk file. So, if you want to translate such a mod prior to its installation you could change the text in the append.tlk (and appendf.tlk as applicable) file(s).

Finally, some mods contain some text inside scripts, though that's a bit more unusual since the KotOR games are a bit tricky to make into displaying text on screen via scripts. For those mods you'll need to find the NSS (script source code) files for the scripts containing the strings, translate the text strings and then recompile the script and put the resulting NCS file with the mod to replace the one it currently has. (Or in the case of some mods using a mod-installer to modify and recompile scripts you can find the NSS file in the mod-installers working folder, translate it there and just save with no recompile necessary since the installer will handle that when needed.)

All those types of files except 2DA files and the global.jrl can be found inside the MOD or RIM module files for some mods as well. In those cases you'll need to extract the files you want to translate, modify them and then put them back into the ERF or RIM file you got them out of. This can be done with either KotorTool or the simple ERF/RIM Editor I made.

When translating text strings it's important to remember not to translate any tokens in the text. tokens are text inside <>, for example <FirstName> or <CUSTOM1200>. These are special keywords that will be replaced by the game engine with some other text prior to the text being displayed on-screen. If you translate what's between the <> the game won't recognize the token.

Januszka
10-01-2006, 03:19 PM
Yeah, of course I want to translate the mod before installing it (that'd be nice cause other players could make use of that translation :) Is the mod completely translated if I translate the append.tlk file or does that depend on the mod itself?

So... the mods without the append.tlk have the dialogues in the .dlg and some others inside the script... Or the mods with the append.tlk file are the only ones adding content to the dialog.tlk? Oof, Im becoming a pain in the ass heh, not used to kotor and tsl modding. Yeah, I know about tokens (mostly bcause im a bit familiar with infinity engine which also uses them). I know whats a tlk file, I know there are files .dlg but I do not know too much their structure.
Anyway, thanks a lot :)

stoffe
10-01-2006, 03:42 PM
Yeah, of course I want to translate the mod before installing it (that'd be nice cause other players could make use of that translation :) Is the mod completely translated if I translate the append.tlk file or does that depend on the mod itself?

So... the mods without the append.tlk have the dialogues in the .dlg and some others inside the script... Or the mods with the append.tlk file are the only ones adding content to the dialog.tlk? Oof, Im becoming a pain in the ass heh, not used to kotor and tsl modding. Yeah, I know about tokens (mostly bcause im a bit familiar with infinity engine which also uses them). I know whats a tlk file, I know there are files .dlg but I do not know too much their structure.
Anyway, thanks a lot :)

Mods usually only add strings to dialog.tlk (through append.tlk or otherwise) in the cases where the text cannot be kept in the other files where the text more logically belongs directly. Modifying dialog.tlk is usually avoided unless absolutely necessary since you can't make your mods very encapsulated/modular and independent if you use it. The only common cases I can think of right away is text referred to by 2DA files (spell/feat names/descriptions etc) and text barked from scripts.

In other cases, where the game files are capable of holding the text themselves, people usually don't tend to use the dialog.tlk file for that. In the case of GFF format files the text is usually kept in either ExoLocString fields or ExoString fields. There are a wide variety of game files that use the GFF format. Some can be edited in more "user friendly" ways with KotOR tool, some has to be edited with a GFF Editor directly.

It's hard to give more specific advise since the internal format of the different types of GFF format files differ greatly depending on what they are used for. If you don't have it already I'd recommend you download k-gff and try to open the mod files with it, and look around for ExoLocString and ExoString fields that hold text. They usually have labels that describe what they are for.

The major difference in thid regard (if I remember correctly) when it comes to modding between the Infinity Engine and the Aurora/Odyssey engines is that in Infinity you have to put all game text in dialog.tlk (making it a pain to distribute mods for it, at least until WeiDU and the like came along), while the ExoLocString method of storing text in each file was introduced with the Aurora engine to make Neverwinter Nights mods more independent and modular. This allows for both approaches, since an ExoLocString can hold both a dialog.tlk StrRef and localized substrings. If no StrRef is specified, the substrings are loaded instead, according to the game's language setting.