Skip to content

Behaviors

Event-driven triggers that fire without the AI's involvement. They handle the things that need to be precise, consistent, or instant.

In the editor, this is the Behaviors section. Different from the Behavior Rules on variables — those teach the AI how to respond; behaviors fire mechanically.

Behaviors section showing a rule with trigger, condition, and action

The horror world from earlier doesn't use any behaviors — it runs entirely on entries and Behavior Rules.

When to Use Automation

Good cases for automation:

  • Threshold alerts: "Show a warning when health drops below 10"
  • Game phase transitions: "When affinity hits 75, switch to romance mode"
  • Timed events: "Advance the day/night cycle every 5 turns"

How Behaviors Work

Every behavior has three parts:

WHEN — The Trigger

What event fires this rule:

TriggerFires When
Variable crossedA variable rises above or drops below a threshold
State changedAny variable changes value
Turn completeEvery N turns (e.g., every 5 turns)
Session startThe first time a player starts your world
Player keywordThe player mentions a specific word
AI keywordThe AI's reply contains a specific word
Every turnAfter every single turn
ActionA custom UI button calls api.executeAction(actionId)
ManualNo event trigger — fires whenever its conditions are met during an evaluation pass

IF — The Conditions (Optional)

Additional checks that must be true before the rule fires:

  • Variable equals / not equals / greater than / less than a value
  • Multiple conditions combined with AND or OR logic

THEN — The Actions

What happens when the rule fires:

ActionWhat It Does
Modify variableChange a variable's value (set, add, subtract, etc.)
Tell the AIInject a one-off directive to the AI
Send contextInject a one-off system/user message into the next AI turn (invisible to the player)
Notify playerShow a toast notification
Play audioTrigger a sound effect or music change
Toggle entryEnable/disable a lorebook entry
Toggle ruleEnable/disable another rule

Real Example: Dating Sim Route System

At affinity 25 — a subtle notification: "She seems to have noticed you..."

At affinity 50 — an achievement toast + the AI gets a new directive: "She's starting to show feelings — describe contradictory behavior, wanting to be close but pulling away."

At affinity 75 — the climax trigger: the AI gets a directive to write a confession scene, and the story phase shifts to "climax."

Rule Options

  • Priority: higher-priority rules fire first (useful when several rules trigger at once)
  • Cooldown: minimum turns between fires (prevents spam)
  • Max fire count: the most times this rule can ever fire (1 = a one-shot event)
  • Enabled/disabled: rules can be toggled by other rules (chain reactions)