GFF Spatial Objects - OpenKotOR/PyKotor GitHub Wiki

GFF Types: Spatial Objects

KotOR uses six GFF template types for interactive area objects: doors (UTD), placeables (UTP), triggers (UTT), encounters (UTE), sound emitters (UTS), and waypoints (UTW) [1] [2]. The engine reads each template's ResRef from the area's GIT [git.py] and instantiates the object at the stored coordinates when the module loads [3] [4].

PTH (path navigation) is a module-level GFF stored alongside .are, .git, and .ifo in the module package β€” not an instanced template. It is documented at GFF-Module-and-Area#pth.

Contents


UTD (Door)

Part of the GFF File Format Documentation.

UTD files store door templates for all interactive doors in an area. A door can be locked (requiring a key item or skill check), have hit points, trigger a conversation, and fire scripts on various events [1] [2]. UTD files follow the standard resource resolution order (override, MOD/SAV, KEY/BIF). The authoritative BioWare spec is at Bioware Aurora Door/Placeable GFF Format. To patch UTD fields with TSLPatcher, see TSLPatcher GFFList Syntax.

Related formats:

Implementation evidence

PyKotor:

Cross-reference (other implementations):

Community context (workflow): Door scripting and trap wiring appear in mod threads. See:

UTD fields stay anchored here + BioWare + PyKotor.

Core Identity fields

Field Type Description
TemplateResRef ResRef Template identifier for this door
Tag CExoString Unique tag for script references
LocName CExoLocString Door name (localized)
Description CExoLocString Door description
Comment CExoString Developer comment/notes

Door Appearance & type

Field Type Description
GenericType byte Index into genericdoors.2da (door model, textures, animations) [utd.py construct_utd, reone utd.cpp]
Appearance DWord Unused secondary appearance value (always 0 in retail files) [utd.py UTD.unused_appearance]
AnimationState byte Current animation state (always 0 in templates)

Appearance System:

  • GenericType (byte) indexes into genericdoors.2da which defines door models and animations. Appearance is a legacy field not used by the engine.

Locking & Security

Field Type Description
Locked byte Door is currently locked
Lockable byte Door can be locked/unlocked
KeyRequired byte Door requires a specific inventory item to open
KeyName CExoString Tag of the required key item in the player's inventory
AutoRemoveKey byte Key item is consumed after a successful use
OpenLockDC byte Security skill DC to pick lock
CloseLockDC (KotOR2) byte Security skill DC to lock door

Lock fields defined in utd.py UTD.

Hit Points & Durability

Field Type Description
HP int16 Maximum hit points
CurrentHP int16 Current hit points
Hardness byte Damage reduction
Min1HP (KotOR2) byte Cannot drop below 1 HP
Fort byte Fortitude save (always 0)
Ref byte Reflex save (always 0)
Will byte Will save (always 0)

Destructible Doors:

Interaction & Behavior

Field Type Description
Plot byte Plot-critical (cannot be destroyed)
Static byte Door is static geometry (no interaction)
Interruptable byte Opening can be interrupted
Conversation ResRef Dialog file when used
Faction DWord Faction identifier [utd.py construct_utd]

Conversation Doors:

  • Conversation (ResRef) stores the DLG file reference [utd.py].

Script Hooks

Field Type Description
OnOpen ResRef Fires when door opens
OnClosed ResRef Fires when door closes/finishes closing [utd.py construct_utd, reone utd.cpp]
OnDamaged ResRef Fires when door takes damage
OnDeath ResRef Fires when door is destroyed
OnDisarm ResRef Fires when trap is disarmed
OnHeartbeat ResRef Fires periodically
OnLock ResRef Fires when door is locked
OnMeleeAttacked ResRef Fires when attacked in melee
OnSpellCastAt ResRef Fires when spell cast at door
OnUnlock ResRef Fires when door is unlocked
OnUserDefined ResRef Fires on user-defined events
OnClick ResRef Fires when clicked
OnFailToOpen (KotOR2) ResRef Fires when opening fails

Trap System

Field Type Description
TrapDetectable byte Trap can be detected
TrapDetectDC byte Awareness DC to detect trap
TrapDisarmable byte Trap can be disarmed
DisarmDC byte Security DC to disarm trap
TrapFlag byte Trap is active
TrapOneShot byte Trap triggers only once
TrapType byte Index into traps.2da

