How to use Does the Player Mean with Scope?

I was toying with the idea of using scope to see things and people through a window, which seems to work fine. However, I want the parser to assume the player means things in the current room if there is any question about it.

I seem to be flubbing about with a way to write a “Does the Player Mean” that will handle general things in this way so there isn’t a clarifying question asking about “which do you mean?” Here is a quick and dirty testing project I was using to try it out:

[ Room Creation ]
Test Zone is a room. The description is "Warning: Only For Temporary Testing!".

Bunker is a room. It is north of Test Zone. The description is "A protective bunker. There are small slits in which you can see out.".

[ Setting Scope so one room can have 'windows' to view people outside of it ]
After deciding the scope of the player when the location is Bunker:
	let L be a list of people;
	now L is the list of people in Test Zone;
	repeat with P running through L:
		place P in scope;

[ Creation of Body Parts ]
a body part is a kind of thing. 

eyes are a kind of body part. eyes are a part of every person.
nose is a kind of body part. nose is a part of every person.
mouth is a kind of body part. mouth is a part of every person.

[ Creation of People + Descriptions ]
Bob is a man in Test Zone.
The description of Bob's eyes is "Bob has evil eyes.".
The description of Bob's nose is "Crooked, like the man himself.".
The description of Bob's mouth is "Always curled into a sneer.".

[Fred is a man in Bunker.
The description of Fred's eyes is "Fred has no eyes!".
The description of Fred's nose is "Long and narrow.".
The description of Fred's mouth is "Straight-faced.".]

The description of your eyes is "You have dull eyes.".
The description of your nose  is "Bigger than you'd like.".
The description of your mouth is "Full of rotten teeth."

[ Does the Player Mean ]
Does the player mean doing something to something when the noun is not in the location:
	say "CURRENT ACTION: [current action][line break]NOUN: [noun][line break]LOCATION: [location][line break]NOUN LOC: [location of the noun][line break]"; [ Debug Info ]
	It is unlikely.

The say command within the does the player mean was just so I could verify that changing scope didn’t change where the object was located and it seems fine (in this example, Bob’s Eyes are in Test Zone even when the player goes north to the bunker).

Fred was there, because I had also hoped to have it focus on other people rather than the player by default. So if Fred was in the bunker, it would examine his eyes, not the players nor Bob’s who was outside the bunker.

I can get the basic effect with:
“Does the player mean doing something to something not held by the player: it is likely.”

And that works for focusing on other person, however if I have my current Does the Player Mean, it blocks that out as well.

Sorry for the rambling, but as you can see I’m stumped! It compiles, shows that the eyes of Bob aren’t in the location, yet it still asks for clarification of whose eyes I mean. Any help would be greatly appreciated!

1 Like

Untested, but take a whack at:

Definition: a thing is local if it is in the location.

Does the player mean doing something to a local thing: it is likely.

I thought the initial question was examining something local vs. in scope but in another room. For the disambiguate in favor of someone else’s body parts case, try…

Definition: a person is an NPC if it is not the player.
Definition: a thing is someone else's if it is enclosed by an NPC.

does the player mean examining someone else's body part: it is likely.

Sorry, the question was a bit confusing, but you had the right of it: I was actually hoping to have both things work. But primarily, my issue is with getting the scope thing working.

Unfortunately, the untested code didn’t seem to change anything.

The second part works to get the focus off of the player (but so, too, did my initial code of:
Does the player mean doing something to something not held by the player: it is likely

However, I still can’t get the scope to work right. If I leave out the part about not focusing on the player, it still asks me if I mean your eyes or Bob’s eyes when in the bunker, when it should focus on the ‘local’ eyes.

Or, if I include that part but include a second NPC (one in the bunker, one in the test zone outside of the location), it still asks which eyes I mean even though it should focus on the NPC in the current location (the bunker).

So scope is still being fiddly. But I appreciate the effort thus far.

1 Like

I think that the thing tripping you up is the meaning of the condition ... in the location.

When phrased that way, the word in means something “on the floor” of a room and location means the room enclosing the player. I’m guessing that you want to compare the room enclosing the noun to the room enclosing the player, so you could try the location of... phrase:

Does the player mean doing something to something when the location of the noun is not the location:

Does this do what you want?

Does the player mean examining a noun when the noun is part of the player:
	it is unlikely.
Does the player mean examining a noun when the location is bunker and the noun is enclosed by Bunker and the noun is not part of the player:
	it is likely.

Ah, you’re right! I need to get my brain to think in that way, but using your example, it worked perfectly fine alongside my previously made

Does the player mean doing something to something not held by the player: it is likely.

Now it works as expected. It focuses on other people’s eyes if not prompted, and will focus on the NPC in the location as opposed to the one outside. Thanks a lot!

And BG, for the record, your example seemed to work as well. I think the slight distinction would be that otistdog’s solution along with my earlier code would consider the player’s eyes if you were alone in the bunker, while yours leans further into always looking at other people’s eyes, so it would look at Bob’s eyes while you were alone in the bunker.

Both solid answers, and I appreciate all the help everyone gave. Thanks a ton!