Is handled vs. initial inventory

I hit a bug where an object initially seeded into the player’s inventory is not marked as ($ is handled). I added a rule to my intro to ensure everything in the player’s inventory is handled.

Is this something the standard library could do instead?

It also raises some questions such as: if the player holds a container, are the objects in the container handled or not?
So this is either a plea for a stdlib change, or a request to put a warning into the manual.

1 Like

“Is handled” deals with the appearance of items in descriptions so that the author might give a different description of an item if the item is not yet picked up, like

~(* is handled) Forgotten in the corner of the room lies an empty bottle of malt whisky.

Could it be that you have used #in instead of #heldby the player? #heldby does not care about handled or not handled, but #in places the object inside of the player making it invisible because the player is not a kind of container.

I don’t think you understood my question. If you read stdlib, you would see that is handled is set by verbs such as take, but makes no allowances for items already in the players possession at the start of the game.

This boils down to what it means to be pristine/handled. According to the manual:

As soon as the player picks up an object (or otherwise moves it from its original location), [we] say that the object has become handled

If the original location is somewhere in the player’s inventory, the object is technically still in its pristine condition. The question is, does this definition make sense, or should it be changed?

I think it might depend on circumstances. When we examine the initially-held wallet, perhaps we want the receipt inside to call attention to itself. But, because this is the initial state, examining the wallet with the receipt inside is an action that the story author can anticipate, just like examining a bookshelf in a room. It will be the first impression of the wallet, and thus, the author might want to provide custom text for the whole experience:

(descr #wallet)
        Imitation leather. Jammed zipper.
        (if) (#receipt is pristine) (then)
                One pitiful receipt inside.

In other situations, bland default descriptions could be sufficient, and in those cases it would be easy to enable them on a per-object basis, using (* is handled). The following, however, is currently disallowed by the compiler:

($Obj is handled)
        *($Obj is nested #heldby #player)

The error message is: “Initial state of dynamic predicate depends on the state of another dynamic predicate, ($ has parent $)”. But perhaps this should be supported; I just didn’t think of this use case before.

1 Like

I think the manual and the code are right, but perhaps there needs to be a little callout in the documentation about the pitfalls of the player starting with a container with items (the wallet containing the receipt, in my case), in that some of the useful built-in predicates will skip over the pristine items you happen to be carrying.


Yes, that is a good point. I’ll make sure to mention it in the manual.

1 Like