# The difficult challenge of redirecting X for "take all from X"

``````The testing room is a room.

The player is wearing a suit.
The pockets are part of the suit. The pockets are a container.

A pen is a kind of thing. The player is carrying five pens.

Before inserting something into the suit:
now the second noun is the pockets;

Before removing something from the suit:
now the second noun is the pockets;

OK, let’s try it.

``````testing room

>put all in suit
pen: Done. [Five times]

>take all from suit
That can't contain things.
``````

This is kind of unsurprising, I suppose. I guess the parser checks very early whether or not it makes sense to “take all from suit”. Indeed, with rules on, I can see not a single rule is processed before “That can’t contain things.” is generated. I’m trying to find workarounds but I’m not satisfied with any ideas yet:

1. Make the suit a container so that this parses. I can’t get that to work - if I add “The suit is a container. In the suit is a doodah.” then I get “But it isn’t there now.” in response to “take all from suit”, which seems odd. This also feels like more of a kludge than I like.

2. Simplify so the pockets aren’t an object, the suit is a container, and “pockets” is understood as the suit. This feels like giving up and I’m not ready to yet.

3. Understand “suit” as the pockets and use “does the player mean” to make sure actions get directed to suit or pockets as appropriate. This is my favourite idea currently but this kind of solution makes me nervous; I always worry there will be a condition I didn’t think about when trying to cover things with “does the player mean”.

I’ve been playing around with this example, and I found that before the problem you’re trying to solve, there is another problem. If the player is wearing the suit, even the command GET ALL FROM POCKETS doesn’t work (“There are none at all available!”). You’ll find that if you drop the suit, then GET ALL FROM POCKETS works, but still not GET ALL FROM SUIT.

So your problem is real when the game is aware of the suit, but something about that deeper level “multi-inside” programming that applies to (something) ALL commands (type TRACE before you do the failed GET ALL FROM SUIT to see it listed) means the pockets aren’t even being considered in the situation where the suit is worn. This means there’s no trick we can do there to redirect to the pockets. I’m not sure if there is some I6 tweak that can be done to get around that behaviour (likely chime-in point for another poster) but if there isn’t, methods you’d consider kludgier are possibly the way to go.

Ok, I found an older topic on this forum pointing out a bug related to the behaviour you’re dealing with here. It’s been reported and something of a workaround was presented…

The workaround fixes the problem I reported, though not your pockets problem. However, it will now allow you to have a suit that’s a container into which you can PUT ALL and from which you can TAKE ALL, even when it’s worn. I think that’s a good start. See code below, which incorporates the fix:

``````The testing room is a room.

The player is wearing a suit. The suit is a container.

A pen is a kind of thing. The player is carrying five pens.

The exclude indirect possessions from take all rule is not listed in any rulebook.

Rule for deciding whether all includes things enclosed by the person reaching while taking or taking off (this is the new exclude indirect possessions from take all rule):
it does not;
``````

Many thanks Wade @severedhand for this response. You discovering this other problem prompted me to remember I had already dealt with something similar, because I have another container the player holds, and already have an “exclude direct possessions” solution. With regard to suit vs. pockets, I played around a bit and discovered that the “does the player mean” solution works nicely and I think I’m going to trust it. So my solution is now:

``````The testing room is a room.

The player is wearing a suit.
The suit pockets are part of the suit. The pockets are a container. Understand "pocket" as the suit pockets.

Does the player mean doing something with the pockets: it is unlikely.
Does the player mean inserting into the pockets: it is likely.
Does the player mean removing from the pockets: it is likely.
Does the player mean searching the pockets: it is likely.

The exclude indirect possessions from take all rule does nothing when the item described is contained by the pockets and the current action is removing.

A pen is a kind of thing. The player is carrying five pens.

[The following is useful for testing.]
In the testing room is an ornament. In the testing room is a box. The box is fixed in place. The box is a container. A paperclip is a kind of thing. In the box are five paperclips.``````

P.S. sorry for the slow reply to your help - I thought I would have more time last weekend than I did.

Several edits to this post to add further code I later realised is necessary.

1 Like