I7: in location of player" vs "visible" odd disambiguation

I’d expect the code below to go for the insanity terminal. But instead it asks for disambiguation.

[code]“explain” by Andrew

a concept is a kind of thing. terminal illness is a concept.

explaining is an action applying to one visible thing. understand “xp [any explainable thing]” as explaining.

definition: a thing (called x) is explainable: decide yes;

does the player mean explaining something in location of player:
it is likely.

room 1 is a room. the insanity terminal is a thing in room 1.

does the player mean explaining insanity terminal:
say “IT.”;
it is likely;

does the player mean explaining terminal illness:
say “TI.”;
it is unlikely;

test term with “xp terminal/abstract insanity to lalaland/xp terminal”.

lalaland is a room.[/code]

I can change “in location of player” to “visible” and the game now grabs the insanity terminal, but I’m confused as to why. Since each item is not in the location of the player, shouldn’t that “does the player mean” be ignored? (I understand the differences between in location of player/visible, but I came across this while fixing a bug and the why still baffles me.)

The problem is:

does the player mean explaining something in location of player:
	it is likely.

“in location of player” is understood to mean where the explaining action is taking place rather than where the object of the explaining action is located. So, the rule effectively says “does the player mean explaining something when the location of the player is the location of the player”. Consequently, this rule applies to all candidate objects for the explaining action, and the “it is likely” result is always returned. The other two “does the player mean” rules are never applied.

Instead, try:

does the player mean explaining something (called X) when the location of X is location:
	it is likely.

Ah, that’s it! I’ve gotten careless like that before for sure. It also makes sense of some other things I’d seen in the past. Thanks very much, again.

Side question off of this for my own edification since I’ve bungled this before.

Is it correct to say “the location” doesn’t necessarily equal “the location of the player”?

(“The location” being the room containing the player despite more levels of containment, and “the location of the player” being the exact place in the tree hierarchy where the player object is, including containers and supporters…)

If the player is in a room called “Warehouse” and further inside a container called “crate”…

Moving the guard dog to “the location” will put the dog in the Warehouse outside the crate. Moving the guard dog to “the location of the player” will put it inside the crate with the player. Do I have that right?

No, “location” is just short for “location of the player” and is always a room. (And similarly, if there is a rock inside the crate, the location of the rock will be the Warehouse, not the crate.) If you want the exact place int he tree hierarchy, you need “holder of the player” I think.

What you might be thinking of is that if the player is in the crate, then “the player is in the Warehouse” evaluates to false–that’s only true if the Warehouse is the holder of the player.

They’re synonymous, with “the location” being a shorthand for “the location of the player” since it’s used so often. Both of these refer to the enclosing room, even if the player is in some other enterable object within that room.

In contrast, “the holder of the player” refers to the immediate parent of the player (as do tests like “if the player is in”).

Test Chamber is a room.

A table is an enterable supporter in Test Chamber.

Instead of jumping:
	say "The location is [the location], the location of the player is [the location of the player], the holder of the player is [the holder of the player]."
Test me with "jump / get on table / jump".

Thank you both. I totally forgot about the “holder of the player” phrase.

Has this always worked? Due to the behavior of one of my games, I concluded regions were like containers, and the player could be “in” one, but “enclosed” by several. I wrote this test code and it seems this isn’t the case…the player can be “in” multiple regions and they will report correctly. I struggled so much with having a “downstairs” region that was inside a “house” region and the game wouldn’t respond to “if the player is in house” if they were also in “downstairs”. Was this just bad coding by me, or was this updated?

[rant=Example collapsed for space][code]“Sort of California”

California is a region. Arizona is a region.

Los Angeles is a region. San Francisco is a region. Los Angeles is in California. San Francisco is in California. Anaheim is a region. It is in California.

Phoenix is a region. It is in Arizona.

Mulholland Drive is a room in Los Angeles. “Silencio!”

Hollywood is northwest of Mulholland Drive. It is in Los Angeles. “You don’t see any stars just wandering about.”

Disneyland is a room in Anaheim. “You are chilling with Mickey.” It is southeast from Mulholland Drive.

Chase Field is east of Disneyland. “No game is currently being played.” It is in Phoenix.

The Bay Bridge is north of Mulholland Drive. “Wow, it’s foggy.” It is in San Francisco.

After looking:
say “You are visiting [the holder of the player], which is in [city], [state].”;

To say state:
If the player is in California:
say “California”;
If the player is in Arizona:
say “Arizona”;

To say city:
if the player is in Los Angeles:
say “Los Angeles”;
if the player is in San Francisco:
say “San Francisco”;
if the player is in Phoenix:
say “Phoenix”;
if the player is in Anaheim:
say “Anaheim”.[/code]


“In” works differently for regions–see here.

It seems as though there was at least one bugfix related to nested regions but I don’t know if that was your issue.

Thank you matt w!