pub struct Uti {Show 27 fields
pub template_resref: ResRef,
pub base_item: i32,
pub name: GffLocalizedString,
pub description_unidentified: GffLocalizedString,
pub description_identified: GffLocalizedString,
pub tag: String,
pub charges: u8,
pub cost: u32,
pub stack_size: u16,
pub plot: bool,
pub add_cost: u32,
pub palette_id: u8,
pub comment: String,
pub body_variation: u8,
pub texture_variation: u8,
pub upgrade_level: u8,
pub stolen: bool,
pub identified: bool,
pub droppable: bool,
pub pickpocketable: bool,
pub non_equippable: bool,
pub new_item: bool,
pub deleting: bool,
pub upgrades: u32,
pub properties: Vec<UtiProperty>,
pub max_charges: u8,
pub model_variation: u8,
}Expand description
Typed UTI model built from/to Gff data.
ModelPart1 is declared without a member: it is the older spelling
ModelVariation falls back to, so the value lands in that field and the
label still has to be recognised.
Fields§
§template_resref: ResRefTemplateResRef. Never read by the K1 engine.
base_item: i32Base item identifier (BaseItem).
name: GffLocalizedStringLocalized item name (LocalizedName).
description_unidentified: GffLocalizedStringLocalized description shown before identification (Description).
description_identified: GffLocalizedStringLocalized description shown when identified (DescIdentified).
tag: StringItem tag (Tag).
charges: u8Charges (Charges).
cost: u32Item cost (Cost). Ignored by the engine, which computes item cost dynamically.
stack_size: u16Maximum stack size (StackSize).
plot: boolPlot item flag (Plot).
add_cost: u32Additional cost modifier (AddCost).
palette_id: u8Palette identifier (PaletteID). Never read by the K1 engine.
comment: StringToolset comment (Comment). Never read by the K1 engine.
body_variation: u8Body variation (BodyVariation). Ignored by the engine, which reads from baseitems.2da instead.
texture_variation: u8Texture variation (TextureVar). Only evaluated when the item’s 2DA model_type is exactly 1.
upgrade_level: u8Upgrade level (UpgradeLevel). Never read by the K1 engine.
stolen: boolStolen flag (Stolen).
identified: boolIdentified flag (Identified). SaveItem hardcodes this to true, so any other value is dead once a save is written.
droppable: boolDroppable flag (Dropable). Sets bit 3 of the item’s internal memory flags.
pickpocketable: boolPickpocketable flag (Pickpocketable). Sets bit 4 of the item’s internal memory flags.
non_equippable: boolNon-equippable flag (NonEquippable).
new_item: boolNew-item flag (NewItem).
deleting: boolDeleting flag (DELETING).
upgrades: u32Upgrade bitfield (Upgrades).
properties: Vec<UtiProperty>Item property entries (PropertiesList).
max_charges: u8Maximum charges (MaxCharges).
Absent, this is whatever Charges resolved to rather than a literal,
so from_gff reads it and the declaration only records the schema.
model_variation: u8Model variation (ModelVariation).
Absent entirely, the engine falls back to the older ModelPart1 label
before applying the same zero-check, so an ancient file carrying only
ModelPart1 still gets a model. That chain is why from_gff reads it.
Implementations§
Source§impl Uti
impl Uti
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.
Source§impl Uti
impl Uti
Sourcepub fn is_armor(&self) -> bool
pub fn is_armor(&self) -> bool
Returns true when this item’s BaseItem belongs to the armor family.