pub struct DlgNode {Show 26 fields
pub animations: Vec<DlgAnimation>,
pub text: GffLocalizedString,
pub script: ResRef,
pub speaker: String,
pub wait_flags: u32,
pub quest: String,
pub quest_entry: u32,
pub plot_index: i32,
pub plot_xp_percentage: f32,
pub delay: u32,
pub fade_type: u8,
pub fade_color: [f32; 3],
pub fade_delay: f32,
pub fade_length: f32,
pub sound: ResRef,
pub vo_resref: ResRef,
pub sound_exists: u8,
pub listener: String,
pub camera_angle: u32,
pub camera_id: i32,
pub cam_height_offset: f32,
pub tar_height_offset: f32,
pub camera_animation: u16,
pub cam_vid_effect: i32,
pub cam_field_of_view: f32,
pub links: Vec<DlgLink>,
}Expand description
A dialogue node (entry = NPC line, reply = PC choice).
Entry and reply nodes share the same field layout. The difference is which
link list they carry: entry nodes have RepliesList, reply nodes have
EntriesList. The Dlg struct handles serializing the correct field
name based on position.
Fields§
§animations: Vec<DlgAnimation>Lip-sync animations (AnimList).
text: GffLocalizedStringLocalized display text (Text).
script: ResRefScript to run when this node fires (Script).
speaker: StringSpeaker tag override (Speaker).
Vanilla leaves the label out where it would be the empty string the
read substitutes.
wait_flags: u32Wait flags (WaitFlags).
quest: StringJournal quest tag (Quest).
quest_entry: u32Journal quest entry ID (QuestEntry).
plot_index: i32Plot index (PlotIndex).
plot_xp_percentage: f32Plot XP percentage (PlotXPPercentage).
delay: u32Delay in milliseconds (Delay). The sentinel value 0xFFFFFFFF instructs the engine to read from the root delay_entry / delay_reply instead and modulate wait_flags. With no sound and parent delay 0, the node terminates instantly.
fade_type: u8Fade type (FadeType).
fade_color: [f32; 3]Fade color as RGB floats (FadeColor). GFF Vector3 type. Discarded if FadeType is 0.
fade_delay: f32Fade delay in seconds (FadeDelay). Discarded if FadeType is 0.
fade_length: f32Fade length in seconds (FadeLength). Discarded if FadeType is 0.
sound: ResRefSound resref (Sound). If playback fails, the engine falls back to vo_resref.
vo_resref: ResRefVoice-over resref (VO_ResRef). Played as a fallback when sound fails to execute.
sound_exists: u8Sound-presence bitmask (SoundExists).
A bitmask rather than a flag, which is why it is a byte. An absent one
resolves to SOUND_EXISTS_ABSENT, a value a boolean could not carry,
and the engine forces it to 0 at runtime when both Sound and
VO_ResRef fail to resolve.
listener: StringListener tag override (Listener).
camera_angle: u32Camera angle preset (CameraAngle).
camera_id: i32Static camera ID (CameraID). Ignored by engine unless CameraAngle is 6.
cam_height_offset: f32Camera height offset (CamHeightOffset).
tar_height_offset: f32Target height offset (TarHeightOffset).
camera_animation: u16Camera animation ID (CameraAnimation).
cam_vid_effect: i32Camera video effect (CamVidEffect).
cam_field_of_view: f32Camera field of view (CamFieldOfView). Aggressively validated; the engine forces this to -1.0 if the field is missing or explicitly negative.
links: Vec<DlgLink>Links to the next nodes. For entry nodes these point into ReplyList;
for reply nodes they point into EntryList.
No #[gff], because the label is the list’s rather than this type’s:
it is declared on DlgNodeRepliesTail and DlgNodeEntriesTail,
and both codec halves are this type’s for the same reason.
Implementations§
Source§impl DlgNode
impl DlgNode
Sourcepub const PARTS: &'static [&'static [Field]]
pub const PARTS: &'static [&'static [Field]]
This type’s schema in parts, which is what a container holding it references.
Own fields first, then one part per flattened child in the order they are declared.
Sourcepub fn read_declared(root: &GffStruct) -> Self
pub fn read_declared(root: &GffStruct) -> Self
Reads every declared field off root.
Absent fields take the entry’s own answer, so a fallback is derived from the declaration rather than restated beside it.
A field declaring a hand-written read is left at that answer for the view to overwrite.
Sourcepub fn write_declared(&self, root: &mut GffStruct)
pub fn write_declared(&self, root: &mut GffStruct)
Writes every declared field onto root, leaving out the ones
their entry says the engine’s own writer leaves out.
A field declaring a hand-written write is not touched here.
Sourcepub fn read_element(structure: &GffStruct) -> Self
pub fn read_element(structure: &GffStruct) -> Self
Reads one element of a list of this type.
Sourcepub fn write_element(&self, structure: &mut GffStruct)
pub fn write_element(&self, structure: &mut GffStruct)
Writes one element of a list of this type.