The player is called "yourself"

I have a kind of device called “lever”, and when I turn it off, the response calls the player “yourself” with a lowercase y, which isn’t ideal:

>turn lever on
yourself switch the lever on.

I’m not sure where that comes from. I haven’t done much with the player, except for Understand "me", "you" and "yourself" as yourself. (commenting that out doesn’t help).

SHOWME does say yourself - person, but that’s also the case in a simple test project I created. In that test project, turning the device on correctly says You turn the lever on.

Traces and rules:

>turn lever off
[Rule "After deciding the scope of the player" applies.]
[Rule "After deciding the scope of the player" applies.]
[Rule "declare everything initially unmentioned rule" applies.]
[Rule "generate action rule" applies.]
[switching off the lever]
[Rule "announce items from multiple object lists rule" applies.]
[Rule "set pronouns from items from multiple object lists rule" applies.]
[Rule "before stage rule" applies.]
[Rule "basic visibility rule" applies.]
[Rule "precondition stage rule" applies.]
[Rule "basic accessibility rule" applies.]
[Rule "access through barriers rule" applies.]
[Rule "keyring-sensitive carrying requirements rule" applies.]
[Rule "instead stage rule" applies.]
[Rule "requested actions require persuasion rule" applies.]
[Rule "carry out requested actions rule" applies.]
[Rule "descend to specific action-processing rule" applies.]
[Rule "work out details of specific action rule" applies.]
[Rule "investigate player's awareness before action rule" applies.]
[Rule "player aware of his own actions rule" applies.]
[Rule "check stage rule" applies.]
[Rule "can't switch off unless switchable rule" applies.]
[Rule "can't switch off what's already off rule" applies.]
[Rule "carry out stage rule" applies.]
[Rule "standard switching off rule" applies.]
[Rule "after stage rule" applies.]
[Rule "investigate player's awareness after action rule" applies.]
[Rule "report stage rule" applies.]
[Rule "standard report switching off rule" applies.]
yourself switch the lever off.

Extensions:

Include Basic Screen Effects by Emily Short.
Include Implicit Actions by Eric Eve.
Include Extended Grammar by Aaron Reed.
Include Small Kindnesses by Aaron Reed.
Include Object Response Tests by Juhana Leinonen.
Include Property Checking by Emily Short.
Include Approaches by Emily Short. 

Thanks!

Can you post the text of the “standard report switching off rule response (A)”? You can find it under “switching off” in the index.

I would check myself but I just realized I haven’t reinstalled Inform since getting my new laptop a few weeks ago. Time to go do that.

I’m not sure how I find the actual rule. Here’s a screenshot from the Actions Index, which is the only place I can see it referenced (although I’m not very familiar with the Index). The text of the rule itself isn’t listed though, but if I’m interpreting it correctly, at least it doesn’t seem like any extensions are overriding anything since it says it’s using the standard rules?

(The “instead of” rule isn’t relevant here, as the lever isn’t a backdrop)

Can you list the text of any rules you have regarding the lever?

The standard switching off rule apparently looks like this (I had to google it and found it here - not sure if I can see it inside Inform somehow):

Report an actor switching off (this is the standard report switching off rule):
	if the action is not silent:
		say "[The actor] [switch] [the noun] off." (A).

… but it still does the same thing, so I’m thinking the problem is with [The actor].

Edit: OK, digging a little deeper on Standard Rules by Graham Nelson I see that some similar rules don’t use [The actor] in this context when the actor is the player, they use [We]. Such as this one:

Report an actor closing (this is the standard report closing rule):
  if the actor is the player:
     if the action is not silent:
        say "[We] [close] [the noun]." (A);
  otherwise if the player can see the actor:
     say "[The actor] [close] [the noun]." (B);
  otherwise:
     say "[The noun] [close]." (C);

I’m not sure why one rule uses [The actor] in all instances while the other handles the player separately and uses [We], but lo and behold, if I do this:

The standard report switching off rule is not listed in any rulebook.
Report an actor switching off (this is the new report switching off rule):
	if the action is not silent:
		say "[We] [switch] [the noun] off." (A).

Then it works! (I understand it wouldn’t work for other actors than the player, but that’s not relevant here.)

So this made me think it was a rule related to the player, which made me find this rule I had (which I’m not sure where I found originally):

A thing can be seen or unseen.
The player is seen.
Rule for printing the name of something (called the target):
	say the printed name of the target;
	now the target is seen.

I changed that rule to this:

A thing can be seen or unseen.
The player is seen.
After printing the name of something (called target): now the target is seen.

And now it works. Hooray! Silly thing.

I do still wonder if Inform is being inconsistent in printing the player in its standard rules here though - if the standard switching off rule used [We] instead of [The actor] when the actor is the player, it would have worked even with my silly overriding of printing the name of something.

1 Like

Ah, yes, that would do it! There’s a rule for printing the name of the player that says “You” instead of “The yourself”, but your rule overrides it with the printed name property, which is not what you want here.

1 Like

“The Actor” is a global variable containing the thing performing the current action. When used as a text substitution, it translates into the printed name of the thing, or the proper name of the thing if it’s proper-named. When the actor is the player, Inform substitutes “you.”

The text substitution [We] always adapts the word to the appropriate tense and viewpoint. (See: §14.4. Adapting text about the player.) If you change the rule response to “[We] [switch] [the noun] on.” it works fine as long as the player is the actor. If, for example, Blumfelt performs the action in clear view of the player, the response would be “You switch the lever on.” instead of “Blumfelt switches the lever on.”

The Lab is a room.
The Lever is a device in the Lab. It is switched off.
Blumfelt is in the lab.

The standard report switching on rule response (A) is "[We] [switch] [the noun] on."

After jumping:
	try Blumfelt switching on the Lever;
	continue the action.

After waving hands:
	try Blumfelt switching off the Lever;
	continue the action.
	
Test me with "jump / wave".
2 Likes

That makes sense, thanks.

Yes, that also makes sense, but that exact senario is why I would expect the rules to be consistent, ie. that the standard report switching on rule response would look like this, similar to the standard report closing rule:

Report an actor switching on (this is the standard switching on rule):
  if the actor is the player:
     if the action is not silent:
        say "[We] [switch] [the noun] on." (A);
  otherwise if the player can see the actor:
     say "[The actor] [switch] [the noun] on." (B);
  otherwise:
     say "[The noun] [switch] on." (C);

But that’s not the case. The standard report switching on rule only uses [The actor] in all cases (A); it doesn’t check to see if the actor is the player, and in that case uses [We], like the standard report closing rule does in its (B) (and it doesn’t have the (C) case either for if the player can’t see the actor, but that might be because a device isn’t usually visible from more than one room like a door is). Why?

Does [We] and [The actor] actually do the exact same thing in all cases where the player is the actor, it’s just that the standard report closing rule differentiates between them to make it more obvious what actors the two cases are talking about, since the player rule suppresses the action if it’s silent but the non-player rule doesn’t?

(Hope my question is clear - I’m not a native English speaker)

The reason is that the report closing rule accommodates the possibility of the action being triggered silently. Other actions in the standard rules do that. There aren’t any actions in the standard rules that trigger switching it on/off silently, so the standard rule doesn’t accommodate it.

Note that, the only reason the closing action has a (B) and (C) response is because that first condition exists, and the thing being closed is visible to the player–he might not be able to see another person closing the door, but he can see the door close.

[We] and [The Actor] report the same when the actor is the player.

2 Likes

Thanks! That clears everything up for me.