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
| Property | Value |
|---|---|
| Extension(s) | .tlk |
| Magic Signature | TLK / V3.0 |
| Type | Localized String Bundle |
| Rust Reference | View 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 Event | Ghidra Provenance & Engine Behavior |
|---|---|
| Magic Check | Function: 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 Dispatching | Function: 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 Dialects | Function: CTlkFile::AddFileWhen 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. |