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 \u2014 a\nper-quest status (`inactive` \u2192 `active` \u2192 `completed`) and, under it, a\nrevealed/complete pair per objective. That state is engine-owned session state\nbeside the flag store, and these four are its only writers, so a replay rebuilds\nit by re-executing the log.\n\nQuest and objective ids are a **closed domain**: they resolve against the\nadventure's [`QuestSpec`][osrlib.crawl.quests.QuestSpec]s, and an id no quest\nspec holds is rejected. That is the deliberate opposite of\n[`MarkTriggerFired`][osrlib.crawl.commands.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 \u2014 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 carries the same line; the append emits no\n[`JournalEntryAddedEvent`][osrlib.crawl.events.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` \u2014 `quest_id` names no quest of the\n      adventure.\n    - `session.command.quest_state` \u2014 the quest is already active or already\n      completed; the rejection names the quest and the state that refused it.\n\nEvents:\n    [`QuestActivatedEvent`][osrlib.crawl.events.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"
    },
    "source": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Source"
    },
    "quest_id": {
      "minLength": 1,
      "title": "Quest Id",
      "type": "string"
    }
  },
  "required": [
    "quest_id"
  ],
  "title": "ActivateQuest",
  "type": "object"
}