Each Infinity Engine game has at least one TLK file with it. Only one of these files will be used at a time. These files contain several strings (with some associated information) which are looked up by a 32-bit identifier called a "Strref" (String Reference). If the designer wishes to replace all the dialog (for instance, to translate to another language), it is a very simple matter of replacing just one file, (sound files not included). Anyway, this is a very straightforward file format. To find a particular string, use the Strref as a 0-based index into the table of entries.
Overall structure
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 4 (char array) | Signature ('TLK ') |
| 0x0004 | 4 (char array) | Version ('V1 ') |
| 0x0008 | 2 (word) | unknown (always 0?) |
| 0x000a | 4 (dword) | Number of Strref entries in this file. |
| 0x000e | 4 (dword) | Offset to string data |
This section is hardcoded to start at byte 18 from the beginning of the file. The string offsets are relative to the strings section.
| Offset | Size (datatype) | Description |
|---|---|---|
| 0x0000 | 2 (word) | 2 == entry unused? (i.e. ignore other fields), 3 == normal? |
| 0x0002 | 8 (resref) | resource name of the associated sound, if any |
| 0x000a | 4 (dword) | Volume variance. |
| 0x000e | 4 (dword) | Pitch variance. |
| 0x0012 | 4 (dword) | offset of this string relative to the strings section |
| 0x0016 | 4 (dword) | length of this string |
This section is entirely composed of ASCIIZ strings. All the indexing for these strings is done in the strref entries section.
[ back to index ]