Skip to main content

Module utc

Module utc 

Source
Expand description

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

Creatures cover every NPC and monster: identity, class and level, appearance, equipment and event scripts. The heaviest of these formats by field count, and the one that carries the most save-game state.

§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
Typed UTC one entry of ClassList.
UtcEquipmentItem
Typed UTC one entry of Equip_ItemList.
UtcInventoryItem
Typed UTC one entry of ItemList.
UtcSkills
Skill ranks mirrored from UTC SkillList index ordering.
UtcSpecialAbility
Typed UTC one entry of SpecAbilityList.

Enums§

UtcError
Errors produced while reading or writing typed UTC data.

Functions§

author_utc
Authors the UTC file the typed view describes, into a writer.
author_utc_to_vec
Authors the UTC file the typed view describes, as bytes.
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.