pub struct Utc {Show 95 fields
pub max_hp: i16,
pub first_name: GffLocalizedString,
pub last_name: GffLocalizedString,
pub description: GffLocalizedString,
pub is_pc: bool,
pub tag: String,
pub conversation: ResRef,
pub interruptable: bool,
pub age: i32,
pub gender_id: u8,
pub starting_package: u8,
pub race_id: u8,
pub subrace_name: String,
pub subrace_id: u8,
pub deity: String,
pub strength: u8,
pub dexterity: u8,
pub intelligence: u8,
pub wisdom: u8,
pub constitution: u8,
pub charisma: u8,
pub natural_ac: u8,
pub soundset_id: u16,
pub gold: u32,
pub invulnerable: bool,
pub plot: bool,
pub min1_hp: bool,
pub party_interact: bool,
pub not_reorienting: bool,
pub disarmable: bool,
pub experience: u32,
pub portrait_id: u16,
pub portrait_resref: ResRef,
pub alignment: u8,
pub color_skin: u8,
pub color_hair: u8,
pub color_tattoo1: u8,
pub color_tattoo2: u8,
pub phenotype_id: i32,
pub appearance_id: u16,
pub appearance_head: u8,
pub duplicating_head: u8,
pub use_backup_head: u8,
pub faction_id: u16,
pub challenge_rating: f32,
pub ai_state: u16,
pub bodybag_id: u8,
pub perception_id: u8,
pub willpower_bonus: i16,
pub fortitude_bonus: i16,
pub reflex_bonus: i16,
pub hp: i16,
pub max_fp: i16,
pub current_hp: i16,
pub fp: i16,
pub skill_points: u16,
pub movement_rate: u8,
pub walkrate_id: i32,
pub on_heartbeat: ResRef,
pub on_notice: ResRef,
pub on_spell: ResRef,
pub on_attacked: ResRef,
pub on_damaged: ResRef,
pub on_disturbed: ResRef,
pub on_end_round: ResRef,
pub on_dialog: ResRef,
pub on_spawn: ResRef,
pub on_rested: ResRef,
pub on_death: ResRef,
pub on_user_defined: ResRef,
pub on_blocked: ResRef,
pub on_end_dialog: ResRef,
pub classes: Vec<UtcClass>,
pub feats: Vec<u16>,
pub skills: UtcSkills,
pub equipment: Vec<UtcEquipmentItem>,
pub inventory: Vec<UtcInventoryItem>,
pub special_abilities: Vec<UtcSpecialAbility>,
pub template_resref: ResRef,
pub comment: String,
pub palette_id: u8,
pub save_will: u8,
pub save_fortitude: u8,
pub body_variation: u8,
pub texture_variation: u8,
pub morale: u8,
pub morale_recovery: u8,
pub morale_breakpoint: u8,
pub blindspot: f32,
pub multiplier_set: u8,
pub no_perm_death: bool,
pub ignore_cre_path: bool,
pub hologram: bool,
pub will_not_render: bool,
pub lawfulness: u8,
}Expand description
Typed UTC model built from/to Gff data.
Fields§
§max_hp: i16Maximum hit points (MaxHitPoints).
first_name: GffLocalizedStringLocalized first name (FirstName).
last_name: GffLocalizedStringLocalized last name (LastName).
description: GffLocalizedStringDeprecated localized description (Description).
is_pc: boolPlayer-character flag (IsPC).
tag: StringCreature tag (Tag).
conversation: ResRefConversation resref (Conversation).
interruptable: boolInterruptable flag (Interruptable).
age: i32Age (Age).
gender_id: u8Gender ID (Gender). Natively clamped by the engine to a maximum of 4.
starting_package: u8Starting package ID (StartingPackage).
race_id: u8Race ID (Race).
subrace_name: StringDeprecated textual subrace (Subrace).
subrace_id: u8Subrace ID (SubraceIndex).
deity: StringDeprecated deity field (Deity).
strength: u8Strength (Str).
dexterity: u8Dexterity (Dex).
intelligence: u8Intelligence (Int).
wisdom: u8Wisdom (Wis).
constitution: u8Constitution (Con).
charisma: u8Charisma (Cha).
natural_ac: u8Natural armor class (NaturalAC).
soundset_id: u16Sound-set ID (SoundSetFile).
gold: u32Gold carried (Gold).
invulnerable: boolInvulnerability flag (Invulnerable).
plot: boolPlot flag (Plot).
min1_hp: boolMin-1HP flag (Min1HP).
party_interact: boolParty-interact flag (PartyInteract).
not_reorienting: boolNon-reorienting flag (NotReorienting).
disarmable: boolDisarmable flag (Disarmable).
experience: u32Accumulated experience (Experience).
portrait_id: u16Portrait ID (PortraitId).
portrait_resref: ResRefPortrait resref override (Portrait).
alignment: u8Good/Evil alignment (GoodEvil). Natively clamped by the engine to a maximum of 100.
color_skin: u8Skin color index (Color_Skin).
color_hair: u8Hair color index (Color_Hair).
color_tattoo1: u8First tattoo color index (Color_Tattoo1).
color_tattoo2: u8Second tattoo color index (Color_Tattoo2).
phenotype_id: i32Deprecated phenotype (Phenotype).
appearance_id: u16Appearance ID (Appearance_Type).
appearance_head: u8Head appearance index (Appearance_Head). If 0, the engine forces this to 1 at runtime.
duplicating_head: u8Duplicating-head index (DuplicatingHead).
use_backup_head: u8Backup-head flag (UseBackupHead).
faction_id: u16Faction ID (FactionID).
challenge_rating: f32Challenge rating (ChallengeRating).
ai_state: u16AI state flags (AIState).
bodybag_id: u8Body-bag ID (BodyBag).
perception_id: u8Perception range ID (PerceptionRange).
willpower_bonus: i16Will save bonus (willbonus).
fortitude_bonus: i16Fortitude save bonus (fortbonus).
reflex_bonus: i16Reflex save bonus (refbonus).
hp: i16Base hit points (HitPoints).
max_fp: i16Maximum force points (ForcePoints).
current_hp: i16Current hit points (CurrentHitPoints).
fp: i16Current force points (CurrentForce).
skill_points: u16Unspent skill points (SkillPoints).
movement_rate: u8Movement rate ID (MovementRate).
walkrate_id: i32Walk-rate ID (WalkRate).
on_heartbeat: ResRefOn-heartbeat script (ScriptHeartbeat).
on_notice: ResRefOn-notice script (ScriptOnNotice).
on_spell: ResRefOn-spell-at script (ScriptSpellAt).
on_attacked: ResRefOn-attacked script (ScriptAttacked).
on_damaged: ResRefOn-damaged script (ScriptDamaged).
on_disturbed: ResRefOn-disturbed script (ScriptDisturbed).
on_end_round: ResRefOn-end-round script (ScriptEndRound).
on_dialog: ResRefOn-dialogue script (ScriptDialogue).
on_spawn: ResRefOn-spawn script (ScriptSpawn).
on_rested: ResRefOn-rested script (ScriptRested).
on_death: ResRefOn-death script (ScriptDeath).
on_user_defined: ResRefOn-user-defined script (ScriptUserDefine).
on_blocked: ResRefOn-blocked script (ScriptOnBlocked).
on_end_dialog: ResRefOn-end-dialog script (ScriptEndDialogu).
classes: Vec<UtcClass>Class entries from ClassList.
A creature object carries two class slots, so a longer list has nowhere
to put the rest. What the loader does with a third valid entry is not
traced; see docs/src/formats/gff/utc.md. A duplicate or out-of-range
class id is traced, and both crash the engine with 0x5f7.
feats: Vec<u16>Feat identifiers from FeatList (Feat).
skills: UtcSkillsSkill ranks from SkillList.
equipment: Vec<UtcEquipmentItem>Equipped-item entries from Equip_ItemList.
inventory: Vec<UtcInventoryItem>Inventory entries from ItemList.
special_abilities: Vec<UtcSpecialAbility>Special abilities from SpecAbilityList.
template_resref: ResRefCreature template resref (TemplateResRef).
comment: StringToolset/comment field (Comment). Never read by the K1 engine.
palette_id: u8Palette ID (PaletteID). Never read by the K1 engine.
save_will: u8Will save (SaveWill). Strictly ignored by the KOTOR engine; reads willbonus instead.
save_fortitude: u8Fortitude save (SaveFortitude). Strictly ignored by the KOTOR engine; reads fortbonus instead.
body_variation: u8Body variation (BodyVariation). Never read by the K1 engine.
texture_variation: u8Texture variation (TextureVar). Never read by the K1 engine.
morale: u8Morale (Morale). Never read by the K1 engine.
morale_recovery: u8Morale recovery (MoraleRecovery). Never read by the K1 engine.
morale_breakpoint: u8Morale breakpoint (MoraleBreakpoint). Never read by the K1 engine.
blindspot: f32Blind-spot value (BlindSpot). Never read by the K1 engine.
multiplier_set: u8Multiplier-set ID (MultiplierSet). Never read by the K1 engine.
no_perm_death: boolPermanent-death disabled flag (NoPermDeath). Never read by the K1 engine.
ignore_cre_path: boolIgnore creature pathing (IgnoreCrePath). Never read by the K1 engine.
hologram: boolHologram flag (Hologram). Never read by the K1 engine.
will_not_render: boolWill-not-render flag (WillNotRender). Never read by the K1 engine.
lawfulness: u8Deprecated lawfulness alignment (LawfulChaotic). Never read by the K1 engine.
Implementations§
Source§impl Utc
impl Utc
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.