Skip to main content

Module dlg

Module dlg 

Source
Expand description

Typed DLG (.dlg) dialogue tree 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)

§Unmodelled fields

Five labels vanilla .dlg files carry are not modelled here and are dropped by a round trip: NumWords, VO_ID, IsChild, Comment and LinkComment. None exists as a string in the executable, so no reader can reach them and there is nothing to project. The evidence is in docs/src/internals/unread_fields.md.

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).
DlgLinkDisplayInactive
What a RepliesList element carries beyond a link’s own four labels.
DlgNode
A dialogue node (entry = NPC line, reply = PC choice).
DlgNodeEntriesTail
What a ReplyList element carries beyond a node’s own twenty-six.
DlgNodeRepliesTail
What an EntryList element carries beyond a node’s own twenty-six.
DlgStunt
A cutscene stunt actor entry.

Enums§

DlgError
Errors produced while reading or writing typed DLG data.

Constants§

SOUND_EXISTS_ABSENT
What SoundExists resolves to when a node does not carry it.

Functions§

author_dlg
Authors the DLG file the typed view describes, into a writer.
author_dlg_to_vec
Authors the DLG file the typed view describes, as bytes.
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.