Trap System fields are defined in traps.2da indexed by TrapType [utd.py].

Load-Bearing Doors (KotOR2)

Field Type Description
LoadScreenID DWord Loading screen to show [utd.py construct_utd, reone utd.cpp]
LinkedTo CExoString Destination waypoint tag (read by reone; not yet in PyKotor construct_utd) [reone utd.cpp]
LinkedToFlags DWord Transition behavior flags [reone utd.cpp]
OpenState (KotOR2) byte Door initial open state [utd.py construct_utd]

These transition and state fields are read from the UTD template. LinkedTo/LinkedToFlags are confirmed by reone; OpenState and LoadScreenID by PyKotor.

Appearance Customization

Field Type Description
PortraitId word Portrait icon identifier
PaletteID byte Toolset palette category

Implementation Notes

PyKotor deserializes UTD fields via construct_utd (utd.py).

Locking system:

  • Lockable=0: Door cannot be locked (always opens) [utd.py UTD.lockable].
  • Locked=1, KeyRequired=1: Player must carry the item with the tag stored in KeyName [utd.py UTD.key_name].
  • Locked=1, OpenLockDC>0: Can pick the lock with the Security skill [utd.py UTD.open_lock_dc].
  • Locked=1, KeyRequired=0, OpenLockDC=0: Locked via script only.

See also


UTP (Placeable)

Part of the GFF File Format Documentation.

UTP files store placeable object templates: containers, furniture, switches, workbenches, computer terminals, and other interactive environmental objects. A placeable can hold inventory items, be destroyed, locked, trapped, and fire scripts on events [1] [2]. UTP files follow the standard resource resolution order (override, MOD/SAV, KEY/BIF). The authoritative BioWare spec is at Bioware Aurora Door/Placeable GFF Format. To patch UTP fields with TSLPatcher, see TSLPatcher GFFList Syntax.

Related formats:

Implementation evidence

PyKotor:

Cross-reference (other implementations):

Community context (workflow): Placeable and container modding threads on Deadly Stream complement GFF-GIT placementβ€”see Home β€” Community sources. UTP fields follow this page + BioWare + PyKotor.

Core Identity fields

Field Type Description
TemplateResRef ResRef Template identifier for this placeable
Tag CExoString Unique tag for script references
LocName CExoLocString Placeable name (localized)
Description CExoLocString Placeable description
Comment CExoString Developer comment/notes

Appearance & type

Field Type Description
Appearance UInt32 Index into placeables.2da
Type byte Placeable type category
AnimationState byte Current animation state

Appearance System:

Inventory System

Field Type Description
HasInventory byte Placeable contains items
ItemList List Items in inventory
BodyBag byte Container for corpse loot

ItemList Struct fields:

  • InventoryRes (ResRef): UTI template ResRef
  • Repos_PosX (word): Grid X position (optional)
  • Repos_Posy (word): Grid Y position (optional)
  • Dropable (byte): Can drop item

Container Behavior:

Locking & Security

Field Type Description
Locked byte Placeable is currently locked
Lockable byte Can be locked/unlocked
KeyRequired byte Placeable requires a specific inventory item to open
KeyName CExoString Tag of the required key item in the player's inventory
AutoRemoveKey byte Key item is consumed after a successful use
OpenLockDC byte Security skill DC to pick lock
CloseLockDC (KotOR2) byte Security DC to lock
OpenLockDiff (KotOR2) byte Additional lock difficulty [utp.py dismantle_utp]
OpenLockDiffMod (KotOR2) int8 Modifier to lock difficulty [utp.py dismantle_utp]

Lock fields defined in utp.py UTP.

Hit Points & Durability

Field Type Description
HP int16 Maximum hit points
CurrentHP int16 Current hit points
Hardness byte Damage reduction
Min1HP (KotOR2) byte Cannot drop below 1 HP
Fort byte Fortitude save (usually 0)
Ref byte Reflex save (usually 0)
Will byte Will save (usually 0)

Destructible Placeables:

  • HP and Hardness fields define durability [utp.py UTP.hp]; Min1HP (KotOR2) prevents destruction.

