Skip to content

SetFlag

Referee: set a session flag (content wiring: the lever opens the portcullis).

Full documentation: SetFlag. Wire type: set_flag.

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

JSON Schema

{
  "description": "Referee: set a session flag (content wiring: the lever opens the portcullis).\n\nReferee commands are legal in every mode, terminal modes included. Flags\nserialize into saves; game code and listeners read them back, and authored\ncontent reads them through\n[`FlagEqualsCondition`][osrlib.crawl.gates.FlagEqualsCondition] \u2014 the gate on a\ndoor or stair that opens when the lever has been pulled.\n\nModes:\n    `town`, `exploring`, `encounter`, `battle`, `game_over`, `victory`\n\nRejections:\n    None.\n\nEvents:\n    [`FlagSetEvent`][osrlib.crawl.events.FlagSetEvent] with the key and value.",
  "properties": {
    "command_type": {
      "const": "set_flag",
      "default": "set_flag",
      "title": "Command Type",
      "type": "string"
    },
    "source": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Source"
    },
    "key": {
      "minLength": 1,
      "title": "Key",
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        },
        {
          "type": "boolean"
        }
      ],
      "title": "Value"
    }
  },
  "required": [
    "key",
    "value"
  ],
  "title": "SetFlag",
  "type": "object"
}