pub struct SavedCreature {Show 103 fields
pub tag: String,
pub first_name: GffLocalizedString,
pub last_name: GffLocalizedString,
pub description: GffLocalizedString,
pub object_id: ObjectId,
pub area_id: u32,
pub conversation: ResRef,
pub x_position: f32,
pub y_position: f32,
pub z_position: f32,
pub x_orientation: f32,
pub y_orientation: f32,
pub z_orientation: f32,
pub appearance_type: u16,
pub appearance_head: u8,
pub portrait_id: u16,
pub phenotype: i32,
pub color_skin: u8,
pub color_hair: u8,
pub color_tattoo1: u8,
pub color_tattoo2: u8,
pub duplicating_head: u8,
pub use_backup_head: u8,
pub is_disguised: u8,
pub body_bag: u8,
pub strength: u8,
pub dexterity: u8,
pub constitution: u8,
pub intelligence: u8,
pub wisdom: u8,
pub charisma: u8,
pub current_hit_points: i16,
pub hit_points: i16,
pub max_hit_points: i16,
pub pregame_current: i16,
pub force_points: i16,
pub current_force: i16,
pub max_force_points: i16,
pub armor_class: i16,
pub ref_save_throw: i8,
pub will_save_throw: i8,
pub fort_save_throw: i8,
pub ref_bonus: i16,
pub will_bonus: i16,
pub fort_bonus: i16,
pub natural_ac: u8,
pub experience: u32,
pub gold: u32,
pub skill_points: u16,
pub multiclass_level_up_in: u8,
pub joining_xp: i32,
pub starting_package: u8,
pub challenge_rating: f32,
pub age: i32,
pub race: u8,
pub subrace: String,
pub subrace_index: u8,
pub deity: String,
pub gender: u8,
pub good_evil: u8,
pub faction_id: u16,
pub sound_set_file: u16,
pub ai_state: i32,
pub not_reorienting: u8,
pub detect_mode: u8,
pub stealth_mode: u8,
pub commandable: u8,
pub listening: u8,
pub party_interact: u8,
pub plot: u8,
pub min1_hp: u8,
pub interruptable: u8,
pub disarmable: u8,
pub is_destroyable: u8,
pub is_raiseable: u8,
pub dead_selectable: u8,
pub is_pc: u8,
pub creation_script_fired: u8,
pub ambient_anim_state: u8,
pub animation: i32,
pub creature_size: i32,
pub movement_rate: u8,
pub classes: Vec<SavedClass>,
pub feats: Vec<u16>,
pub skills: UtcSkills,
pub inventory: Vec<SavedItem>,
pub equipment: Vec<SavedItem>,
pub tail: u8,
pub wings: u8,
pub on_attacked: ResRef,
pub on_damaged: ResRef,
pub on_death: ResRef,
pub on_dialog: ResRef,
pub on_disturbed: ResRef,
pub on_end_dialog: ResRef,
pub on_end_round: ResRef,
pub on_heartbeat: ResRef,
pub on_blocked: ResRef,
pub on_notice: ResRef,
pub on_rested: ResRef,
pub on_spawn: ResRef,
pub on_spell: ResRef,
pub on_user_defined: ResRef,
}Expand description
A creature as stored inside a save game’s module GIT.
Fields§
§tag: StringObject tag (Tag).
first_name: GffLocalizedStringLocalized first name (FirstName).
last_name: GffLocalizedStringLocalized last name (LastName).
description: GffLocalizedStringLocalized description (Description).
object_id: ObjectIdRuntime object id (ObjectId).
area_id: u32Runtime area id the creature belongs to (AreaId).
conversation: ResRefDialogue this creature opens (Conversation). Not a script hook.
x_position: f32World X position (XPosition).
y_position: f32World Y position (YPosition).
z_position: f32World Z position (ZPosition).
x_orientation: f32Facing X component (XOrientation).
y_orientation: f32Facing Y component (YOrientation).
z_orientation: f32Facing Z component (ZOrientation).
appearance_type: u16Appearance row (Appearance_Type).
appearance_head: u8Head appearance (Appearance_Head).
portrait_id: u16Portrait row (PortraitId). A snapshot carries only the id; a
blueprint additionally carries a Portrait resref.
phenotype: i32Body-model phenotype (Phenotype).
color_skin: u8Skin colour index (Color_Skin).
color_hair: u8Hair colour index (Color_Hair).
color_tattoo1: u8First tattoo colour index (Color_Tattoo1).
color_tattoo2: u8Second tattoo colour index (Color_Tattoo2).
duplicating_head: u8Head-duplication flag (DuplicatingHead).
use_backup_head: u8Backup-head flag (UseBackupHead).
is_disguised: u8Party-member disguise flag (PM_IsDisguised).
body_bag: u8Corpse body-bag appearance (BodyBag).
strength: u8Strength (Str).
dexterity: u8Dexterity (Dex).
constitution: u8Constitution (Con).
intelligence: u8Intelligence (Int).
wisdom: u8Wisdom (Wis).
charisma: u8Charisma (Cha).
current_hit_points: i16Live hit points (CurrentHitPoints).
hit_points: i16Base hit points carried from the template (HitPoints).
max_hit_points: i16Computed maximum hit points (MaxHitPoints). Rebuilt on load from
class levels and the Constitution modifier, so an edit here does
nothing.
pregame_current: i16Current-HP mirror (PregameCurrent). Written on every save and read
by nothing.
force_points: i16Live Force points (ForcePoints).
current_force: i16Current Force pool (CurrentForce).
max_force_points: i16Computed maximum Force points (MaxForcePoints).
armor_class: i16Computed armour class (ArmorClass). Rebuilt on load from armour
tables, natural AC, the Dexterity modifier, feats and active effects.
ref_save_throw: i8Computed Reflex save total (RefSaveThrow). Rebuilt on load.
will_save_throw: i8Computed Will save total (WillSaveThrow). Rebuilt on load.
fort_save_throw: i8Computed Fortitude save total (FortSaveThrow). Rebuilt on load.
ref_bonus: i16Permanent Reflex bonus (refbonus). Unlike the total above, this is
an input the engine reads back.
will_bonus: i16Permanent Will bonus (willbonus). Read back on load.
fort_bonus: i16Permanent Fortitude bonus (fortbonus). Read back on load.
natural_ac: u8Natural armour class (NaturalAC).
experience: u32Accumulated experience (Experience).
gold: u32Carried gold (Gold). Skipped on load for creatures currently in the
party, whose wealth lives in the shared party pool instead.
skill_points: u16Unspent skill points (SkillPoints).
multiclass_level_up_in: u8Multiclass level-up bookkeeping (MClassLevUpIn). Written on every
save and read by nothing.
joining_xp: i32Joining experience (JoiningXP). Read only by the fresh-spawn path,
so it resets to zero when a save is continued.
starting_package: u8Starting package row (StartingPackage).
challenge_rating: f32Challenge rating (ChallengeRating).
age: i32Age (Age).
race: u8Race row (Race).
subrace: StringSubrace name (Subrace).
subrace_index: u8Subrace row (SubraceIndex).
deity: StringDeity name (Deity).
gender: u8Gender row (Gender).
good_evil: u8Alignment on the light/dark axis (GoodEvil). The engine clamps this
to a maximum of 100.
faction_id: u16Faction id indexing the session faction table (FactionID).
sound_set_file: u16Sound-set row (SoundSetFile).
ai_state: i32AI state (AIState).
not_reorienting: u8Orientation-lock flag (NotReorienting).
detect_mode: u8Detect mode (DetectMode). The loader reads the byte only to step
past it and resets every restored creature to mode 1.
stealth_mode: u8Stealth mode (StealthMode).
commandable: u8Player-commandable flag (Commandable).
listening: u8Listening flag (Listening).
party_interact: u8Party-interaction flag (PartyInteract).
plot: u8Plot-protection flag (Plot).
min1_hp: u8Minimum-one-hit-point flag (Min1HP).
interruptable: u8Interruptable flag (Interruptable).
disarmable: u8Disarmable flag (Disarmable).
is_destroyable: u8Destroyable flag (IsDestroyable).
is_raiseable: u8Raiseable flag (IsRaiseable).
dead_selectable: u8Corpse-selectable flag (DeadSelectable).
is_pc: u8Player-character flag (IsPC).
creation_script_fired: u8Spawn-script-fired flag (CreatnScrptFird).
ambient_anim_state: u8Ambient animation state (AmbientAnimState).
animation: i32Current animation (Animation).
creature_size: i32Creature size row (CreatureSize).
movement_rate: u8Movement rate row (MovementRate). A blueprint spells this WalkRate.
classes: Vec<SavedClass>Class levels and known powers (ClassList).
feats: Vec<u16>Feat ids (FeatList).
skills: UtcSkillsSkill ranks (SkillList), positional as the engine stores them.
inventory: Vec<SavedItem>Carried inventory (ItemList).
equipment: Vec<SavedItem>Equipped items (Equip_ItemList).
tail: u8Tail appearance (Tail). Hardcoded to zero on read; written anyway.
wings: u8Wing appearance (Wings). Hardcoded to zero on read; written anyway.
on_attacked: ResRefOn-attacked script (ScriptAttacked).
on_damaged: ResRefOn-damaged script (ScriptDamaged).
on_death: ResRefOn-death script (ScriptDeath).
on_dialog: ResRefOn-dialogue script (ScriptDialogue).
on_disturbed: ResRefOn-disturbed script (ScriptDisturbed).
on_end_dialog: ResRefOn-end-dialog script (ScriptEndDialogu).
on_end_round: ResRefOn-end-round script (ScriptEndRound).
on_heartbeat: ResRefOn-heartbeat script (ScriptHeartbeat).
on_blocked: ResRefOn-blocked script (ScriptOnBlocked).
on_notice: ResRefOn-notice script (ScriptOnNotice).
on_rested: ResRefOn-rested script (ScriptRested).
on_spawn: ResRefOn-spawn script (ScriptSpawn).
on_spell: ResRefOn-spell-at script (ScriptSpellAt).
on_user_defined: ResRefOn-user-defined script (ScriptUserDefine).
Implementations§
Source§impl SavedCreature
impl SavedCreature
Sourcepub fn from_struct(structure: &GffStruct) -> Self
pub fn from_struct(structure: &GffStruct) -> Self
Reads a snapshot from one Creature List element.
Every field is optional: a UseTemplates = 0 element that omits one
resolves to the engine’s hardcoded default, which is what the
per-field fallbacks here reproduce.
Trait Implementations§
Source§impl Clone for SavedCreature
impl Clone for SavedCreature
Source§fn clone(&self) -> SavedCreature
fn clone(&self) -> SavedCreature
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 SavedCreature
impl Debug for SavedCreature
Source§impl Default for SavedCreature
impl Default for SavedCreature
Source§fn default() -> SavedCreature
fn default() -> SavedCreature
Source§impl PartialEq for SavedCreature
impl PartialEq for SavedCreature
Source§fn eq(&self, other: &SavedCreature) -> bool
fn eq(&self, other: &SavedCreature) -> bool
self and other values to be equal, and is used by ==.