In and On a container

Hi.

I’m trying to place things in the chest with some description but it doesnt work. I can only get it working with the word on even though without the following code you can “get diamond” and “put diamond in chest”.

So would I just have to replace the chest with something that the diamonds can sit on?

“test in and on things” by Michelle

Cave is a room.

diamonds are things in the cave

A chest is an open container in the cave.

Instead of putting diamonds on the chest:
say “you carefully place the diamonds on the chest using ON”;
move the diamonds to the chest.

Instead of putting diamonds in the chest:
say “you carefully place the diamonds on the chest using IN”;
move the diamonds to the chest.

Thanks.

When the player types PUT DIAMONDS IN CHEST, their command gets mapped to an action called “inserting it into”. This is the name you need to write rules for the action. So the rule you want is

Instead of inserting diamonds into the chest:
    say "you carefully place the diamonds on the chest using IN";
    move the diamonds to the chest.

The command PUT DIAMONDS ON CHEST maps to the “putting it on” action.

You can check out the names of Inform actions, and the commands that map to them, by consulting the Index (the ACTIONS tab) in the IDE.

1 Like

As an additional hint - when playing/testing the game in the IDE you can type “actions” to enable action tracking. This will tell you what Inform is actually doing or trying to do. In your case it would have shown you that it uses “inserting someting into something” when you try to “put something into something”. It’s always my #1 thing to do when something doesn’t work as I expect it to.

Thank you!! This will be very useful.