Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

TLK (Talk Table)

The Talk Table is a massive localized string repository. Every item description, line of dialogue, and UI text in KOTOR references an index (a StrRef) pointing into this master dictionary file.

At a Glance

PropertyValue
Extension(s).tlk
Magic SignatureTLK / V3.0
TypeLocalized String Bundle
Rust ReferenceView rakata_formats::Tlk in Rustdocs

Data Model Structure

The entire Talk Table format maps to the rakata_formats::Tlk struct. Each entry fuses the separated audio and text flags into a single TlkEntry. The struct safely handles missing text flags natively, preventing out-of-bounds string lookups if an entry contains audio parameters but no valid string text offset.

Engine Audits & Decompilation

The following documents the engine’s exact load sequence for Talk Tables mapped from swkotor.exe.

(Decompilation logic for this section was audited and verified via native Ghidra pipeline against swkotor.exe, explicitly pulling from CTlkFile::ReadHeader at 0x0041d890 and CTlkFile::AddFile.)

Pipeline EventGhidra Provenance & Engine Behavior
Magic CheckFunction: CTlkFile::ReadHeader (0x0041d890)
The parser requires a "TLK " signature. However, strict version validation is entirely absent. The engine accepts essentially any version tag without raising a failure.
Size DispatchingFunction: CTlkFile::ReadHeader (0x0041d890)
While the version isn’t used for rejection, it dynamically determines memory block sizing. A "V3.0" tag dictates 40 bytes (0x28) per entry, whereas any other version tag automatically falls back to 36 bytes (0x24).
Feminine DialectsFunction: CTlkFile::AddFile
When mounting the primary archive, the engine systematically queries the directory for a secondary <basename>F.tlk (e.g., dialogF.tlk) specifically to supply overriding feminine vocabulary strings for character-gendered text queries.