Interaction & Behavior

Field Type Description
Plot byte Plot-critical (cannot be destroyed)
Static byte Static geometry (no interaction)
Useable byte Can be clicked/used
Conversation ResRef Dialog file when used
Faction DWord Faction identifier [utp.py construct_utp]
PartyInteract byte Requires party member selection
NotBlastable (KotOR2) byte Immune to area damage

Usage Patterns:

  • Useable=0: Cannot be directly interacted with
  • Conversation: Triggers dialog on use (terminals, panels)
  • PartyInteract: Shows party selection GUI
  • Static: Pure visual element, no gameplay

Script Hooks

Field Type Description
OnClosed ResRef Fires when container closes
OnDamaged ResRef Fires when placeable takes damage
OnDeath ResRef Fires when placeable is destroyed
OnDisarm ResRef Fires when trap is disarmed
OnEndDialogue ResRef Fires when conversation ends
OnHeartbeat ResRef Fires periodically
OnInvDisturbed ResRef Fires when inventory changed
OnLock ResRef Fires when locked
OnMeleeAttacked ResRef Fires when attacked in melee
OnOpen ResRef Fires when opened
OnSpellCastAt ResRef Fires when spell cast at placeable
OnTrapTriggered ResRef Fires when trap activates [utp.py construct_utp, reone utp.cpp]
OnUnlock ResRef Fires when unlocked
OnUsed ResRef Fires when used/clicked
OnUserDefined ResRef Fires on user-defined events
OnFailToOpen (KotOR2) ResRef Fires when opening fails

Trap System

Field Type Description
TrapDetectable byte Trap can be detected
TrapDetectDC byte Awareness DC to detect trap
TrapDisarmable byte Trap can be disarmed
DisarmDC byte Security DC to disarm trap
TrapFlag byte Trap is active
TrapOneShot byte Trap triggers only once
TrapType byte Index into traps.2da (trap definitions)

Trap System fields are defined in traps.2da indexed by TrapType [utp.py].

Visual Customization

Field Type Description
PortraitId word Portrait icon identifier
PaletteID byte Toolset palette category

Implementation Notes

PyKotor deserializes UTP fields via construct_utp (utp.py). Inventory items in ItemList are keyed by InventoryRes (ResRef) pointing to UTI templates [utp.py UTP.inventory].

See also


UTT (Trigger)

Part of the GFF File Format Documentation.

UTT files store trigger templates. Triggers are invisible volumes that fire scripts when entered, exited, or clicked. They handle area transitions, cutscene starts, floor traps, and general game-logic events [1] [2]. UTT files follow the standard resource resolution order (override, MOD/SAV, KEY/BIF). The authoritative BioWare spec is at Bioware Aurora Trigger Format. To patch UTT fields with TSLPatcher, see TSLPatcher GFFList Syntax.

Implementation evidence

PyKotor:

Cross-reference (other implementations):

Community context (workflow): Area transitions and trap behavior are discussed across forums. See:

Use community write-ups for playtesting and tooling; UTT fields follow this page + BioWare + PyKotor.

Core Identity fields

Field Type Description
TemplateResRef ResRef Template identifier for this trigger
Tag CExoString Unique tag for script references
LocalizedName CExoLocString Trigger name (localized) [utt.py construct_utt, reone utt.cpp]
Comment CExoString Developer comment/notes

Trigger Configuration

Field Type Description
Type int32 Trigger type (0=Generic, 1=Transition, 2=Trap) [utt.py construct_utt, reone utt.cpp]
Faction DWord Faction identifier
Cursor byte Cursor icon when hovered (0=None, 1=Door, etc)
HighlightHeight Float Height of selection highlight

Trigger type values defined in utt.py UTT.type.

Transition Settings

Field Type Description
LinkedTo CExoString Destination waypoint tag [utt.py construct_utt, reone utt.cpp]
LinkedToFlags DWord Transition behavior flags [reone utt.cpp]
LoadScreenID Word Loading screen ID [utt.py construct_utt]
PortraitId Word Portrait ID (unused)

Transition fields defined in utt.py UTT.

Trap System

