intfiction.org

The Interactive Fiction Community Forum
It is currently Fri May 24, 2013 6:47 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Dec 20, 2011 7:47 pm 
Offline

Joined: Tue Dec 20, 2011 6:07 pm
Posts: 6
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 :D

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 :D


Top
 Profile Send private message  
 
PostPosted: Tue Dec 20, 2011 8:01 pm 
Offline

Joined: Sun Feb 17, 2008 3:51 pm
Posts: 256
Della wrote:
Long story short, I'm writing a little IF that includes a liquids-and-containers puzzle.

I guess you're aware that this is one of hardest things in IF to implement. :D
Della wrote:
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.

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

_________________
Skinny Mike


Top
 Profile Send private message  
 
PostPosted: Tue Dec 20, 2011 8:56 pm 
Offline

Joined: Tue Dec 20, 2011 6:07 pm
Posts: 6
Skinny Mike wrote:
Della wrote:
Long story short, I'm writing a little IF that includes a liquids-and-containers puzzle.

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


Let's say i had a sneaking suspicion :D

Skinny Mike wrote:
Della wrote:
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.

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


"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! :D


Top
 Profile Send private message  
 
PostPosted: Wed Dec 21, 2011 2:01 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 2086
You could also have used "now everything in V is off-stage."


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group