Inventory management deserves special mention. It's tempting to make the hero himself into a container (that's the PC in Alan lingo), but that would require predefining him at the library level, and once you do that there's no way to further customize him within the game, e.g. by adding a description. So instead I made a separate object that invisibly follows the hero. It's even possible in theory to replace it with an inner location, so you can pick up and carry actors, but for now I went with the simplest thing that could possibly work.


the player_inventory isa object
  name inventory
  description ""
  with container
    taking thing. -- So you can *attempt* to pick up actors.
    header "You are carrying:"
    else "You are empty-handed."
  verb examine does only list this. end verb.
  verb take does only list this. end verb.
end the player_inventory.

add to every location
    if current actor = hero then
      locate player_inventory here.
    end if.
end add to.


What They Say

"If I was to write a new text adventure I wouldn't bother with any other authoring system. Alan is just that much easier."

Felix Pleșoianu