Which is to say that my “zoom” test wasn’t checking the right thing. I had missed that the standard getting off rule moves you to the core of the parent of the core of the noun, and had set up “zoom” to see what the core of the parent of the core of the player was. So it makes sense that the getting off action moves you to the room… and that explains why the implicit exit when we try to enter the tailgate while on the tailgate moves you to the room, causing the problem we saw.
Here’s what I tenatively think, again to be taken with several grains of salt because of my unfamiliarity with I6 and the object tree. CoreOfParentOfCoreOf is constructed backwards for our purposes here. It moves up the component tree, moves up the contain/support tree, and then moves up the component tree again. But if a container/supporter that is part of a bigger thing is considered to be on the outside of the bigger thing, then exiting shouldn’t take you to the bigger thing but to its holder! In fact, the current behavior can lead to a mess; the rug test works the same even if the rug is defined as a thing rather than a vehicle, meaning that “stand on tailgate/stand on rug/exit” will put you in the truck even though the truck isn’t a container, let alone an enterable one.
I feel like the function we want is really ParentOfCoreOf? If your holder is part of something, figure out what holds that… and then stop. No need to worry about what that is part of, at least in this case.
I very incautiously made that alteration to CoreOfParentOfCoreOf:
There is a room. In it is a truck and a couch.
The truck is a vehicle.
The tailgate is part of the truck. It is an enterable supporter.
The couch is an enterable supporter.
Zooming is an action applying to one visible thing. Understand "zoom [any object]" as zooming.
Report zooming: say "The common ancestor of you with [the noun] is [common ancestor of the player with the noun]."
Booming is an action applying to one visible thing. Understand "boom [any object]" as booming.
Report booming: say "The not-counting-parts holder of [the noun] is [not-counting-parts holder of the noun]."
Test me with "sit on couch / stand on couch / sit on tailgate / stand on tailgate / g"
A rug is an enterable supporter on the tailgate.
Test rug with "stand on tailgate / stand on rug / stand on tailgate / stand on rug / exit / exit".
Include
(-
[ HolderOf o;
if (InitialSituation-->DONE_INIS == false) return thedark;
if (o && (o.component_parent)) return o.component_parent;
if (o && (parent(o))) return parent(o);
return nothing;
];
[ ParentOf o;
if (o) o = parent(o);
return o;
];
[ CoreOf o;
while (o && (o provides component_parent) && (o.component_parent)) o = o.component_parent;
return o;
];
[ CoreOfParentOfCoreOf o;
while (o && (o provides component_parent) && (o.component_parent)) o = o.component_parent;
if (o) o = parent(o);
return o;
];
-) instead of "The Core Tree" in "WorldModel.i6t".
and getting off in the rug now takes you to the tailgate, as it should.
Trying to enter the tailgate when you’re already in it does have you perform the exit and then reenter it instead of refusing, but at least it works instead of having you enter the room. The issue is that the common ancestor of you and the tailgate is the room rather than the tailgate, so you go into the exit cycle, but it does stop once you’re in the room.
…oh, but getting on the rug from the room throws an infinite loop where you constantly enter and exit the truck. That’s bad. I think the issue is that the implicitly pass through other barriers rule has a lot of checks on the holder of the noun, and probably the holder of that, and that’s going to take you up the component tree. Though honestly if components are on the outside, shouldn’t at least some of these be not-counting-parts holders? As it is, you can get onto the tailgate from outside without getting into the truck, but you can’t get onto the rug from outside without getting into the truck, and that doesn’t really work in any world model.
Honestly I’m not sure why the can’t enter what’s already entered rule checks whether the noun is the common ancestor of the noun with the actor, instead of just checking whether the actor is directly in/on the noun. What are the cases where that makes a difference?..OK, I thought of one, and it’s bad! Posted below.
EDIT: Somehow I left a bunch of fragments here, so I tried to edit to complete my thoughts… one developed into a new example that I’ll post below.