Field Type Description
TrapFlag Byte Trigger is a trap
TrapType Byte index into traps.2da
TrapDetectable Byte Can be detected
TrapDetectDC Byte Awareness DC to detect
TrapDisarmable Byte Can be disarmed
DisarmDC Byte Security DC to disarm
TrapOneShot Byte Fires once then disables
AutoRemoveKey Byte Key item is consumed on use
KeyName CExoString Tag of the key item required to disarm or bypass the trap

Trap fields defined in utt.py UTT.

Script Hooks

Field Type Description
OnClick ResRef Fires when clicked
OnDisarm ResRef Fires when disarmed
ScriptHeartbeat ResRef Fires periodically [utt.py construct_utt, reone utt.cpp]
ScriptOnEnter ResRef Fires when object enters [utt.py construct_utt, reone utt.cpp]
ScriptOnExit ResRef Fires when object exits [utt.py construct_utt, reone utt.cpp]
OnTrapTriggered ResRef Fires when trap activates
ScriptUserDefine ResRef Fires on user event [utt.py construct_utt, reone utt.cpp]

Script hook fields defined in utt.py UTT.

See also


UTE (Encounter)

Part of the GFF File Format Documentation.

UTE files store encounter templates. An encounter is a trigger volume that spawns creatures from a CreatureList when the player enters. The template controls which creatures spawn, how many, how often they respawn, and what scripts fire [1] [ute.py]. UTE files follow the standard resource resolution order (override, MOD/SAV, KEY/BIF). The authoritative BioWare spec is at Bioware Aurora Encounter Format. To patch UTE fields with TSLPatcher, see TSLPatcher GFFList Syntax.

Implementation evidence

PyKotor:

Cross-reference (other implementations):

Community context (workflow): Encounter placement and spawn behavior are frequent mod topicsβ€”see Home β€” Community sources. Use threads for workflow and tooling tips; field layout stays anchored to this page, the BioWare spec, and PyKotor.

Core Identity fields

Field Type Description
TemplateResRef ResRef Template identifier for this encounter
Tag CExoString Unique tag for script references
LocalizedName CExoLocString Encounter name (unused in game)
Comment CExoString Developer comment/notes

Spawn Configuration

Field Type Description
Active Byte Encounter is currently active
Difficulty Int Difficulty setting (unused, deprecated)
DifficultyIndex Int Difficulty scaling index
Faction DWord Faction of spawned creatures [ute.py construct_ute]
MaxCreatures Int Maximum concurrent creatures
RecCreatures Int Recommended number of creatures
SpawnOption Int Spawn behavior (0=Continuous, 1=Single Shot)

Fields defined in ute.py UTE.

Respawn Logic

Field Type Description
Reset Byte Encounter resets after being cleared
ResetTime Int Time in seconds before reset
Respawns Int Number of times it can respawn (-1 = infinite)

Respawn configuration fields defined in ute.py UTE.

Creature List

Field Type Description
CreatureList List List of creatures to spawn

CreatureList Struct fields:

  • ResRef (ResRef): UTC template to spawn [ute.py construct_ute, reone ute.cpp]
  • Appearance (Int): Appearance type override (toolset-oriented; not used in K1 spawn resolution)
  • CR (Float): Challenge Rating for spawn selection
  • SingleSpawn (Byte): Unique spawn flag (creature spawns only once)
  • GuaranteedCount (Int, KotOR2 only): Guaranteed spawn count [ute.py construct_ute, reone ute.cpp]

Spawn Selection:

  • CreatureList entries are defined by ResRef (ResRef) pointing to UTC templates, with CR (Float) and SingleSpawn (Byte) per entry [ute.py UTECreature].

Trigger Logic

Field Type Description
PlayerOnly Byte Only triggers for player (not NPCs)
OnEntered ResRef Script fires when trigger entered
OnExit ResRef Script fires when trigger exited
OnExhausted ResRef Script fires when spawns depleted
OnHeartbeat ResRef Script fires periodically
OnUserDefined ResRef Script fires on user events

Implementation Notes:

PyKotor deserializes UTE fields via construct_ute (ute.py).

See also


UTS (Sound)

Part of the GFF File Format Documentation.

