pub struct AreMiniGameObjectScripts {
pub on_create: ResRef,
pub on_heartbeat: ResRef,
pub on_anim_event: ResRef,
pub on_hit_bullet: ResRef,
pub on_hit_follower: ResRef,
}Expand description
The Scripts struct every minigame object carries.
Read by CSWMiniGameObject::LoadScripts, which obstacles use directly and
vehicles extend (see AreMiniGameVehicleScripts). Every slot defaults to
an empty resref and the engine writes that empty value into the script slot
whether or not the file supplied one, so an absent field clears a prior
script rather than leaving it in place.
OnHeartbeat is the fifth and last slot the base reads, after
OnAnimEvent.
It was missing from the write-up of this subsystem, and from the corpus scan the write-up was checked against, because the ARE root carries a script field under the same label: a scan keyed on bare labels sees the root’s and counts the nested one as already modelled.
Fields§
§on_create: ResRefFired when the object is created (OnCreate).
on_heartbeat: ResRefFired on the object’s heartbeat (OnHeartbeat).
on_anim_event: ResRefFired on a model animation event (OnAnimEvent).
on_hit_bullet: ResRefFired when a bullet hits the object (OnHitBullet).
on_hit_follower: ResRefFired when a track follower hits the object (OnHitFollower).
Implementations§
Source§impl AreMiniGameObjectScripts
impl AreMiniGameObjectScripts
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 AreMiniGameObjectScripts
impl Clone for AreMiniGameObjectScripts
Source§fn clone(&self) -> AreMiniGameObjectScripts
fn clone(&self) -> AreMiniGameObjectScripts
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 AreMiniGameObjectScripts
impl Debug for AreMiniGameObjectScripts
Source§impl Default for AreMiniGameObjectScripts
impl Default for AreMiniGameObjectScripts
Source§impl HasSchema for AreMiniGameObjectScripts
impl HasSchema for AreMiniGameObjectScripts
Source§impl PartialEq for AreMiniGameObjectScripts
impl PartialEq for AreMiniGameObjectScripts
Source§fn eq(&self, other: &AreMiniGameObjectScripts) -> bool
fn eq(&self, other: &AreMiniGameObjectScripts) -> bool
self and other values to be equal, and is used by ==.