Skip to content

CompleteObjective

Referee: mark one objective of an active quest complete.

Full documentation: CompleteObjective. Wire type: complete_objective.

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

JSON Schema

{
  "description": "Referee: mark one objective of an active quest complete.\n\nCompleting a hidden objective also reveals it, in one step, with no separate\n`RevealObjective`. The command accepts only the\nids the adventure's quest specs define, as\n`ActivateQuest` describes, and the `ActivateQuest`\nexample shows a quest from start to finish.\n\nCompleting the last objective a quest needs doesn't complete the quest. Send\n`CompleteQuest` for that, so whoever runs the\nquests decides when the quest is done. When the objective's author wrote a `progress`\ntext in its narrative, an accepted completion adds that text to the journal, and the\nevent includes it. No\n`JournalEntryAddedEvent` follows.\nThis command is legal in every mode, `game_over` and `victory` included.\n\nModes:\n    `town`, `exploring`, `encounter`, `battle`, `game_over`, `victory`\n\nRejections:\n    - `session.command.unknown_quest` - `quest_id` matches no quest of the\n      adventure.\n    - `session.command.unknown_objective` - `objective_id` matches no objective of\n      that quest.\n    - `session.command.quest_state` - the quest isn't active, or the objective\n      is already complete. The rejection includes the quest id and the state\n      that caused the refusal.\n\nEvents:\n    `ObjectiveCompletedEvent` with\n    the quest id, the objective id, and the objective's progress text.",
  "properties": {
    "command_type": {
      "const": "complete_objective",
      "default": "complete_objective",
      "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."
    },
    "quest_id": {
      "minLength": 1,
      "title": "Quest Id",
      "type": "string",
      "description": "Which quest the objective belongs to, by\n`QuestSpec.id`. The quest has to be active."
    },
    "objective_id": {
      "minLength": 1,
      "title": "Objective Id",
      "type": "string",
      "description": "Which objective is complete, by\n`ObjectiveSpec.id` within that quest. A hidden\nobjective is revealed as it completes, so it needs no separate\n`RevealObjective`."
    }
  },
  "required": [
    "quest_id",
    "objective_id"
  ],
  "title": "CompleteObjective",
  "type": "object"
}