Skip to main content

Event Trigger System

construction

The Schema-Aware Trigger System in SkyrimNet allows you to define custom reactions to in-game events. This system makes NPCs, the player character, and the world itself more dynamic, offering immersive responses that feel tailored to what's happening in real time.

Triggers are event-driven rules that check for specific gameplay conditions, such as casting a spell or using an item. When conditions are met, a templated response is generated โ€” from a whispered thought to a loud reaction from nearby NPCs. Triggers can:

  • React to spells, items, combat, dialogue, animations, and more
  • Generate narrative text or dialogue
  • Silently record events for memory or future logic
  • Update persistent character data

Triggers, for now, dont allow using additional scripts or decorators on their descriptions.


How Triggers Workโ€‹

Each trigger consists of:

  • Event Type: The in-game action that activates the trigger (e.g., spell_cast)
  • Conditions: Fields like spell name, editor ID, or actor type that filter the trigger
  • Response Content: A written message, using variables and templates
  • Response Type: Defines how the line is delivered (thought, speech, narration)
  • Audience: Who hears or sees the response (player, NPCs, etc.)
  • Optional Metadata: Priority, probability, and cooldown timers

Triggers can be created manually or automatically based on spell/item customizations.

Trigger Lifecycleโ€‹

  1. Event Occurs
    (e.g. spell cast, item equipped, animation played)

  2. Schema Validation
    Event data is validated against its registered schema.

  3. Condition Evaluation
    All trigger conditions must match.

  4. Probability Check
    Trigger may randomly fire based on configured chance.

  5. Cooldown Check
    Prevents repeated firing.

  6. Response Execution
    Response content is rendered and executed


๐ŸŽญ Response Typesโ€‹

Each response style sets a different narrative tone and use case.

Response Typesโ€‹

Response TypeDescriptionVisibility / EffectBest Use Cases
๐Ÿง  Player ThoughtInternal monologue shown to the playerPlayer only, no NPC awarenessSensations, instincts, reflections
๐Ÿ—ฃ๏ธ Player DialogueSpoken by the player characterHeard by selected audience; can affect NPC reactions and memoriesAuto-comments, taunts, reactive speech
๐Ÿ“– Direct NarrationThird-person or narrator-style descriptionNot attributed to player or NPC speechCombat descriptions, atmosphere, cinematic or adult scenes
๐Ÿ•’ Persistent Event (No Response)Records the event without visible outputAffects memory, emotions, or future triggersHidden consequences, long-term logic
๐Ÿ““ Create Diary EntryWrites a persistent diary entryStored and readable laterQuest logs, major story moments, personal memories
๐Ÿงฌ Update Dynamic BioUpdates NPC biography/personality stateAlters future LLM context, dialogue, and behaviorRelationship changes, corruption arcs, character growth

๐Ÿ‘ฅ Audience Optionsโ€‹

You can target who receives the trigger response:

AudienceDescription
playerOnly the player sees/hears the response
originatorThe actor who caused the event (e.g. spell caster)
targetThe actor the event is aimed at (e.g. spell recipient)
nearbyAll nearby actors (within a set distance)
npcsAll nearby NPCs (excludes the player)
everyonePlayer and all nearby NPCs

This allows you to control perspective and immersion for every response.


๐ŸŽฏ Conditions and Eventsโ€‹

Each trigger uses schema-aware conditions tailored to its event type. For example, a spell_cast event includes:

  • spell: The display name of the spell (e.g., Ironflesh)
  • spell_editor_id: The internal ID of the spell
  • actor: The caster of the spell

These fields can be matched using operators like equals, contains, or starts_with.


๐Ÿงพ Response Templatingโ€‹

Response text is written using a flexible template language with variable support. You can insert values dynamically:

{{ actor.name }} begins to glow with magical energy.
I cast {{ event_json.spell }} and feel my skin tingle.

Templates allow you to reuse trigger logic across characters and situations without hardcoding dialogue.


๐Ÿงช Example: Ironflesh Spell Reactionโ€‹

Trigger Name: Ironflesh Trigger
Event: spell_cast
Conditions:

  • spell equals Ironflesh
  • spell_editor_id equals Ironflesh

Response Type: Player Thought
Audience: Player
Cooldown: 30 seconds

Response:
I feel my skin tingle as it hardens while I cast {{ event_json.spell }}.


๐Ÿ”ง Managing Triggersโ€‹

Triggers are created and edited via the Trigger Management UI. Each trigger supports:

  • Setting priority (used when multiple triggers match)
  • Configuring chance (e.g., 100% reliable or random 25% chance)
  • Defining cooldown to prevent repeated responses
  • Live enabling/disabling without restarting the game

You can also search, filter, and reload triggers instantly. The UI is schema-driven and adapts to the selected event type for easier configuration.

For triggers to be listed properly in the web-ui, make sure their yaml file name matches exactly with the trigger name, contained in his own setting.


Quick Trigger Creationโ€‹

You can use the "create trigger" button associated with items and spells you browse on the Game data explorer.

construction

The system will then take you to a fully pregenerated trigger, containing all relevant variables to that event. You can then edit it at your leisure, like changing the title, response types, description, etc.

construction

The Event Monitor also includes a "create trigger button". This allows you to use generate pre-made templates for all kinds of events, as they flow in your game , in real time.

construction

๐Ÿ”„ Integration with Other Systemsโ€‹

Triggers integrate seamlessly with:

  • Memory and Emotion Systems: Feeding into emotional state and memory entries
  • NPC Dialogue and Ambient Behavior: Creating realistic chatter or commentary in response to events

This makes the trigger system a bridge between world simulation and narrative design โ€” powerful for both modders and storytellers.