Funkiness with the implicitly pass through other barriers rule

So I have this setup:

Lab is a room. 

The bed is in the Lab.
The top bunk is a part of the bed. It is a supporter. It is enterable. 
The bottom bunk is a part of the bed. It is a supporter. It is enterable. 

Instead of entering the bed:
	try entering a bunk;

(The reason I have the bed as well as the two bunks is that players want to refer to the bed as a whole, otherwise I’d get rid of it and avoid the problem that follows.)

But then I get:

Lab
You can see a bed here.

>get on bed
You get onto the top bunk.

>get on bottom bunk
(getting off the top bunk)
(getting out of Lab)
But you aren't in anything at the moment.

Which is weird.

Checking out the implicitly pass through other barriers rule:

Check an actor entering (this is the implicitly pass through other barriers rule):
	if the holder of the actor is the holder of the noun, continue the action;
	let the local ceiling be the common ancestor of the actor with the noun;
	while the holder of the actor is not the local ceiling:
		let the current home be the holder of the actor;
		if the player is the actor:
			if the current home is a supporter or the current home is an animal:
				say "(getting off [the current home])[command clarification break]" (A);
			otherwise:
				say "(getting out of [the current home])[command clarification break]" (B);
		silently try the actor trying exiting;
		if the holder of the actor is the current home, stop the action;
<snip>

It looks like what’s probably happening is that:

  1. local ceiling is the bed.
  2. exiting the top bunk places the actor in the Lab, so
  3. the rule tries to exit the Lab.

Of course I can add as many layers between the Lab and the bed as I like (I tried putting it on two enterable supporters) and the problem will persist, because once the actor leaves the top bunk, they’ve missed the common ancestor of the two bunks altogether.

I tried adding a couple of lines:

Check an actor entering (this is the new implicitly pass through other barriers rule):
	if the holder of the actor is the holder of the noun, continue the action;
	let the local ceiling be the common ancestor of the actor with the noun;
	while the local ceiling is not a container and the local ceiling is not a supporter and the local ceiling is not a room:
		now the local ceiling is the holder of the local ceiling;
	while the holder of the actor is not the local ceiling:
		let the current home be the holder of the actor;
		if the player is the actor:
			if the current home is a supporter or the current home is an animal:
				say "(getting off [the current home])[command clarification break]" (A);
			otherwise:
				say "(getting out of [the current home])[command clarification break]" (B);
		silently try the actor trying exiting;
		if the holder of the actor is the current home, stop the action;
<snip>

and this worked.

So my questions are:

  1. Is this going to cause other unforeseen problems?
  2. Does this qualify as a bug?

I’d definitely call it a bug. I think it should be using CoreOfParentOfCoreOf, or whatever the I7 equivalent of that routine is, instead of “holder of”—that would make it treat the bed (and anything else assembled with “part of”) as a single step in the hierarchy.

Yes, certainly a bug. I guess the simpler workaround would be not to make the bunks part of the bed. (The player won’t know,)

1 Like

I thought I’d seen something like this before!
Discussed in this post.

1 Like

Ah, well, you know. Puzzle reasons. :slightly_smiling_face:

Do these modifications help?

Check an actor entering (this is the alternate can't enter what's already entered rule):
    if the actor is the noun, make no decision;
    let the local ceiling be the common ancestor of the actor with the noun;
    if the holder of the actor is the noun: [modified]
	    if the player is the actor:
		    if the noun is a supporter:
			    say "But [we]['re] already on [the noun]." (A);
		    otherwise:
			    say "But [we]['re] already in [the noun]." (B);
	    stop the action.

The alternate can't enter what's already entered rule is listed instead of the can't enter what's already entered rule in the check entering rules.

Check an actor entering (this is the alternate implicitly pass through other barriers rule):
    if the holder of the actor is the holder of the noun, continue the action;
    let the local ceiling be the common ancestor of the actor with the not-counting-parts holder of the noun; [modified]
    while the holder of the actor is not the local ceiling:
	    let the current home be the holder of the actor;
	    if the player is the actor:
		    if the current home is a supporter or the current home is an animal:
			    say "(getting off [the current home])[command clarification break]" (A);
		    otherwise:
			    say "(getting out of [the current home])[command clarification break]" (B);
	    silently try the actor trying exiting;
	    if the holder of the actor is the current home, stop the action;
    if the holder of the actor is the noun, stop the action;
    if the holder of the actor is the holder of the noun, continue the action;
    let the target be the holder of the noun;
    if the noun is part of the target, let the target be the holder of the target;
    while the target is a thing:
	    if the holder of the target is the local ceiling:
		    if the player is the actor:
			    if the target is a supporter:
				    say "(getting onto [the target])[command clarification break]" (C);
			    otherwise if the target is a container:
				    say "(getting into [the target])[command clarification break]" (D);
			    otherwise:
				    say "(entering [the target])[command clarification break]" (E);
		    silently try the actor trying entering the target;
		    if the holder of the actor is not the target, stop the action;
		    convert to the entering action on the noun;
		    continue the action;
	    let the target be the holder of the target;

The alternate implicitly pass through other barriers rule is listed instead of the implicitly pass through other barriers rule in the check entering rules.

EDIT: I should clarify that the alternate can't enter what's already entered rule is intended to partly answer your question #1. It heads off a minor issue that persists after installation of the alternate implicitly pass through other barriers rule (which functions just like your version but makes use of the I7 phrase to which Draconis was alluding). The issue is that the normal version of the can't enter what's already entered rule, which is:

Check an actor entering (this is the can't enter what's already entered rule):
    if the actor is the noun, make no decision;
    let the local ceiling be the common ancestor of the actor with the noun;
    if the local ceiling is the noun:
	    if the player is the actor:
		    if the noun is a supporter:
			    say "But [we]['re] already on [the noun]." (A);
		    otherwise:
			    say "But [we]['re] already in [the noun]." (B);
	    stop the action.

compares the noun to the local ceiling, which is assumed to be identical to the container or supporter in which the player is situated. As a result, in a scenario like:

Park is a room.

A fixed in place supporter called a picnic table is in Park.

An enterable supporter called some attached benches is part of picnic table.

you can get interaction like:

>SIT ON BENCHES
You get onto the attached benches.

>SIT ON BENCHES
(getting off the attached benches)
You get onto the attached benches.