{
  "version": "1.1",
  "name": "Use State Objects to Show World Changes",
  "startRoom": "lesson_hall",
  "author": "TAGMaker",
  "description": "Hall lights show the current power state when examined. A generator in another room changes that state once, giving visible proof of the repair when the player returns.",
  "playerAppearance": {
    "version": 1,
    "layout": "modern",
    "font": "sans",
    "colorScheme": "light",
    "textSize": 18,
    "lineHeight": 1.6,
    "readingWidth": 80,
    "quietReading": false,
    "mapMode": "discovered",
    "panels": {
      "inventory": true,
      "map": true,
      "objectives": true,
      "status": true,
      "words": true
    },
    "picture": {
      "visible": true,
      "fit": "contain",
      "focalX": 50,
      "focalY": 50
    },
    "commands": {
      "visible": true,
      "standard": [
        "look",
        "search",
        "inventory",
        "help"
      ],
      "custom": []
    },
    "words": []
  },
  "created": "2026-11-01T00:00:00.000Z",
  "modified": "2026-11-01T00:00:00.000Z",
  "files": [
    {
      "path": "rooms/lesson_hall.taml",
      "content": "room lesson_hall\n  exit east: lesson_plant\n  name: \"Main Hall\"\n  description: \"Ceiling lights hang above the hall. The generator room is east.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_plant.taml",
      "content": "room lesson_plant\n  exit west: lesson_hall\n  name: \"Generator Room\"\n  description: \"Use the generator switch. The hall is west.\"\n  dark: false\nend"
    },
    {
      "path": "objects/lesson_lights.taml",
      "content": "object lesson_lights\n  name: \"hall lights\"\n  description: \"Examine the hall lights to check power.\"\n  smart_description: \"{\\\"version\\\":1,\\\"parts\\\":[{\\\"type\\\":\\\"conditional\\\",\\\"id\\\":\\\"lesson_lights_text\\\",\\\"when\\\":{\\\"kind\\\":\\\"flag_equals\\\",\\\"flag\\\":\\\"lesson_powered\\\",\\\"value\\\":true},\\\"then\\\":\\\"The ceiling lights shine steadily now. The hall feels safer.\\\",\\\"otherwise\\\":\\\"The ceiling lights are dead. Emergency lamps blink in the corners.\\\"}]}\"\n  location: lesson_hall\n  aliases: [\"lights\", \"lamps\", \"ceiling lights\"]\n  droppable: false\n  weight: 0.1\nend"
    },
    {
      "path": "objects/lesson_switch.taml",
      "content": "object lesson_switch\n  name: \"generator switch\"\n  description: \"Use this to restore power throughout the building.\"\n  location: lesson_plant\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "objects/sample_field_journal.taml",
      "content": "object sample_field_journal\n  name: \"field journal\"\n  description: \"Use this journal when you have completed the recipe to record your success. You can also keep exploring before you finish.\"\n  location: inventory\n  aliases: [\"journal\"]\n  takeable: true\n  droppable: false\n  use_give: true\n  weight: 0.1\nend"
    }
  ],
  "story": {
    "version": 1,
    "states": [
      {
        "id": "lesson_powered",
        "name": "powered",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      }
    ],
    "rules": [
      {
        "id": "lesson_repair",
        "name": "repair",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "lesson_switch",
          "event": "use"
        },
        "match": "all",
        "conditions": [],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_powered",
            "value": true
          },
          {
            "kind": "message",
            "value": "You restore power to the building."
          }
        ],
        "otherwise": "",
        "once": true,
        "repeatText": "The generator is already running."
      },
      {
        "id": "sample_finish",
        "name": "Record the completed expedition",
        "enabled": true,
        "trigger": {
          "kind": "object",
          "target": "sample_field_journal",
          "event": "use"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_powered",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "message",
            "value": "The scenery shows that power was restored elsewhere. You record the result in your field journal. Your expedition is complete."
          },
          {
            "kind": "score",
            "value": 100
          },
          {
            "kind": "end",
            "value": "Your expedition is complete."
          }
        ],
        "otherwise": "Your expedition is not complete yet. Follow the room clues, then use the field journal to record your success.",
        "once": true
      }
    ]
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "9-use-state-objects-to-show-world-changes",
        "choices": {
          "hall": {
            "existing": "",
            "name": "Main Hall",
            "description": "Ceiling lights hang above the hall. The generator room is east."
          },
          "plant": {
            "existing": "",
            "name": "Generator Room",
            "description": "Use the generator switch. The hall is west."
          },
          "lights": {
            "existing": "",
            "name": "hall lights",
            "description": "Examine the hall lights to check power."
          },
          "switch": {
            "existing": "",
            "name": "generator switch",
            "description": "Use this to restore power throughout the building."
          }
        },
        "values": {
          "before": "The ceiling lights are dead. Emergency lamps blink in the corners.",
          "after": "The ceiling lights shine steadily now. The hall feels safer.",
          "repair": "You restore power to the building.",
          "repeat": "The generator is already running."
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_hall.taml",
          "after": {
            "path": "rooms/lesson_hall.taml",
            "name": "lesson_hall.taml",
            "content": "room lesson_hall\n  exit east: lesson_plant\n  name: \"Main Hall\"\n  description: \"Ceiling lights hang above the hall. The generator room is east.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_plant.taml",
          "after": {
            "path": "rooms/lesson_plant.taml",
            "name": "lesson_plant.taml",
            "content": "room lesson_plant\n  exit west: lesson_hall\n  name: \"Generator Room\"\n  description: \"Use the generator switch. The hall is west.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_lights.taml",
          "after": {
            "path": "objects/lesson_lights.taml",
            "name": "lesson_lights.taml",
            "content": "object lesson_lights\n  name: \"hall lights\"\n  description: \"Examine the hall lights to check power.\"\n  smart_description: \"{\\\"version\\\":1,\\\"parts\\\":[{\\\"type\\\":\\\"conditional\\\",\\\"id\\\":\\\"lesson_lights_text\\\",\\\"when\\\":{\\\"kind\\\":\\\"flag_equals\\\",\\\"flag\\\":\\\"lesson_powered\\\",\\\"value\\\":true},\\\"then\\\":\\\"The ceiling lights shine steadily now. The hall feels safer.\\\",\\\"otherwise\\\":\\\"The ceiling lights are dead. Emergency lamps blink in the corners.\\\"}]}\"\n  location: lesson_hall\n  aliases: [\"lights\", \"lamps\", \"ceiling lights\"]\n  droppable: false\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_switch.taml",
          "after": {
            "path": "objects/lesson_switch.taml",
            "name": "lesson_switch.taml",
            "content": "object lesson_switch\n  name: \"generator switch\"\n  description: \"Use this to restore power throughout the building.\"\n  location: lesson_plant\n  droppable: false\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "objects",
          "key": "lesson_lights",
          "after": {
            "id": "lesson_lights",
            "name": "hall lights",
            "description": "Examine the hall lights to check power.",
            "article": "",
            "location": "lesson_hall",
            "aliases": [
              "lights",
              "lamps",
              "ceiling lights"
            ],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": false,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": [],
            "smartProse": {
              "description": {
                "version": 1,
                "parts": [
                  {
                    "type": "conditional",
                    "id": "lesson_lights_text",
                    "when": {
                      "kind": "flag_equals",
                      "flag": "lesson_powered",
                      "value": true
                    },
                    "then": "The ceiling lights shine steadily now. The hall feels safer.",
                    "otherwise": "The ceiling lights are dead. Emergency lamps blink in the corners."
                  }
                ]
              }
            }
          }
        },
        {
          "path": "objects",
          "key": "lesson_switch",
          "after": {
            "id": "lesson_switch",
            "name": "generator switch",
            "description": "Use this to restore power throughout the building.",
            "article": "",
            "location": "lesson_plant",
            "aliases": [],
            "visible": true,
            "takeable": false,
            "droppable": false,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_hall",
          "after": {
            "id": "lesson_hall",
            "name": "Main Hall",
            "description": "Ceiling lights hang above the hall. The generator room is east.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_plant",
          "after": {
            "id": "lesson_plant",
            "name": "Generator Room",
            "description": "Use the generator switch. The hall is west.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 320,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_plant",
          "after": {
            "id": "lesson_route_plant",
            "fromRoom": "lesson_hall",
            "toRoom": "lesson_plant",
            "direction": "east",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_return",
          "after": {
            "id": "lesson_route_return",
            "fromRoom": "lesson_plant",
            "toRoom": "lesson_hall",
            "direction": "west",
            "locked": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_powered",
          "after": {
            "id": "lesson_powered",
            "name": "powered",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_repair",
          "after": {
            "id": "lesson_repair",
            "name": "repair",
            "enabled": true,
            "trigger": {
              "kind": "object",
              "target": "lesson_switch",
              "event": "use"
            },
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_powered",
                "value": true
              },
              {
                "kind": "message",
                "value": "You restore power to the building."
              }
            ],
            "otherwise": "",
            "once": true,
            "repeatText": "The generator is already running."
          }
        }
      ]
    }
  ],
  "creatorNotes": "Hall lights show the current power state when examined. A generator in another room changes that state once, giving visible proof of the repair when the player returns.\nOpen Help → Cookbook → Use State Objects to Show World Changes → Start this recipe to inspect its saved settings. The field journal and 100-point ending belong only to the sample game.\nCommands: examine lamps; east; use generator switch; west; examine ceiling lights; east; use generator switch; west; use field journal",
  "mapRooms": [
    {
      "id": "lesson_hall",
      "name": "Main Hall",
      "description": "Ceiling lights hang above the hall. The generator room is east.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_plant",
      "name": "Generator Room",
      "description": "Use the generator switch. The hall is west.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 320,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    }
  ],
  "mapExits": [
    {
      "id": "lesson_route_plant",
      "fromRoom": "lesson_hall",
      "toRoom": "lesson_plant",
      "direction": "east",
      "locked": false
    },
    {
      "id": "lesson_route_return",
      "fromRoom": "lesson_plant",
      "toRoom": "lesson_hall",
      "direction": "west",
      "locked": false
    }
  ],
  "objects": [
    {
      "id": "lesson_lights",
      "name": "hall lights",
      "description": "Examine the hall lights to check power.",
      "article": "",
      "location": "lesson_hall",
      "aliases": [
        "lights",
        "lamps",
        "ceiling lights"
      ],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": false,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": [],
      "smartProse": {
        "description": {
          "version": 1,
          "parts": [
            {
              "type": "conditional",
              "id": "lesson_lights_text",
              "when": {
                "kind": "flag_equals",
                "flag": "lesson_powered",
                "value": true
              },
              "then": "The ceiling lights shine steadily now. The hall feels safer.",
              "otherwise": "The ceiling lights are dead. Emergency lamps blink in the corners."
            }
          ]
        }
      }
    },
    {
      "id": "lesson_switch",
      "name": "generator switch",
      "description": "Use this to restore power throughout the building.",
      "article": "",
      "location": "lesson_plant",
      "aliases": [],
      "visible": true,
      "takeable": false,
      "droppable": false,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    },
    {
      "id": "sample_field_journal",
      "name": "field journal",
      "description": "Use this journal when you have completed the recipe to record your success. You can also keep exploring before you finish.",
      "article": "",
      "location": "inventory",
      "aliases": [
        "journal"
      ],
      "visible": true,
      "takeable": true,
      "droppable": false,
      "useGive": true,
      "container": false,
      "switchable": false,
      "edible": false,
      "drinkable": false,
      "wearable": false,
      "weapon": false,
      "weight": 0.1,
      "locked": false,
      "lockKey": "",
      "events": []
    }
  ],
  "npcs": [],
  "activeMechanics": [],
  "verbAliases": [],
  "scripts": [],
  "worldEvents": [],
  "customMechanicDefs": [],
  "savedMechanicTemplates": [],
  "objectiveSets": [],
  "gameOutliner": {},
  "customRoomTemplates": [],
  "customObjectTemplates": [],
  "customNpcTemplates": [],
  "customSavedScripts": [],
  "requiredCapabilities": [
    "smart-prose-v1",
    "story-rules-v1"
  ]
}
