Module utc

Module utc 

Source
Expand description

Typed UTC (.utc) model and conversion helpers. UTC (.utc) typed generic wrapper.

UTC resources are GFF-backed creature templates.

§Coverage

  • Typed access for creature fields (identity, scripts, core stats, appearance, demographics, combat, AI, and movement).
  • Typed handling for SkillList and ClassList / canonical KnownList0 spell data.
  • Typed handling for SpecAbilityList (Spell, SpellFlags, SpellCasterLevel).
  • Typed handling for FeatList, Equip_ItemList, and ItemList.

§Field Layout (simplified)

UTC root struct
+-- TemplateResRef / Tag / Comment / Conversation
+-- FirstName / LastName               (CExoLocString)
+-- Appearance_Type / Gender / Race / FactionID / WalkRate
+-- Age / StartingPackage / Gold / Experience
+-- Color_Skin / Color_Hair / Color_Tattoo1 / Color_Tattoo2
+-- Appearance_Head / DuplicatingHead / UseBackupHead
+-- AIState / SkillPoints / MovementRate / Invulnerable
+-- Character stats / saves / HP / FP
+-- Script* hooks                      (CResRef)
+-- SkillList                          (List<Struct Rank>)
+-- ClassList                          (List<Struct>)
|   +-- Class / ClassLevel
|   `-- KnownList0                     (List<Struct Spell>)
+-- SpecAbilityList                    (List<Struct Spell/SpellFlags/SpellCasterLevel>)
+-- FeatList                           (List<Struct Feat>)
+-- Equip_ItemList                     (List<Struct EquippedRes/Dropable>)
+-- ItemList                           (List<Struct InventoryRes/...>)

Structs§

Utc
Typed UTC model built from/to Gff data.
UtcClass
One UTC class entry in ClassList.
UtcEquipmentItem
One equipped item entry from Equip_ItemList.
UtcInventoryItem
One inventory item entry from ItemList.
UtcSkills
Skill ranks mirrored from UTC SkillList index ordering.
UtcSpecialAbility
One UTC special-ability entry from SpecAbilityList.

Enums§

UtcError
Errors produced while reading or writing typed UTC data.

Functions§

read_utc
Reads typed UTC data from a reader at the current stream position.
read_utc_from_bytes
Reads typed UTC data directly from bytes.
write_utc
Writes typed UTC data to an output writer.
write_utc_to_vec
Serializes typed UTC data into a byte vector.