pub struct GitDoorCommon {
pub appearance: u32,
pub linked_to: String,
pub linked_to_flags: u8,
pub linked_to_module: ResRef,
pub object_id: Option<ObjectId>,
pub transition_destination: GffLocalizedString,
}Expand description
A door instance placed in the area (struct type 8).
Doors use Bearing for orientation and X/Y/Z for position (not
XPosition/YPosition/ZPosition).
Unlike GitWaypoint, a static door placement genuinely does resolve its
TemplateResRef against a .utd blueprint, and it carries the same
transition group a trigger does. This type modelled neither for a while,
which meant round-tripping any vanilla module returned doors with no
blueprint to instantiate from and no tag to reference. See
docs/src/formats/gff/utd.md’s “Save versus Template Load Paths”.
§Tag is dead here, and deliberately unmodelled
A templated door takes its tag from the .utd blueprint and the
placement’s copy has no overlay to win through, so setting one is a modder
trap rather than a harmless leftover: nothing happens, silently.
docs/src/architecture.md uses exactly this field as its worked example of
the projection rule’s “at that path is the whole test”, and
docs/src/formats/gff/git.md covers the consequence, that two placements
sharing a blueprint end up with the same tag – for every templated object
The part of a door entry that is what every door entry carries, whichever form it takes.
Both arms flatten it and the list’s element is it, so the labels here are one declaration reached from both forms rather than two copies.
Fields§
§appearance: u32Visual model override (Appearance).
Read on a sparse placement as well as a saved one: LoadDoor and
LoadPlaceable are the same field readers whichever path calls them,
so a template-referencing placement carrying its own Appearance has
that value read as an override on top of the blueprint’s. Read as a
DWORD and truncated to a byte, which for a door keys doortypes.2da’s
model columns. Defaults to 0 when absent.
Read by LoadDoor and truncated to a byte, then used to key
doortypes.2da. The absent value is the door struct’s own
zero-initialized member rather than a literal, which is where this
parts from the placeable’s otherwise identical field.
linked_to: StringDestination object tag within that module (LinkedTo).
linked_to_flags: u8What Self::linked_to names (LinkedToFlags).
linked_to_module: ResRefDestination module for a transition door (LinkedToModule).
object_id: Option<ObjectId>Runtime object ID (ObjectId). Save-game only.
Runtime object id (ObjectId), which only a saved form carries.
The area-level dispatcher reads it once per element ahead of the static-versus-saved branch, so the engine reads it on both forms and the liveness below is right. What it does not do is author it: every element the engine saves carries one and no element the toolset shipped does. Held as the absence so writing a static placement back does not invent a runtime id for it.
transition_destination: GffLocalizedStringPlayer-facing name of the destination (TransitionDestin).
Implementations§
Source§impl GitDoorCommon
impl GitDoorCommon
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.
Trait Implementations§
Source§impl Clone for GitDoorCommon
impl Clone for GitDoorCommon
Source§fn clone(&self) -> GitDoorCommon
fn clone(&self) -> GitDoorCommon
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GitDoorCommon
impl Debug for GitDoorCommon
Source§impl Default for GitDoorCommon
impl Default for GitDoorCommon
Source§impl HasSchema for GitDoorCommon
impl HasSchema for GitDoorCommon
Source§impl PartialEq for GitDoorCommon
impl PartialEq for GitDoorCommon
Source§fn eq(&self, other: &GitDoorCommon) -> bool
fn eq(&self, other: &GitDoorCommon) -> bool
self and other values to be equal, and is used by ==.