The printed name of the player, "you" vs "yourself"

I’m trying to make some adjustments to the way actions are described and carried out, and I’m running into difficulty making the grammar correct while the player is the actor.

Instead of taking while the noun is carried by a person (called the target):
	now the prior named noun is the actor;
	say "[Actor] take[s] [the noun] from [target].";
	now the actor is holding the noun;

I’m using Plurality by Emily Short. I plan to expand on this to put checks in place that don’t allow people to just take one another’s stuff without conflict, but for now I’m just trying to get the basics. The problem with the above is that when the player is the actor, it returns stuff like this:

take Bob’s sword
yourself take the sword from Bob.

The obvious question is: how do I make “yourself” print as “you” when needed, and with the correct capitalization when appropriate?

You could add a “for printing the name” rule, but it would be hard to figure out from context when “You” is needed.

The simple solution is to define a new printing phrase [actor-subject] (and [Actor-subject], for beginnings of sentences) which has the appropriate logic. I suspect there are already extensions that cover this, actually.

This is what you want:

say "[The actor] take[s] [the noun] from [target].";

Yes… it was! What the heck? I thought “the” and “a” before nouns didn’t really matter? So, to get “you” “the” needs to precede the token, and to get “yourself” not? I feel like I’ve asked this question before, dangit, why is this hard to remember. I guess I just still don’t understand the difference in the internal mechanics there.

Outside of quotes, “the” and “a” don’t matter, and neither does capitalization. But in text substitutions, they do matter - so “[the noun]” vs. “[The noun]” vs. “[a noun]” vs. “[noun]” all produce different results when the noun is an apple, for instance. And the standard text substitutions do contain special code to handle the case when the object is the player.

That seems rather inconvenient. The reasons for using you vs. yourself in prose are very different from the reasons for using the vs. a.

Actually, what’s going on in this case is that when the actor is the player, “[The actor]” prints “You” and “[the actor]” prints “yourself”. The idea is that “You” is much more likely to be intended at the beginning of the sentence and “yourself” when in the middle, but it’s pretty crude. (For instance, if you change the message for waiting to “Some dust settles on [the actor]” then the message for you waiting is “Some dust settles on yourself,” which isn’t actually right.)

If you want to do something less crude, you can use Assorted Text Generation by Emily Short. Then in my above example you could write “Some dust settles on [you or the actor]” and it should print “Some dust settles on you.” I suppose there’s no explicit phrase in that extension for the capitalized form, “You or the (culprit - a person),” because Inform already turns any call like “The (culprit - a person)” into “You” when the person plugged into the phrase evaluates to the player. But if you need more phrase options in custom phrases you could write more.

Hmm, I have to write some code to make sure that I get messages like “The ghost peers closely at itself” rather than “The ghost peers closely at the ghost” (actually that one should probably be special-cased). Maybe some of this will help.