Skip to main content

Module uti

Module uti 

Source
Expand description

Typed UTI (.uti) item blueprint and conversion helpers. UTI (.uti) typed generic wrapper.

Items cover all loot, weapons, armour and usable gear: how the item appears on a character, the properties and stat bonuses it applies, its cost, and how it behaves once dropped into the world.

§Scope

  • Typed access for all engine-read and toolset item fields.
  • Typed handling for PropertiesList item-property entries.

§Field Layout (simplified)

UTI root struct
+-- TemplateResRef / Tag / Comment
+-- BaseItem / Charges / Cost / StackSize / AddCost
+-- MaxCharges / Upgrades
+-- LocalizedName / Description / DescIdentified
+-- ModelVariation / BodyVariation / TextureVar
+-- Plot / Stolen / Identified / UpgradeLevel
+-- Dropable / Pickpocketable / NonEquippable / NewItem / DELETING
`-- PropertiesList                 (List<Struct>)
    +-- PropertyName / Subtype
    +-- CostTable / CostValue
    +-- Param1 / Param1Value
    +-- ChanceAppear
    `-- UpgradeType (optional)

§Two fields our reader works out from a sibling

MaxCharges falls back to Charges and ModelVariation to ModelPart1. Their entries record that a value is produced without modelling how, for the reason the engine side already refuses the same thing: a derivation in a static table would be a small expression language serving two fields. Both derivations are in Uti::from_gff, where they read as code.

Structs§

Uti
Typed UTI model built from/to Gff data.
UtiProperty
One entry of an item’s PropertiesList.

Enums§

UtiError
Errors produced while reading or writing typed UTI data.

Functions§

author_uti
Authors the UTI file the typed view describes, into a writer.
author_uti_to_vec
Authors the UTI file the typed view describes, as bytes.
is_armor_base_item
Returns true when base_item belongs to the canonical armor base-item set.
read_uti
Reads typed UTI data from a reader at the current stream position.
read_uti_from_bytes
Reads typed UTI data directly from bytes.