Skip to content

ActivateQuest

Referee: put an authored quest into play.

Full documentation: ActivateQuest. Wire type: activate_quest.

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

JSON Schema

{
  "description": "Referee: put an authored quest into play.\n\nThe first of the four commands that drive an adventure's quest state: a\nper-quest status that runs `inactive`, then `active`, then `completed`, and,\nunder it, a revealed/complete pair per objective. That state is engine-owned\nsession state beside the flag store, and these four are its only writers, so a\nreplay rebuilds it by re-executing the log.\n\nQuest and objective ids are a **closed domain**: they resolve against the\nadventure's `QuestSpec`s, and an id no quest\nspec defines is rejected. That is the deliberate opposite of\n`MarkTriggerFired`'s open trigger id:\na mark is bookkeeping a game may drive with ids from its own systems, while an\nactivated quest is projected into the player view with a name, an offer, and an\nobjective list, and an id with no quest behind it has none of them.\n\nAn accepted activation appends the quest's `offer` beat to the journal when its\nauthor wrote one, and the event includes the same line. The append emits no\n`JournalEntryAddedEvent`, because\nthe lifecycle event *is* that beat's event. Quest state is monotonic, so only an\n`inactive` quest activates. Referee commands are legal in every mode, terminal\nmodes included.\n\nModes:\n    `town`, `exploring`, `encounter`, `battle`, `game_over`, `victory`\n\nRejections:\n    - `session.command.unknown_quest` - `quest_id` names no quest of the\n      adventure.\n    - `session.command.quest_state` - the quest is already active or already\n      completed. The rejection names the quest and the state that refused it.\n\nEvents:\n    `QuestActivatedEvent` with the\n    quest id, the quest's name, and the offer beat.",
  "properties": {
    "command_type": {
      "const": "activate_quest",
      "default": "activate_quest",
      "title": "Command Type",
      "type": "string",
      "description": "The wire discriminator. Each subclass fixes it to its own snake_case literal, like\n`\"move_party\"` or `\"open_door\"`, so you never set it yourself: constructing the subclass\ndoes. It's what `parse_command` and the\n`AnyCommand` union read to rebuild the right class\nfrom a serialized mapping, and it stays the same across releases."
    },
    "source": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Source",
      "description": "An annotation naming the authored object (a trigger or quest id) or the game\nsystem on whose behalf the command was issued. Execution never reads it: a stamped\ncommand does exactly what the same command unstamped does. It is logged and replayed\nwith the command, so the log alone answers \"why did this happen\". Absent is `None`,\nand the empty string is not a value."
    },
    "quest_id": {
      "minLength": 1,
      "title": "Quest Id",
      "type": "string",
      "description": "Which quest to put into play, by\n`QuestSpec.id` from the adventure's own quests. An id no\nquest spec has is refused with `session.command.unknown_quest`."
    }
  },
  "required": [
    "quest_id"
  ],
  "title": "ActivateQuest",
  "type": "object"
}