Skip to content

MarkTriggerFired

Referee: record that a trigger has fired.

Full documentation: MarkTriggerFired. Wire type: mark_trigger_fired.

Legal session modes: battle, encounter, exploring, game_over, town, victory

JSON Schema

{
  "description": "Referee: record that a trigger has fired.\n\nA trigger is an authored rule for commands to issue when something happens in play.\nThe trigger and quest interpreter\n(`Interpreter`) issues this command for each\ntrigger it fires, and a listener you write or an LLM referee can issue it too. The\ninterpreter marks a trigger before it issues the trigger's consequences, so it reads the\nmark and doesn't fire a once-only trigger again. The mark survives save,\nload, and replay like the rest of the session's state. This command is legal in\nevery mode, `game_over` and `victory` included.\n\nMarking a trigger that's already marked is accepted and changes no state, but it's\nstill logged. The session's state records whether a trigger has fired, and the command\nlog records each firing.\n\nAny `trigger_id` is accepted, because a mark needs no authored trigger behind it, so you\ncan mark ids from any of your game's systems. The quest commands are different:\n`ActivateQuest` and the other quest commands\naccept only the ids of quests the adventure defines.\n\nModes:\n    `town`, `exploring`, `encounter`, `battle`, `game_over`, `victory`\n\nRejections:\n    None.\n\nEvents:\n    A `TriggerFiredEvent` with the\n    trigger id and the `narrative` text, for every mark. The event has referee\n    visibility.",
  "properties": {
    "command_type": {
      "const": "mark_trigger_fired",
      "default": "mark_trigger_fired",
      "title": "Command Type",
      "type": "string",
      "description": "The name that identifies the command class in serialized data. Each command class fixes\nit to a distinct snake_case string, like `\"move_party\"` or `\"open_door\"`, and constructing\nthe class sets it, so you never pass it yourself.\n`parse_command` and the\n`AnyCommand` union use it to rebuild the right class\nfrom a serialized mapping. A class's value never changes between releases."
    },
    "source": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Source",
      "description": "Who or what issued the command on whose behalf: an authored trigger or quest id, or the\nname of one of your game's systems. The engine never reads it, so a command with a\n`source` does exactly what the same command without one does. The session logs and\nreplays it with the command, so the log alone shows why something happened. Leave it\n`None` when there's nothing to record. An empty string fails validation when the command\nis constructed."
    },
    "trigger_id": {
      "minLength": 1,
      "title": "Trigger Id",
      "type": "string",
      "description": "Which trigger fired. Any non-empty id is accepted, so you can mark firings from your\nsystems with ids you choose. The session's state records each id once, which is what\nthe interpreter checks for a trigger that fires once, and the command log records every mark."
    },
    "narrative": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Narrative",
      "description": "The referee's text about this firing, included on the\n`TriggerFiredEvent`, which has referee\nvisibility. Players don't see it. To give the players a line about what happened, issue\nan `AddJournalEntry`. Leave it `None` when there's\nnothing to say. An empty string fails validation."
    }
  },
  "required": [
    "trigger_id"
  ],
  "title": "MarkTriggerFired",
  "type": "object"
}