i7: removing all items from a container

Hello everyone! I’ve been fiddling around with Inform 7 for a while, so I figured out I should make an account already.

Well, that, and the fact that I lost my patience after hitting a roadblock :smiley:

Long story short, I’m writing a little IF that includes a liquids-and-containers puzzle. I need a system to handle containers [vessels] that can be empty or full of a liquid (and you can’t put non-liquids in), and you can pour them from a vessel to another provided the destination vessel is empty. you can also pour them down a sink and destroy the liquid ending up with an empty vessel. There is no liquid-mixing involved.

I’m handling vessels as containers that can only hold a single thing, which must be a kind of thing called a “liquid”.

The point I’m stuck at is that I can’t for the life of me figure out how to “empty a container”, as in, destroy/remove from play an item inside a container by targeting the container.

I have no way of knowing beforehand what liquid will be in, say, a bottle, when the player pours it down the drain, and I can’t find a way to tell Inform that it has to remove from play the item inside the container in question.

I’ve thought about restricting the command to “pour the liquid into the drain” and forbidding “pour the bottle into the drain”, but it’s a was of getting around the problem instead of solving it.

I guess the same problem could be encountered in a puzzle with a box that can hold an item which, when a button is pressed, is teleported someplace else (another puzzle I have planned).

Basically: how do I move an unknown item X which is inside a container?

Thank you for any assistance :smiley:

I guess you’re aware that this is one of hardest things in IF to implement. :smiley:

Something like this?To dump (V - a container): now everything enclosed by V is off-stage.

Let’s say i had a sneaking suspicion :smiley:

Enclosed” is the word?

[runs off to test]

Holy crap you’re right. Thank you, I’ve been playing “guess the word” for two damn hours!

[reads “Enclosed” on the documentation]

Well, Enclosed seems a pretty powerful tool. Wonder why they spend so little space explaining it. I didn’t even realize it was there until now.

Well, it’s off to scripting again! :smiley:

You could also have used “now everything in V is off-stage.”