I've been working on an inventory system for Harlowe.
To use it you need to set up 3 variables. $inv is an array of the players inventory. $map is a datamap where the keys are the names of any passage that can store items and the values are arrays. $offstage is an array of items which aren't accessible when the game starts.
Items are just strings. They can be off the form "name" or "name:description". In the latter case the description is shown as a tooltip.
(set: $torch to "Torch:A bright light, perfect for seeing in dark rooms")
(set: $door_key to "Large key:This is the key for your front door")
(set: $small_key to "Small key:It's too small for the front door")
(set: $box to "Small box:It's just a small cardboard box")
(set: $inv to (a: ))
(set: $map to (datamap: "hall", (a: ), "kitchen", (a:), "dining room", (a: $box), "cellar", (a: )))
(set: $offstage to (a: $torch, $small_key, $door_key))
The player's inventory and the contents of the current passage are shown in the footer. This can be blocked by giving a passage the tag 'no-footer'
When a player clicks on an item the default action is to either pick it up or drop it. This can be overridden by making a passage called either take-<name> or drop-<name>.
N.B. This feature depends on accessing the Passages constant. If Harlowe's internals change then this could break. I do it this way because calling (passage:) for a non existent passage results in an error.
If a passage doesn't appear in $map then it's contents is listed as nothing and the player is prevented from dropping anything there.
I've attached a simple game that demonstrates it's usage.
Any comments and suggestions will be appreciated.