Skip to main content

Module utp

Module utp 

Source
Expand description

Typed UTP (.utp) placeable blueprint and conversion helpers. UTP (.utp) typed generic wrapper.

Placeables are interactive scenery and containers, from footlockers to command consoles to destructible barricades. They mix static physical properties such as structural HP and lock difficulty with script bindings.

§Field Layout (simplified)

UTP root struct
+-- TemplateResRef / Tag / LocName / Description
+-- Appearance / Faction / Plot / Invulnerable / Min1HP
+-- Lockable / Locked / KeyRequired / OpenLockDC / CloseLockDC / KeyName
+-- Useable / Static / PartyInteract
+-- HP / CurrentHP / Hardness / Fort / Ref / Will
+-- Script hooks (OnClosed/OnDamaged/...)
+-- ItemList                         (List<Struct>)
|   +-- InventoryRes / Dropable
|   `-- Repos_PosX / Repos_PosY

§The lock and saving-throw fields are declared here, not shared

A placeable and a door carry the same seven lock labels and the same three saving throws. Every one of those ten is recorded stamped here against constructed on the door, so one shared entry would state the wrong mechanism for one of them. A shared reader is still right, since the value is the same; the record of how the engine reaches it is not shareable.

Structs§

Utp
Typed UTP model built from/to Gff data.
UtpInventoryItem
One UTP inventory item entry from the ItemList field.

Enums§

UtpError
Errors produced while reading or writing typed UTP data.

Functions§

author_utp
Authors the UTP file the typed view describes, into a writer.
author_utp_to_vec
Authors the UTP file the typed view describes, as bytes.
read_utp
Reads typed UTP data from a reader at the current stream position.
read_utp_from_bytes
Reads typed UTP data directly from bytes.