Skip to content

Relation Reference

Auto-generated from data/relations/**/*.yaml. Regenerate with python3 tools/gen_docs.py. Do not edit this file by hand — changes will be overwritten.

Relations are the core vocabulary of Mora rules. Each is declared under a namespace (form/, ref/, player/, world/, event/) and carries a type whose constructor determines which verbs are legal in head position.

Verb rules

Type constructor Legal verbs Example
scalar<T> set => set form/name(F, "Nazeem")
countable<T> set, add, sub => add player/gold(P, 100)
list<T> add, remove => add form/keyword(W, @Enchanted)
const<T> (none — read-only) used only in body position
predicate (none — unary existence) form/npc(F)

Namespaces

  • form/* — Static record data extracted from ESP/ESM files at compile time.
  • ref/* — Dynamic data about placed references (live world instances).
  • player/* — Player-specific state and effects.
  • world/* — Global game state (time, weather, difficulty).
  • event/* — Edge-triggered inputs. Only legal in on rules.

form/*

Static record data extracted from ESP/ESM files at compile time.

Source: data/relations/form/armor.yaml

form/armor(F: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when F is an armor base record.

Extracted from ESP data at compile time. From record ARMO.

form/armor_rating(A: FormRef, V: Float)

Type: countable<Float>
Verbs: set, add, sub

Armor rating. Raw ESP value is the display rating × 100.

Extracted from ESP data at compile time. From record ARMO, subrecord DNAM.

Source: data/relations/form/leveled_list.yaml

form/leveled_list(F: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when F is a Leveled Item list (registered via form_model.h).

Extracted from ESP data at compile time. From record LVLI.

form/leveled_char(F: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when F is a Leveled Character list (registered via form_model.h).

Extracted from ESP data at compile time. From record LVLN.

form/chance_none(LIST: FormRef, PCT: Int)

Type: countable<Int>
Verbs: set, add, sub

Percent chance (0..100) that a leveled list returns nothing.

Extracted from ESP data at compile time. From record LVLI, subrecord LVLD. Extraction: subrecord, read as uint8.

form/leveled_entry(LIST: FormRef, ENTRY: FormRef)

Type: list<FormRef>
Verbs: add, remove

Leveled-item entries — the pool of references the list can produce. (Level and count are not captured yet.)

Extracted from ESP data at compile time. From record LVLI, subrecord LVLO. Extraction: list_field, offset 4, read as formid.

Source: data/relations/form/npc.yaml

form/npc(F: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when F is a base NPC record.

Extracted from ESP data at compile time. From record NPC_.

form/base_level(NPC: FormRef, L: Int)

Type: countable<Int>
Verbs: set, add, sub

NPC base level.

Extracted from ESP data at compile time. From record NPC_, subrecord ACBS.

form/calc_level_min(NPC: FormRef, L: Int)

Type: countable<Int>
Verbs: set, add, sub

Minimum auto-calculated level for this NPC.

Extracted from ESP data at compile time. From record NPC_, subrecord ACBS. Extraction: packed_field, offset 10, read as uint16.

form/calc_level_max(NPC: FormRef, L: Int)

Type: countable<Int>
Verbs: set, add, sub

Maximum auto-calculated level for this NPC (0 = no cap).

Extracted from ESP data at compile time. From record NPC_, subrecord ACBS. Extraction: packed_field, offset 12, read as uint16.

form/speed_mult(NPC: FormRef, N: Int)

Type: countable<Int>
Verbs: set, add, sub

NPC movement speed multiplier (100 = normal).

Extracted from ESP data at compile time. From record NPC_, subrecord ACBS. Extraction: packed_field, offset 14, read as uint16.

form/race(NPC: FormRef, RACE: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

NPC base race.

Extracted from ESP data at compile time. From record NPC_, subrecord RNAM.

form/npc_class(NPC: FormRef, CLASS: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

NPC class record (TESClass).

Extracted from ESP data at compile time. From record NPC_, subrecord CNAM. Extraction: subrecord, read as formid.

form/voice_type(NPC: FormRef, VTYPE: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

NPC voice type.

Extracted from ESP data at compile time. From record NPC_, subrecord VTCK. Extraction: subrecord, read as formid.

form/default_outfit(NPC: FormRef, OUTFIT: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

NPC default outfit (Outfit record).

Extracted from ESP data at compile time. From record NPC_, subrecord DOFT. Extraction: subrecord, read as formid.

form/female(NPC: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when this NPC is female.

Extracted from ESP data at compile time. From record NPC_, subrecord ACBS. Extraction: bit_test, offset 0, bit 0, read as uint32.

form/essential(NPC: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when this NPC has the Essential flag (cannot be killed).

Extracted from ESP data at compile time. From record NPC_, subrecord ACBS. Extraction: bit_test, offset 0, bit 1, read as uint32.

form/unique(NPC: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when this NPC is marked Unique (only one instance can exist).

Extracted from ESP data at compile time. From record NPC_, subrecord ACBS. Extraction: bit_test, offset 0, bit 5, read as uint32.

form/protected(NPC: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when this NPC has the Protected flag (killable only by player).

Extracted from ESP data at compile time. From record NPC_, subrecord ACBS. Extraction: bit_test, offset 0, bit 11, read as uint32.

form/spell(NPC: FormRef, SPELL: FormRef)

Type: list<FormRef>
Verbs: add, remove

Spells granted to this NPC.

Extracted from ESP data at compile time. From record NPC_, subrecord SPLO. Extraction: list_field, element size 4, read as formid.

form/perk(NPC: FormRef, PERK: FormRef)

Type: list<FormRef>
Verbs: add, remove

Perks granted to this NPC.

Extracted from ESP data at compile time. From record NPC_, subrecord PRKR. Extraction: list_field, element size 8, read as formid.

form/inventory_item(NPC: FormRef, ITEM: FormRef)

Type: list<FormRef>
Verbs: add, remove

Items in this NPC's default inventory (CNTO is form+count).

Extracted from ESP data at compile time. From record NPC_, subrecord CNTO. Extraction: list_field, element size 8, read as formid.

Source: data/relations/form/shared.yaml

form/keyword(F: FormRef, KW: FormRef)

Type: list<FormRef>
Verbs: add, remove

Keyword membership on a base record (body: query; head: add/remove).

Extracted from ESP data at compile time. From subrecord KWDA.

form/faction(NPC: FormRef, FAC: FormRef)

Type: list<FormRef>
Verbs: add, remove

Faction membership on an NPC base record.

Extracted from ESP data at compile time. From record NPC_, subrecord SNAM.

form/gold_value(F: FormRef, N: Int)

Type: countable<Int>
Verbs: set, add, sub

Gold value of an item.

Extracted from ESP data at compile time. From subrecord DATA.

form/name(F: FormRef, S: String)

Type: scalar<String>
Verbs: set

Display name.

Extracted from ESP data at compile time. From subrecord FULL.

Source: data/relations/form/weapon.yaml

form/weapon(F: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when F is a weapon base record.

Extracted from ESP data at compile time. From record WEAP.

form/damage(W: FormRef, N: Int)

Type: countable<Int>
Verbs: set, add, sub

Weapon base damage (registered via form_model.h from DATA@8).

Extracted from ESP data at compile time. From record WEAP, subrecord DNAM.

form/speed(W: FormRef, V: Float)

Type: countable<Float>
Verbs: set, add, sub

Weapon swing speed multiplier (1.0 = normal).

Extracted from ESP data at compile time. From record WEAP, subrecord DNAM. Extraction: packed_field, offset 4, read as float32.

form/reach(W: FormRef, V: Float)

Type: countable<Float>
Verbs: set, add, sub

Weapon reach multiplier (1.0 = normal).

Extracted from ESP data at compile time. From record WEAP, subrecord DNAM. Extraction: packed_field, offset 8, read as float32.


ref/*

Dynamic data about placed references (live world instances).

Source: data/relations/ref/actor.yaml

ref/is_dead(R: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when R is an actor that is currently dead.

Runtime handler-dispatched.

ref/in_combat(R: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when R is an actor currently in combat state.

Runtime handler-dispatched.

ref/health(R: FormRef, H: Float)

Type: const<Float>
Verbs: (read-only; body-position only)

Current health value for an actor reference (not max health).

Runtime handler-dispatched.

ref/magicka(R: FormRef, M: Float)

Type: const<Float>
Verbs: (read-only; body-position only)

Current magicka value for an actor reference.

Runtime handler-dispatched.

ref/stamina(R: FormRef, S: Float)

Type: const<Float>
Verbs: (read-only; body-position only)

Current stamina value for an actor reference.

Runtime handler-dispatched.

ref/level(R: FormRef, L: Int)

Type: const<Int>
Verbs: (read-only; body-position only)

Current (possibly leveled) level of an actor reference. May differ from form/base_level when the actor was auto-leveled.

Runtime handler-dispatched.

ref/equipped_weapon(ACTOR: FormRef, WEAP: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

Weapon currently held in ACTOR's right (main) hand. Returns the base weapon FormID, not a reference.

Runtime handler-dispatched.

ref/equipped_weapon_left(ACTOR: FormRef, WEAP: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

Weapon or shield currently held in ACTOR's left (off) hand.

Runtime handler-dispatched.

ref/equipped_spell_left(ACTOR: FormRef, SPELL: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

Spell currently readied in ACTOR's left hand.

Runtime handler-dispatched.

ref/equipped_spell_right(ACTOR: FormRef, SPELL: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

Spell currently readied in ACTOR's right hand.

Runtime handler-dispatched.

ref/equipped_armor(ACTOR: FormRef, ARMO: FormRef)

Type: list<FormRef>
Verbs: add, remove

Armor pieces currently worn by ACTOR. One fact per equipped piece.

Runtime handler-dispatched.

ref/inventory_item(ACTOR: FormRef, ITEM: FormRef)

Type: list<FormRef>
Verbs: add, remove

Items currently in ACTOR's inventory (base-form FormIDs; counts and individual ref instances aren't exposed here).

Runtime handler-dispatched.

Source: data/relations/ref/item.yaml

ref/worn_by(ITEM: FormRef, ACTOR: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

The actor currently wearing or wielding this item reference, if any. Inverse of ref/equipped_armor / ref/equipped_weapon.

Runtime handler-dispatched.

ref/container(ITEM: FormRef, OWNER: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

The container or actor currently holding this item reference. Distinct from worn_by — an item can be carried but not equipped.

Runtime handler-dispatched.

ref/is_equipped(ITEM: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when this item reference is currently equipped on some actor.

Runtime handler-dispatched.

ref/is_stolen(ITEM: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when this item reference has the stolen flag set.

Runtime handler-dispatched.

Source: data/relations/ref/shared.yaml

ref/base_form(R: FormRef, F: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

Bridge from a live placed reference to its base record. This is the primary join used to carry a reference over into form/* queries.

Runtime handler-dispatched.

ref/current_location(R: FormRef, LOC: FormRef)

Type: const<FormRef>
Verbs: (read-only; body-position only)

The Location record this reference is currently in (nearest parent Location).

Runtime handler-dispatched.

ref/keyword(R: FormRef, KW: FormRef)

Type: list<FormRef>
Verbs: add, remove

Keywords added to a specific reference at runtime (distinct from its base form's keywords).

Runtime handler-dispatched. Apply handler: RefAddKeyword. Retract handler: RefRemoveKeyword.

ref/is_player(R: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when R is the player character.

Runtime handler-dispatched.

ref/is_npc(R: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when R's base form is an NPC (actor base).

Runtime handler-dispatched.

ref/is_weapon(R: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when R's base form is a WEAP record.

Runtime handler-dispatched.

ref/is_armor(R: FormRef)

Type: predicate
Verbs: (read-only; body-position only)

True when R's base form is an ARMO record.

Runtime handler-dispatched.


player/*

Player-specific state and effects.

Source: data/relations/player.yaml

player/gold(P: FormRef, N: Int)

Type: countable<Int>
Verbs: set, add, sub

Player gold count (additive delta via 'add').

Runtime handler-dispatched. Apply handler: PlayerAddGold.

player/notification(P: FormRef, S: String)

Type: list<String>
Verbs: add, remove

Queue a UI notification string.

Runtime handler-dispatched. Apply handler: PlayerShowNotification.


world/*

Global game state (time, weather, difficulty).

Source: data/relations/world.yaml

world/time_of_day(T: Float)

Type: const<Float>
Verbs: (read-only; body-position only)

Current in-game hour 0..24.

Maintained via an SKSE hook. Hook: OnTimeOfDayChanged (state).


event/*

Edge-triggered inputs. Only legal in on rules.

Source: data/relations/event.yaml

event/entered_location(R: FormRef, LOC: FormRef)

Type: list<FormRef>
Verbs: add, remove

Fires when a reference enters a new location.

Edge-triggered SKSE event. Hook: OnLocationChange.

event/combat_state_changed(R: FormRef, STATE: Int)

Type: list<Int>
Verbs: add, remove

Fires on combat state transitions.

Edge-triggered SKSE event. Hook: OnCombatStateChanged.

event/killed(VICTIM: FormRef, KILLER: FormRef)

Type: list<FormRef>
Verbs: add, remove

Fires when an actor reference is killed. VICTIM is the actor that died; KILLER is the actor that dealt the killing blow.

Edge-triggered SKSE event. Hook: OnActorKilled.