{
  "version": "1.1",
  "name": "Use NPCs as Living Gates",
  "startRoom": "lesson_room",
  "author": "TAGMaker",
  "description": "Show a carried royal badge to the castle guard, then talk to ask for entry. The actual exit stays blocked until the guard gives permission. The badge is kept, and permission remains on repeat visits.",
  "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_room.taml",
      "content": "room lesson_room\n  blocked north: \"The guard stops you. You need permission to enter.\"\n  exit north: lesson_yard when: lesson_allowed\n  name: \"Castle Gatehouse\"\n  description: \"Take the royal badge and USE it WITH the castle guard. TALK to the guard afterward. The castle yard is north.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_yard.taml",
      "content": "room lesson_yard\n  exit south: lesson_room\n  name: \"Castle Yard\"\n  description: \"The gatehouse is south.\"\n  dark: false\nend"
    },
    {
      "path": "objects/lesson_badge.taml",
      "content": "object lesson_badge\n  name: \"royal badge\"\n  description: \"Proof of authority. Show it to the guard.\"\n  location: lesson_room\n  takeable: true\n  use_give: true\n  weight: 0.1\nend"
    },
    {
      "path": "npcs/lesson_guard.taml",
      "content": "npc lesson_guard\n  name: \"castle guard\"\n  description: \"The guard controls passage into the castle.\"\n  location: lesson_room\n  mobile: false\n  follow: false\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\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_shown",
        "name": "shown",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      },
      {
        "id": "lesson_allowed",
        "name": "allowed",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      }
    ],
    "rules": [
      {
        "id": "lesson_permission",
        "name": "permission",
        "enabled": true,
        "trigger": {
          "kind": "npc",
          "target": "lesson_guard",
          "event": "talk"
        },
        "match": "all",
        "conditions": [
          {
            "kind": "state",
            "target": "lesson_shown",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_allowed",
            "value": true
          },
          {
            "kind": "message",
            "value": "The guard recognizes your authority and steps aside."
          }
        ],
        "otherwise": "Show the royal badge before asking to enter.",
        "once": true,
        "repeatText": "The guard nods. Go on through."
      },
      {
        "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_allowed",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "message",
            "value": "The guard gave permission and the real route opened. 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
      }
    ],
    "features": {
      "version": 1,
      "recipes": [
        {
          "id": "lesson_show",
          "name": "show",
          "enabled": true,
          "verbs": [
            "use"
          ],
          "unordered": true,
          "inputs": [
            {
              "objectId": "lesson_badge",
              "disposition": "retain"
            }
          ],
          "tools": [],
          "match": "all",
          "conditions": [],
          "actions": [
            {
              "kind": "state",
              "target": "lesson_shown",
              "value": true
            }
          ],
          "once": true,
          "success": "The guard examines your royal badge. Ask for permission to enter.",
          "failure": "Carry the royal badge before showing it to the guard.",
          "repeat": "The guard has already seen your badge.",
          "target": {
            "kind": "npc",
            "id": "lesson_guard"
          }
        }
      ]
    }
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "11-use-npcs-as-living-gates",
        "choices": {
          "room": {
            "existing": "",
            "name": "Castle Gatehouse",
            "description": "Take the royal badge and USE it WITH the castle guard. TALK to the guard afterward. The castle yard is north."
          },
          "yard": {
            "existing": "",
            "name": "Castle Yard",
            "description": "The gatehouse is south."
          },
          "badge": {
            "existing": "",
            "name": "royal badge",
            "description": "Proof of authority. Show it to the guard."
          },
          "guard": {
            "existing": "",
            "name": "castle guard",
            "description": "The guard controls passage into the castle."
          }
        },
        "values": {
          "success": "The guard examines your royal badge. Ask for permission to enter.",
          "failure": "Carry the royal badge before showing it to the guard.",
          "repeat": "The guard has already seen your badge.",
          "allow": "The guard recognizes your authority and steps aside.",
          "deny": "Show the royal badge before asking to enter.",
          "blocked": "The guard stops you. You need permission to enter."
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_room.taml",
          "after": {
            "path": "rooms/lesson_room.taml",
            "name": "lesson_room.taml",
            "content": "room lesson_room\n  blocked north: \"The guard stops you. You need permission to enter.\"\n  exit north: lesson_yard when: lesson_allowed\n  name: \"Castle Gatehouse\"\n  description: \"Take the royal badge and USE it WITH the castle guard. TALK to the guard afterward. The castle yard is north.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_yard.taml",
          "after": {
            "path": "rooms/lesson_yard.taml",
            "name": "lesson_yard.taml",
            "content": "room lesson_yard\n  exit south: lesson_room\n  name: \"Castle Yard\"\n  description: \"The gatehouse is south.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "objects/lesson_badge.taml",
          "after": {
            "path": "objects/lesson_badge.taml",
            "name": "lesson_badge.taml",
            "content": "object lesson_badge\n  name: \"royal badge\"\n  description: \"Proof of authority. Show it to the guard.\"\n  location: lesson_room\n  takeable: true\n  use_give: true\n  weight: 0.1\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_guard.taml",
          "after": {
            "path": "npcs/lesson_guard.taml",
            "name": "lesson_guard.taml",
            "content": "npc lesson_guard\n  name: \"castle guard\"\n  description: \"The guard controls passage into the castle.\"\n  location: lesson_room\n  mobile: false\n  follow: false\n  health: 100\n  combat_side: neutral\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\nend",
            "isDirty": true
          }
        },
        {
          "path": "objects",
          "key": "lesson_badge",
          "after": {
            "id": "lesson_badge",
            "name": "royal badge",
            "description": "Proof of authority. Show it to the guard.",
            "article": "",
            "location": "lesson_room",
            "aliases": [],
            "visible": true,
            "takeable": true,
            "droppable": true,
            "useGive": true,
            "container": false,
            "switchable": false,
            "edible": false,
            "drinkable": false,
            "wearable": false,
            "weapon": false,
            "weight": 0.1,
            "locked": false,
            "lockKey": "",
            "events": []
          }
        },
        {
          "path": "npcs",
          "key": "lesson_guard",
          "after": {
            "id": "lesson_guard",
            "name": "castle guard",
            "description": "The guard controls passage into the castle.",
            "location": "lesson_room",
            "mobile": false,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "neutral",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": []
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_room",
          "after": {
            "id": "lesson_room",
            "name": "Castle Gatehouse",
            "description": "Take the royal badge and USE it WITH the castle guard. TALK to the guard afterward. The castle yard is north.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {
              "north": "The guard stops you. You need permission to enter."
            }
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_yard",
          "after": {
            "id": "lesson_yard",
            "name": "Castle Yard",
            "description": "The gatehouse is south.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 320,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_yard",
          "after": {
            "id": "lesson_route_yard",
            "fromRoom": "lesson_room",
            "toRoom": "lesson_yard",
            "direction": "north",
            "locked": false,
            "when": "lesson_allowed"
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_return",
          "after": {
            "id": "lesson_route_return",
            "fromRoom": "lesson_yard",
            "toRoom": "lesson_room",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_shown",
          "after": {
            "id": "lesson_shown",
            "name": "shown",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_allowed",
          "after": {
            "id": "lesson_allowed",
            "name": "allowed",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_permission",
          "after": {
            "id": "lesson_permission",
            "name": "permission",
            "enabled": true,
            "trigger": {
              "kind": "npc",
              "target": "lesson_guard",
              "event": "talk"
            },
            "match": "all",
            "conditions": [
              {
                "kind": "state",
                "target": "lesson_shown",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_allowed",
                "value": true
              },
              {
                "kind": "message",
                "value": "The guard recognizes your authority and steps aside."
              }
            ],
            "otherwise": "Show the royal badge before asking to enter.",
            "once": true,
            "repeatText": "The guard nods. Go on through."
          }
        },
        {
          "path": "manifest.story.features.recipes",
          "key": "lesson_show",
          "after": {
            "id": "lesson_show",
            "name": "show",
            "enabled": true,
            "verbs": [
              "use"
            ],
            "unordered": true,
            "inputs": [
              {
                "objectId": "lesson_badge",
                "disposition": "retain"
              }
            ],
            "tools": [],
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_shown",
                "value": true
              }
            ],
            "once": true,
            "success": "The guard examines your royal badge. Ask for permission to enter.",
            "failure": "Carry the royal badge before showing it to the guard.",
            "repeat": "The guard has already seen your badge.",
            "target": {
              "kind": "npc",
              "id": "lesson_guard"
            }
          }
        }
      ]
    }
  ],
  "creatorNotes": "Show a carried royal badge to the castle guard, then talk to ask for entry. The actual exit stays blocked until the guard gives permission. The badge is kept, and permission remains on repeat visits.\nOpen Help → Cookbook → Use NPCs as Living Gates → Start this recipe to inspect its saved settings. The field journal and 100-point ending belong only to the sample game.\nCommands: north; talk castle guard; use royal badge with castle guard; take royal badge; use royal badge with castle guard; north; talk castle guard; north; south; talk castle guard; use field journal",
  "mapRooms": [
    {
      "id": "lesson_room",
      "name": "Castle Gatehouse",
      "description": "Take the royal badge and USE it WITH the castle guard. TALK to the guard afterward. The castle yard is north.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {
        "north": "The guard stops you. You need permission to enter."
      }
    },
    {
      "id": "lesson_yard",
      "name": "Castle Yard",
      "description": "The gatehouse is south.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 320,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    }
  ],
  "mapExits": [
    {
      "id": "lesson_route_yard",
      "fromRoom": "lesson_room",
      "toRoom": "lesson_yard",
      "direction": "north",
      "locked": false,
      "when": "lesson_allowed"
    },
    {
      "id": "lesson_route_return",
      "fromRoom": "lesson_yard",
      "toRoom": "lesson_room",
      "direction": "south",
      "locked": false
    }
  ],
  "objects": [
    {
      "id": "lesson_badge",
      "name": "royal badge",
      "description": "Proof of authority. Show it to the guard.",
      "article": "",
      "location": "lesson_room",
      "aliases": [],
      "visible": true,
      "takeable": true,
      "droppable": true,
      "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": [
    {
      "id": "lesson_guard",
      "name": "castle guard",
      "description": "The guard controls passage into the castle.",
      "location": "lesson_room",
      "mobile": false,
      "aliases": [],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "neutral",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": []
    }
  ],
  "activeMechanics": [],
  "verbAliases": [],
  "scripts": [],
  "worldEvents": [],
  "customMechanicDefs": [],
  "savedMechanicTemplates": [],
  "objectiveSets": [],
  "gameOutliner": {},
  "customRoomTemplates": [],
  "customObjectTemplates": [],
  "customNpcTemplates": [],
  "customSavedScripts": [],
  "requiredCapabilities": [
    "story-rules-v1",
    "creator-features-v1"
  ]
}
