"can't see any such thing" when removing

I can’t figure out why this doesn’t work:

[code]A vessel is a kind of thing. A vessel can be full or empty. A vessel can be pumped or unpumped.

Backyard is a room.

The kiddie pool is a full vessel in backyard. The bucket is a vessel in backyard. The water pump is a vessel in backyard.

Instead of inserting the water pump into a vessel:
say “You insert one end of the pump into [the second noun].”;
Now the second noun is pumped.

Instead of removing the water pump from a vessel:
say “You remove the end of the pump from [the second noun].”;
Now the second noun is unpumped.

test me with “rules/put pump in pool/remove pump from pool”[/code]

Okay, I can guess why it doesn’t work, but I can’t figure out how to fix it. For some reason, the grammar of “remove” limits the scope to the contents of the second noun. Seems like a bad idea to me, but I know it’s an old, complicated, little-used verb that hasn’t changed much since I6. Do I have to completely replace the “remove” command to make this do what I want?

How about:

After taking the water pump when the water pump is in a vessel:
say “You remove the end of the pump from [the second noun].”;
Now the second noun is unpumped.

You’re using Instead rules, so the main action behaviors never happen. The pump is never actually inserted, so it isn’t in the pool. Change your insteads to reports (or some other way of distributing the action rulebooks) and it will work.

…Or rather, it will work if you also define vessels as kinds of containers rather than kinds of things:

A vessel is a kind of container. A vessel can be full or empty. A vessel can be pumped or unpumped. A vessel is transparent.

–Erik

No, defining the vessel as a container doesn’t change anything. And using taking instead of removing doesn’t work either, for two reasons:

  1. The pump has two ends, each of which can be “in” a vessel so normal containment relations don’t apply. That’s why I created the “pumped” property - it’s essentially a many-to-one containment relation.
  2. taking doesn’t have a second noun, so we don’t know which end of the pump to remove

None of the standard verb have, really.

The idea is to successfully disambiguate “take rock from table” when there are several rocks scattered around the room. I think the results are inferior to setting up an “it is likely” rule, but this works out of the box. And, as you say, it’s old.

Yes. Also the “get” and “take” commands, to handle the “get/from” and “take/from” cases.

This is not my favorite part of I7.

You seem to be describing your actual source text rather than the excerpt you posted. For that excerpt to work, vessels definitely do need to be containers, otherwise the pump can’t be inserted into the pool. (This doesn’t help you, I know, but it might help someone else who is browsing this thread and trying to figure out what’s going on.)

–Erik

Yes, the source includes a pretty much complete implementation of the containment relation for the two ends of the pump, without using any of Inform’s built-in containment. I didn’t think it was necessary for the example - setting the “pumped” property is the key point.

No kidding! Argh!

I wish, at least, that there were another library message for this error, such as “You can’t see any such thing in [the second noun].” As it is, there’s no way to know whether the message refers to the noun or the second noun.

I guess as an alternative, I could intercept the “printing a parser error” activity.

Actually, this seems to be a relatively painless fix. I still have to catch all the take synonyms, but it looks like I don’t have to reimplement them for the taking action:

[code]A vessel is a kind of container. A vessel can be full or empty. A vessel can be pumped or unpumped.

Backyard is a room.

The kiddie pool is a full vessel in backyard. The bucket is a vessel in backyard. The water pump is a vessel in backyard.

Unpumping it from is an action applying to two things. Understand “remove [something] from [vessel]” as unpumping it from.

Instead of inserting the water pump into a vessel:
say “You insert one end of the pump into [the second noun].”;
Now the second noun is pumped.

Instead of unpumping the water pump from a vessel:
say “You remove the end of the pump from [the second noun].”;
Now the second noun is unpumped.

test me with “rules/put pump in pool/remove pump from pool”[/code]

As a footnote … even when the water pump is connected to the kiddie pool, the player will still be able to walk out of the room carrying the water pump (or the bucket, which may be more likely), and the connection between the two objects will remain – probably not what you want.

What you’re doing has more in common with connecting (attaching) than with inserting. You might want to take a look at the examples in Recipe Book 10.6. Neither of them is exactly what you’re looking for, but they might suggest something.

Once again, I left out details like that for brevity. Rest assured, my source covers situations like walking around with connected items in obsessive detail. In fact, I’m starting to worry that I’m spending too much time on this and I need to get back to other parts of my WIP.

Whoa, are you doing something that effectively involves both liquids and ropes in your WiP? Isn’t that like the Snake River Canyon Jump of IF programming?

:laughing: :laughing: :laughing:

I never intended to have anything complicated, but then I had an idea for this puzzle…