UTS files store sound emitter templates. A sound emitter can play looping positional 3D audio (machinery, waterfalls) or global stereo audio (music, ambient atmosphere), with randomized sample selection and volume variation [uts.py]. UTS files follow the standard resource resolution order (override, MOD/SAV, KEY/BIF). The authoritative BioWare spec is at Bioware Aurora Sound Object Format. To patch UTS fields with TSLPatcher, see TSLPatcher GFFList Syntax.

Implementation evidence

PyKotor:

Cross-reference (other implementations):

Community context (workflow): Ambient audio and WAV/MP3 packaging threads appear on Deadly Stream and archives. See:

Forum posts explain workflow; UTS field tables stay anchored here + BioWare + PyKotor.

Core Identity fields

Field Type Description
TemplateResRef ResRef Template identifier for this sound
Tag CExoString Unique tag for script references
LocName CExoLocString Sound name (unused)
Comment CExoString Developer comment/notes

Playback Control

Field Type Description
Active Byte Sound is currently active
Continuous Byte Sound plays continuously
Looping Byte Individual samples loop
Positional Byte Sound is 3D positional
Random Byte Randomly select from Sounds list
Priority Byte Sound priority level [uts.py construct_uts, reone uts.cpp]
Volume Byte Volume level (0-127)
VolumeVrtn Byte Random volume variation [uts.py construct_uts, reone uts.cpp]
PitchVariation Float Random pitch variation [uts.py construct_uts, reone uts.cpp]

Timing & Interval

Field Type Description
Interval DWord Delay between plays (seconds)
IntervalVrtn DWord Random interval variation [uts.py construct_uts, reone uts.cpp]
Times DWord Times to play (not used by engine)
Hours DWord Hour restriction (not used by engine) [uts.py construct_uts, reone uts.cpp]

Playback fields defined in uts.py UTS.

Positioning

Field Type Description
Elevation Float Height offset from ground
MaxDistance Float Distance where sound becomes inaudible
MinDistance Float Distance where sound is at full volume
RandomPosition Byte Randomize emitter position
RandomRangeX Float X-axis random range
RandomRangeY Float Y-axis random range

Positioning fields defined in uts.py UTS.

Sound List

Field Type Description
Sounds List List of audio files to play (WAV or MP3)

Sound (ResRef) entries are defined in uts.py UTS.sounds.

See also


UTW (Waypoint)

Part of the GFF File Format Documentation.

UTW files store waypoint templates. Waypoints are invisible markers used as NPC patrol targets, creature spawn points, door/trigger link destinations, and map-note pins [1] [2] [utw.py]. UTW files follow the standard resource resolution order (override, MOD/SAV, KEY/BIF). The authoritative BioWare spec is at Bioware Aurora Waypoint Format. To patch UTW fields with TSLPatcher, see TSLPatcher GFFList Syntax.

Implementation evidence

PyKotor:

Cross-reference (other implementations):

Community context (workflow): Waypoint and map-pin behavior is a common module-design topic. See:

Treat forum threads as workflow context; UTW fields follow this page + BioWare + PyKotor.

Core Identity fields

Field Type Engine default Description
TemplateResRef ResRef blank Template identifier; max 16 chars. Engine loads the matching .utw.
Tag CExoString "" Unique tag for GetObjectByTag/GetWaypointByTag and door/trigger links. Keep unique per area.
LocalizedName CExoLocString empty Waypoint name on map and in travel menu.
Description CExoLocString empty Not read by engine; toolset/legacy only.
Comment CExoString "" Developer comment; not used by the game [utw.py construct_utw, reone utw.cpp].

Map Note Functionality

Field Type Description
HasMapNote Byte Waypoint has a map note
MapNoteEnabled Byte Map note is initially visible
MapNote CExoLocString Text displayed on map

Map note fields defined in utw.py UTW.

Waypoint identity and link fields defined in utw.py UTW.


Linking & Appearance

Field Type Description
LinkedTo CExoString Tag of linked object (unused)
Appearance Byte Appearance type (1=Waypoint)
PaletteID Byte Toolset palette category

Fields defined in utw.py UTW.


See also


PTH β€” Path has moved. PTH is a module-level GFF, not an instanced area template. See GFF-Module-and-Area#pth for full documentation.

⚠️ **GitHub.com Fallback** ⚠️