Expand description
Typed DLG (.dlg) model and conversion helpers.
DLG (.dlg) typed generic wrapper.
DLG resources are GFF-backed dialogue trees. The structure is a directed graph of entry nodes (NPC lines) and reply nodes (PC choices), connected by indexed links.
§Scope
- Typed access for conversation config, stunt list, and all node fields.
- Typed entry/reply node arrays with per-node text, scripts, camera, and animation data.
- Typed links (condition script + target index + display-inactive flag).
- Full serialization from scratch - all modeled fields are written explicitly without relying on source struct passthrough.
§Field Layout (simplified)
DLG root struct
+-- CameraModel / DelayEntry / DelayReply / Skippable / ConversationType
+-- EndConversation / EndConverAbort / ComputerType / AmbientTrack
+-- UnequipItems / UnequipHItem / AnimatedCut / OldHitCheck
+-- StartingList[] (links -> EntryList by index)
+-- EntryList[] (NPC lines, each with RepliesList[])
+-- ReplyList[] (PC choices, each with EntriesList[])
`-- StuntList[] (cutscene actor models)§Fields vanilla writes that nothing reads
A corpus run flags five labels present in real .dlg files that no view
writes, and they are all authoring metadata the engine never looks at:
| field | where |
|---|---|
NumWords | most entries and replies |
VO_ID | most nodes |
IsChild | links |
Comment | nodes |
LinkComment | links |
None of the five exists as a string literal anywhere in the executable,
so no field read can reach them on any code path. That is a stronger
claim than “the loader we traced ignores them”: there is no loader that
could. The engine also contains no word-counting logic, which rules out
NumWords being recomputed on save rather than read.
They stay unmodelled deliberately, per the projection rule. This note exists so the next corpus run does not buy the same answer twice.
One loose end: IsChild and LinkComment co-occur on links, and why
they travel together is not answerable from the engine, since neither is
reachable from it. It is a question about the authoring toolchain rather
than the runtime.
Structs§
- Dlg
- Typed DLG model built from/to [
Gff] data. - DlgAnimation
- A per-node animation entry.
- DlgLink
- A link between dialogue nodes (condition + target index).
- DlgNode
- A dialogue node (entry = NPC line, reply = PC choice).
- DlgStunt
- A cutscene stunt actor entry.
Enums§
- DlgError
- Errors produced while reading or writing typed DLG data.
Functions§
- read_
dlg - Reads typed DLG data from a reader at the current stream position.
- read_
dlg_ from_ bytes - Reads typed DLG data directly from bytes.
- write_
dlg - Writes typed DLG data to an output writer.
- write_
dlg_ to_ vec - Serializes typed DLG data into a byte vector.