Custom action not recognizing object?

Trying to make it possible to hide in a closet in my game
The code is:

Hiding is an action applying to an object.
Understand “hide” as hiding.

in-closet is a truth state that varies.
closet-timer is a number that varies. closet-timer is 0.

Instead of hiding in closet:
say “You quickly dive in the closet.”;
now in-closet is true.

But when I try hiding in closet, it says

hide in closet
I only understood you as far as wanting to hide.

why doesn’t this work

edit: changed it to

There is a closet fixed in place in the Wardrobe.

Hiding is an action applying to an object.
Understand “hide in [something]” as hiding.

in-closet is a truth state that varies.
closet-timer is a number that varies. closet-timer is 0.

Instead of hiding in closet:
say “You quickly dive in the closet.”;
now in-closet is true.

and now it just says

You can’t see any such thing.

Your understand statement needs to include the token of the object you want your action to apply to. So instead of:

Understand "Hide" as hiding.

It should be:

Understand "Hide in [something]" as hiding.

Edit: You will also need to change the name of the action to “Hiding in” if you want to use “Instead of hiding in closet” or change this to “Instead of hiding closet”.

3 Likes

You also need to include the preposition in the action name if you want to write rules about “hiding in the closet”.

Hiding in is an action applying to one thing.
3 Likes

tried that, now it says

You can’t see any such thing.

Or you might just like to go with

The closet is an openable enterable container in the bedroom.
Understand "hide in [thing]" as entering.
3 Likes

tried that, now it just errors

that worked, ty