Printing "you" instead of "yourself"

I have an NPC action with a report rule that prints something like:

Say "[The noun] keeps an eye on [the second noun]."

Works well for try carrie watches john as it prints Carrie keeps an eye on John. but when acting on the player it prints Carrie keeps an eye on yourself.

So far as I can tell, if the noun is the player it prints “You” when capitalized like [The player] and yourself when not. I could capitalize [The second noun] but then it would print You when I really want you. Is there some switch I’m missing?

Others who are better with Inform than I might be able to come up with a clever way around this, but the difficulty here is that the player’s body is implemented as an object called the “yourself”, so that’s what’s being referred to when the player is the object of an action. Typically this makes sense because 99% of actions are going to be ones the player types in, so if the player is the noun or second noun “yourself” would be the appropriate form (since you’d be trying to feed yourself or hit yourself or whatever).

There’s probably elegant stuff you could do with shifting the printed name of the “yourself” in particular situations like these, but I’d personally be paranoid about mucking something up because I’m bad at Inform. Also note that the verb tense in your response doesn’t work if the player is the noun (keeps vs. keep). So I’d probably just hard-code it to be safe with something like this (needs to be more complex if the player can be both the noun and the second noun!):

	If the noun is not the player and the second noun is not the player:
		Say "[The noun] keeps an eye on [the second noun].";
	If the noun is the player:
		Say "You keep an eye on [the second noun].";
	If the second noun is the player:
		Say "[The noun] keeps an eye on you."
1 Like

Rather than handling it action by action, you might want a generic solution. Perhaps something like:

"You"

Place is a room.

Bob is a man in Place.

Rule for printing the name of yourself when the noun is the player and the actor part of the current action is not the player:
    say "you".

Pointing at is an action applying to one thing. Understand "point at [something]" as pointing at.

To point is a verb.

Report an actor pointing at something:
    if the actor is the player:
	    say "You point at [the noun].";
    otherwise:
	    say "[The actor] [point] at [the noun]."

A persuasion rule for asking Bob to try doing something:
    persuasion succeeds.

Test me with "point at me / bob, point at me".

which yields:

>POINT AT ME
You point at yourself.

>BOB, POINT AT ME
Bob points at you.
2 Likes