{
  "version": "1.1",
  "name": "Companion Command System",
  "startRoom": "lesson_camp",
  "author": "TAGMaker",
  "description": "Talk to a companion to choose Follow, Wait or Help. Following changes their real location; waiting leaves them behind. Help opens a heavy door only while the living companion is with you at that door.",
  "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_camp.taml",
      "content": "room lesson_camp\n  exit north: lesson_doorway\n  name: \"Companion Camp\"\n  description: \"Talk to the companion to choose Follow, Wait or Help. The heavy door is north.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_doorway.taml",
      "content": "room lesson_doorway\n  blocked north: \"The door is too heavy. Bring your companion and ask for Help.\"\n  exit north: lesson_beyond when: lesson_opened\n  exit south: lesson_camp\n  name: \"Heavy Door Landing\"\n  description: \"Talk to your present companion and choose Help to open the north door. The camp is south.\"\n  dark: false\nend"
    },
    {
      "path": "rooms/lesson_beyond.taml",
      "content": "room lesson_beyond\n  exit south: lesson_doorway\n  name: \"Beyond the Heavy Door\"\n  description: \"The landing is south.\"\n  dark: false\nend"
    },
    {
      "path": "npcs/lesson_ally.taml",
      "content": "npc lesson_ally\n  name: \"companion\"\n  description: \"A companion who can follow, wait or help at the heavy door.\"\n  location: lesson_camp\n  mobile: true\n  follow: false\n  health: 100\n  combat_side: ally\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  dialogue default:\n    print \"lesson ally looks at you in silence.\"\n  end\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_opened",
        "name": "opened",
        "description": "Progress remembered by this recipe.",
        "type": "boolean",
        "initial": false
      }
    ],
    "rules": [
      {
        "id": "lesson_commands",
        "name": "commands",
        "enabled": true,
        "trigger": {
          "kind": "npc",
          "target": "lesson_ally",
          "event": "talk"
        },
        "match": "all",
        "conditions": [],
        "actions": [
          {
            "kind": "prompt",
            "target": "lesson_commands"
          }
        ],
        "otherwise": "",
        "once": false
      },
      {
        "id": "lesson_help",
        "name": "help",
        "enabled": true,
        "trigger": {
          "kind": "manual",
          "target": "",
          "event": ""
        },
        "match": "all",
        "conditions": [
          {
            "kind": "room",
            "target": "lesson_doorway",
            "operator": "==",
            "value": true
          },
          {
            "kind": "npc_available",
            "target": "lesson_ally",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "state",
            "target": "lesson_opened",
            "value": true
          },
          {
            "kind": "message",
            "value": "Together you lift the heavy door. It stays open."
          }
        ],
        "otherwise": "There is nothing here that needs my help. Take me to the heavy door.",
        "once": true,
        "repeatText": "The heavy door is already open."
      },
      {
        "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_opened",
            "operator": "==",
            "value": true
          }
        ],
        "actions": [
          {
            "kind": "message",
            "value": "The present companion helped with the heavy door. 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,
      "npcProfiles": [
        {
          "version": 1,
          "id": "lesson_ally_profile",
          "name": "companion abilities",
          "npcId": "lesson_ally",
          "enabled": true,
          "memory": [],
          "traits": {
            "loyalty": 50,
            "fear": 0,
            "suspicion": 0
          },
          "life": {
            "maxHealth": 100,
            "initial": "active",
            "essential": false,
            "defeat": "dead",
            "retreatAtHealth": 0
          },
          "inventory": {
            "objects": [],
            "equipped": [],
            "equipment": [],
            "money": 0,
            "dropOnDeath": false
          },
          "combat": {
            "assist": "off",
            "target": "first_enemy",
            "interceptPercent": 50,
            "interval": 1
          },
          "perception": {
            "enabled": false,
            "sightRange": 0,
            "hearingRange": 0,
            "suspicionPerSight": 10,
            "suspicionPerNoise": 10,
            "threshold": 50,
            "investigate": false,
            "returnHome": false,
            "allowedRoomIds": []
          },
          "abilities": []
        }
      ],
      "prompts": [
        {
          "id": "lesson_commands",
          "name": "What should your companion do?",
          "enabled": true,
          "text": "What should your companion do?",
          "cancelLabel": "Leave the choice for later",
          "cancelable": true,
          "owner": {
            "kind": "npc",
            "id": "lesson_ally"
          },
          "options": [
            {
              "id": "follow",
              "label": "Follow me",
              "match": "all",
              "conditions": [],
              "actions": [
                {
                  "kind": "npc_control",
                  "target": "lesson_ally",
                  "operation": "recruit"
                },
                {
                  "kind": "message",
                  "value": "Your companion agrees to follow."
                }
              ],
              "once": false,
              "unavailable": "disable"
            },
            {
              "id": "wait",
              "label": "Wait here",
              "match": "all",
              "conditions": [],
              "actions": [
                {
                  "kind": "npc_control",
                  "target": "lesson_ally",
                  "operation": "wait"
                },
                {
                  "kind": "message",
                  "value": "Your companion waits here."
                }
              ],
              "once": false,
              "unavailable": "disable"
            },
            {
              "id": "help",
              "label": "Help with the heavy door",
              "match": "all",
              "conditions": [],
              "actions": [
                {
                  "kind": "rule",
                  "target": "lesson_help"
                }
              ],
              "once": false,
              "unavailable": "disable"
            }
          ]
        }
      ]
    }
  },
  "cookbookRecipes": [
    {
      "version": 1,
      "settings": {
        "instance": "lesson",
        "recipeId": "a6-companion-command-system",
        "choices": {
          "camp": {
            "existing": "",
            "name": "Companion Camp",
            "description": "Talk to the companion to choose Follow, Wait or Help. The heavy door is north."
          },
          "doorway": {
            "existing": "",
            "name": "Heavy Door Landing",
            "description": "Talk to your present companion and choose Help to open the north door. The camp is south."
          },
          "beyond": {
            "existing": "",
            "name": "Beyond the Heavy Door",
            "description": "The landing is south."
          },
          "ally": {
            "existing": "",
            "name": "companion",
            "description": "A companion who can follow, wait or help at the heavy door."
          }
        },
        "values": {
          "follow": "Your companion agrees to follow.",
          "wait": "Your companion waits here.",
          "help": "Together you lift the heavy door. It stays open.",
          "wrongRoom": "There is nothing here that needs my help. Take me to the heavy door.",
          "repeat": "The heavy door is already open."
        },
        "reuseRoutes": {}
      },
      "owned": [
        {
          "path": "files",
          "key": "rooms/lesson_camp.taml",
          "after": {
            "path": "rooms/lesson_camp.taml",
            "name": "lesson_camp.taml",
            "content": "room lesson_camp\n  exit north: lesson_doorway\n  name: \"Companion Camp\"\n  description: \"Talk to the companion to choose Follow, Wait or Help. The heavy door is north.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_doorway.taml",
          "after": {
            "path": "rooms/lesson_doorway.taml",
            "name": "lesson_doorway.taml",
            "content": "room lesson_doorway\n  blocked north: \"The door is too heavy. Bring your companion and ask for Help.\"\n  exit north: lesson_beyond when: lesson_opened\n  exit south: lesson_camp\n  name: \"Heavy Door Landing\"\n  description: \"Talk to your present companion and choose Help to open the north door. The camp is south.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "rooms/lesson_beyond.taml",
          "after": {
            "path": "rooms/lesson_beyond.taml",
            "name": "lesson_beyond.taml",
            "content": "room lesson_beyond\n  exit south: lesson_doorway\n  name: \"Beyond the Heavy Door\"\n  description: \"The landing is south.\"\n  dark: false\nend",
            "isDirty": true
          }
        },
        {
          "path": "files",
          "key": "npcs/lesson_ally.taml",
          "after": {
            "path": "npcs/lesson_ally.taml",
            "name": "lesson_ally.taml",
            "content": "npc lesson_ally\n  name: \"companion\"\n  description: \"A companion who can follow, wait or help at the heavy door.\"\n  location: lesson_camp\n  mobile: true\n  follow: false\n  health: 100\n  combat_side: ally\n  auto_fight: false\n  attack_power: 10\n  defense: 0\n  trust: 50\n  dialogue default:\n    print \"lesson ally looks at you in silence.\"\n  end\nend",
            "isDirty": true
          }
        },
        {
          "path": "npcs",
          "key": "lesson_ally",
          "after": {
            "id": "lesson_ally",
            "name": "companion",
            "description": "A companion who can follow, wait or help at the heavy door.",
            "location": "lesson_camp",
            "mobile": true,
            "aliases": [],
            "onEnter": "",
            "onExamine": "",
            "onTalk": "",
            "onAttack": "",
            "onDeath": "",
            "onFollow": "",
            "onAutoAttack": "",
            "onTrustChange": "",
            "onGive": "",
            "onBeforeTalk": "",
            "onAfterTalk": "",
            "onBeforeAttack": "",
            "onAfterAttack": "",
            "onDamage": "",
            "onHeal": "",
            "onMove": "",
            "onLeave": "",
            "followPlayer": false,
            "health": 100,
            "combatSide": "ally",
            "autoFight": false,
            "attackPower": 10,
            "defense": 0,
            "trustLevel": 50,
            "conversationEnabled": false,
            "convGreeting": "",
            "convFarewell": "",
            "convTopics": [],
            "dialogues": [
              {
                "id": "default",
                "trigger": "default",
                "body": "print \"lesson ally looks at you in silence.\""
              }
            ]
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_camp",
          "after": {
            "id": "lesson_camp",
            "name": "Companion Camp",
            "description": "Talk to the companion to choose Follow, Wait or Help. The heavy door is north.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 100,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_doorway",
          "after": {
            "id": "lesson_doorway",
            "name": "Heavy Door Landing",
            "description": "Talk to your present companion and choose Help to open the north door. The camp is south.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 320,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {
              "north": "The door is too heavy. Bring your companion and ask for Help."
            }
          }
        },
        {
          "path": "mapRooms",
          "key": "lesson_beyond",
          "after": {
            "id": "lesson_beyond",
            "name": "Beyond the Heavy Door",
            "description": "The landing is south.",
            "reentryEnabled": false,
            "reentryDesc": "",
            "hint": "",
            "dark": false,
            "roomType": "regular",
            "x": 540,
            "y": 100,
            "width": 160,
            "height": 64,
            "color": "#000000",
            "blockedDescriptions": {}
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_landing",
          "after": {
            "id": "lesson_route_landing",
            "fromRoom": "lesson_camp",
            "toRoom": "lesson_doorway",
            "direction": "north",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_camp",
          "after": {
            "id": "lesson_route_camp",
            "fromRoom": "lesson_doorway",
            "toRoom": "lesson_camp",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_door",
          "after": {
            "id": "lesson_route_door",
            "fromRoom": "lesson_doorway",
            "toRoom": "lesson_beyond",
            "direction": "north",
            "locked": false,
            "when": "lesson_opened"
          }
        },
        {
          "path": "mapExits",
          "key": "lesson_route_back",
          "after": {
            "id": "lesson_route_back",
            "fromRoom": "lesson_beyond",
            "toRoom": "lesson_doorway",
            "direction": "south",
            "locked": false
          }
        },
        {
          "path": "manifest.story.states",
          "key": "lesson_opened",
          "after": {
            "id": "lesson_opened",
            "name": "opened",
            "description": "Progress remembered by this recipe.",
            "type": "boolean",
            "initial": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_commands",
          "after": {
            "id": "lesson_commands",
            "name": "commands",
            "enabled": true,
            "trigger": {
              "kind": "npc",
              "target": "lesson_ally",
              "event": "talk"
            },
            "match": "all",
            "conditions": [],
            "actions": [
              {
                "kind": "prompt",
                "target": "lesson_commands"
              }
            ],
            "otherwise": "",
            "once": false
          }
        },
        {
          "path": "manifest.story.rules",
          "key": "lesson_help",
          "after": {
            "id": "lesson_help",
            "name": "help",
            "enabled": true,
            "trigger": {
              "kind": "manual",
              "target": "",
              "event": ""
            },
            "match": "all",
            "conditions": [
              {
                "kind": "room",
                "target": "lesson_doorway",
                "operator": "==",
                "value": true
              },
              {
                "kind": "npc_available",
                "target": "lesson_ally",
                "operator": "==",
                "value": true
              }
            ],
            "actions": [
              {
                "kind": "state",
                "target": "lesson_opened",
                "value": true
              },
              {
                "kind": "message",
                "value": "Together you lift the heavy door. It stays open."
              }
            ],
            "otherwise": "There is nothing here that needs my help. Take me to the heavy door.",
            "once": true,
            "repeatText": "The heavy door is already open."
          }
        },
        {
          "path": "manifest.story.features.npcProfiles",
          "key": "lesson_ally_profile",
          "after": {
            "version": 1,
            "id": "lesson_ally_profile",
            "name": "companion abilities",
            "npcId": "lesson_ally",
            "enabled": true,
            "memory": [],
            "traits": {
              "loyalty": 50,
              "fear": 0,
              "suspicion": 0
            },
            "life": {
              "maxHealth": 100,
              "initial": "active",
              "essential": false,
              "defeat": "dead",
              "retreatAtHealth": 0
            },
            "inventory": {
              "objects": [],
              "equipped": [],
              "equipment": [],
              "money": 0,
              "dropOnDeath": false
            },
            "combat": {
              "assist": "off",
              "target": "first_enemy",
              "interceptPercent": 50,
              "interval": 1
            },
            "perception": {
              "enabled": false,
              "sightRange": 0,
              "hearingRange": 0,
              "suspicionPerSight": 10,
              "suspicionPerNoise": 10,
              "threshold": 50,
              "investigate": false,
              "returnHome": false,
              "allowedRoomIds": []
            },
            "abilities": []
          }
        },
        {
          "path": "manifest.story.features.prompts",
          "key": "lesson_commands",
          "after": {
            "id": "lesson_commands",
            "name": "What should your companion do?",
            "enabled": true,
            "text": "What should your companion do?",
            "cancelLabel": "Leave the choice for later",
            "cancelable": true,
            "owner": {
              "kind": "npc",
              "id": "lesson_ally"
            },
            "options": [
              {
                "id": "follow",
                "label": "Follow me",
                "match": "all",
                "conditions": [],
                "actions": [
                  {
                    "kind": "npc_control",
                    "target": "lesson_ally",
                    "operation": "recruit"
                  },
                  {
                    "kind": "message",
                    "value": "Your companion agrees to follow."
                  }
                ],
                "once": false,
                "unavailable": "disable"
              },
              {
                "id": "wait",
                "label": "Wait here",
                "match": "all",
                "conditions": [],
                "actions": [
                  {
                    "kind": "npc_control",
                    "target": "lesson_ally",
                    "operation": "wait"
                  },
                  {
                    "kind": "message",
                    "value": "Your companion waits here."
                  }
                ],
                "once": false,
                "unavailable": "disable"
              },
              {
                "id": "help",
                "label": "Help with the heavy door",
                "match": "all",
                "conditions": [],
                "actions": [
                  {
                    "kind": "rule",
                    "target": "lesson_help"
                  }
                ],
                "once": false,
                "unavailable": "disable"
              }
            ]
          }
        }
      ]
    }
  ],
  "creatorNotes": "Talk to a companion to choose Follow, Wait or Help. Following changes their real location; waiting leaves them behind. Help opens a heavy door only while the living companion is with you at that door.\nOpen Help → Cookbook → Companion Command System → Start this recipe to inspect its saved settings. The field journal and 100-point ending belong only to the sample game.\nCommands: talk companion; 3; talk companion; 1; talk companion; 2; north; talk companion; north; south; talk companion; 1; north; talk companion; 3; talk companion; 3; north; use field journal",
  "mapRooms": [
    {
      "id": "lesson_camp",
      "name": "Companion Camp",
      "description": "Talk to the companion to choose Follow, Wait or Help. The heavy door is north.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 100,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    },
    {
      "id": "lesson_doorway",
      "name": "Heavy Door Landing",
      "description": "Talk to your present companion and choose Help to open the north door. The camp is south.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 320,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {
        "north": "The door is too heavy. Bring your companion and ask for Help."
      }
    },
    {
      "id": "lesson_beyond",
      "name": "Beyond the Heavy Door",
      "description": "The landing is south.",
      "reentryEnabled": false,
      "reentryDesc": "",
      "hint": "",
      "dark": false,
      "roomType": "regular",
      "x": 540,
      "y": 100,
      "width": 160,
      "height": 64,
      "color": "#000000",
      "blockedDescriptions": {}
    }
  ],
  "mapExits": [
    {
      "id": "lesson_route_landing",
      "fromRoom": "lesson_camp",
      "toRoom": "lesson_doorway",
      "direction": "north",
      "locked": false
    },
    {
      "id": "lesson_route_camp",
      "fromRoom": "lesson_doorway",
      "toRoom": "lesson_camp",
      "direction": "south",
      "locked": false
    },
    {
      "id": "lesson_route_door",
      "fromRoom": "lesson_doorway",
      "toRoom": "lesson_beyond",
      "direction": "north",
      "locked": false,
      "when": "lesson_opened"
    },
    {
      "id": "lesson_route_back",
      "fromRoom": "lesson_beyond",
      "toRoom": "lesson_doorway",
      "direction": "south",
      "locked": false
    }
  ],
  "objects": [
    {
      "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_ally",
      "name": "companion",
      "description": "A companion who can follow, wait or help at the heavy door.",
      "location": "lesson_camp",
      "mobile": true,
      "aliases": [],
      "onEnter": "",
      "onExamine": "",
      "onTalk": "",
      "onAttack": "",
      "onDeath": "",
      "onFollow": "",
      "onAutoAttack": "",
      "onTrustChange": "",
      "onGive": "",
      "onBeforeTalk": "",
      "onAfterTalk": "",
      "onBeforeAttack": "",
      "onAfterAttack": "",
      "onDamage": "",
      "onHeal": "",
      "onMove": "",
      "onLeave": "",
      "followPlayer": false,
      "health": 100,
      "combatSide": "ally",
      "autoFight": false,
      "attackPower": 10,
      "defense": 0,
      "trustLevel": 50,
      "conversationEnabled": false,
      "convGreeting": "",
      "convFarewell": "",
      "convTopics": [],
      "dialogues": [
        {
          "id": "default",
          "trigger": "default",
          "body": "print \"lesson ally looks at you in silence.\""
        }
      ]
    }
  ],
  "activeMechanics": [],
  "verbAliases": [],
  "scripts": [],
  "worldEvents": [],
  "customMechanicDefs": [],
  "savedMechanicTemplates": [],
  "objectiveSets": [],
  "gameOutliner": {},
  "customRoomTemplates": [],
  "customObjectTemplates": [],
  "customNpcTemplates": [],
  "customSavedScripts": [],
  "requiredCapabilities": [
    "npc-capabilities-v1",
    "story-rules-v1",
    "creator-features-v1"
  ]
}
