Pages

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
  entered
    if current actor = hero then
      locate player_inventory here.
    end if.
end add to.

 

What They Say

"[the game] does not represent the real capabilities of the Alan Language but does demonstrate Alan's amazing ability to allow someone who has never done an iota of computer programming of any kind to produce SOMETHING within a few weeks!"

Eric Mayer (on his game HeBGB Horrors)