Index  •  2DA  •  Effects  •  File Formats  •  Actions  •  Identifiers  •  Triggers  •  Appendices  •  Site Info  •  Legal

TLK file format

Applies to:
BG1, BG1: TotS, BG2, BG2: ToB, PST, IWD, IWD:HoW, IWD:TotL, IWD2


General Description
Most strings shown in Infinity Engine games are stored in a TLK file, usually dialog.tlk (for male/default text) and/or dialogf.tlk (for female text). Strings are stored with associated information (e.g. a reference to sound file), and are indexed by a (0-indexed) 32 bit identigier called a "Strref" (String Reference). Storing text in this way allows for a game to be easily swapped between languages.

Detailed Description
Overall structure


Offset Size (data type) Description
0x0000 4 (char array) Signature ('TLK ')
0x0004 4 (char array) Version ('V1 ')
0x0008 2 (word) Language ID
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 (data type) Description
0x0000 2 (word)
  • 00 - No message data
  • 01 - Text exists
  • 02 - Sound exists
  • 03 - Standard message. Ambient message. Used for sound without text (BG1) or message displayed over characters head (BG2) , Message with tags (for instance <CHARNAME>) for all games except BG2
  • 07 - Message with tags (for instance <CHARNAME> ) in BG2 only
0x0002 8 (resref) Resource name of associated sound
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