"Yet Another Test"
Include Small Kindnesses by Aaron Reed.
Test Lab is a room.
Test me with "wear myself".
Result:
Test Lab
>test me
(Testing.)
>[1] wear myself
You can’t wear you!
It would be better if the response was “You can’t wear yourself!”, but anyway. Try changing the story viewpoint to first person singular or third person singular. Then you’ll see things like:
>[1] wear myself
I can’t wear I!
and
>[1] wear myself
He can’t wear he!
The response occurs because of this code from the “Small Kindnesses” extension:
Chapter - Don't perform implicit actions for doomed tasks
[Inspired by (but implemented differently from) the "Delicious, Delicious Rocks" example. Don't bother to try automatically taking something as a result of a WEAR command that can't possible work (because the noun isn't wearable). This formerly included EAT and edible too, but that functionality now exists in the standard library.]
Before wearing a not wearable thing which is not held by the player (this is the Small Kindnesses don't implicitly take unwearables rule):
say "[text of can't wear what's not clothing rule response (A)]";
say line break;
stop the action.
Without “Small Kindnesses”, the wearing attempt would be blocked by not being able to take yourself (“You are always self-possessed.”)
A further look at the “can’t wear what’s not clothing rule”:
Check an actor wearing (this is the can't wear what's not clothing rule):
if the noun is not a thing or the noun is not wearable:
if the actor is the player:
say "[We] [can't wear] [regarding the noun][those]!" (A);
stop the action.
So then I decided to see how Inform defines “those”. According to the English language extension:
To say those:
say those in the accusative.
[...]
To say those in (case - grammatical case):
if the case is nominative:
let the item be the prior named object;
if the prior naming context is plural:
say "those";
otherwise if the item is the player:
say "[we]";
otherwise if the item is a male person and item is not neuter:
say "he";
otherwise if the item is a female person and item is not neuter:
say "she";
otherwise:
say "that";
otherwise:
let the item be the prior named object;
if the prior naming context is plural:
say "those";
otherwise if the item is the player:
say "[we]";
otherwise if the item is a male person and item is not neuter:
say "him";
otherwise if the item is a female person and item is not neuter:
say "her";
otherwise:
say "that".
I’d have thought “[us]” should be printed instead of “[we]” when the case is accusative. Is there a reason that “[we]” is used when the case is accusative, as here?
If you look at the definition for To say us:..., you’ll see that it wouldn’t make a difference in the output. Inform’s built-in logic doesn’t handle reflexive pronouns well.
[Bad suggestion snipped.]
EDIT: On second thought, I don’t think that’s a good thing to install as a universal change. There is an [ourselves] substitution that you can use instead of [us].
Maybe it’s because in grammar, the accusative case is “us”, not “we”. Also, when the prior named object is not the player, “[those]” prints “him” and “her”. So if the prior named object is the player, why does it print the nominative “I”, “he”, “she” instead?
According to “Writing with Inform”:
In fact “[Those]” and “[those]” do subtly different things, besides the capital letter, because “[Those]” expects to be the subject of the sentence and “[those]” the object, and this makes a difference if the noun in question is a person. If the noun is an odious person called Tilly then
"[regarding the noun][Those] is unacceptable."
"You've never liked [regarding the noun][those]."
would come out as “She is unacceptable” - so “[Those]” becomes “She” - but “You’ve never liked her” - so “[those]” becomes “her”. If we need these in different cases, we can explicitly ask for that:
"[those in the nominative]"
"[Those in the accusative]"
But using “[those in the accusative]” still prints nominative pronouns like “I” or “he” when the prior named object is the player. So I suppose that was my question: why the inconsistency?
How exactly does Inform handle reflexives? Sometimes it gets it right, and at other times, you see stuff like “John looks closely at John.”
I’m not much of a grammarian, so I’m not the right person to answer that question.
From what I’ve seen when I once looked at the problem in detail, there’s not enough information for the compiler to deduce the right grammar role correctly from just the substitutions – it would have to understand the text being printed to do that with any accuracy. What it depends on instead is the author correctly chosing a proper text substitution, with the convention of using “they” or “we” according to the expected actor for the response.
You can look at the English Language extension and the actual response text to anticipate what will be printed. For example, as you have cited, the examining action has only one Report rule applicable to non-player actors:
Report an actor examining (this is the report other people examining rule):
if the actor is not the player:
say "[The actor] [look] closely at [the noun]." (A).
This response doesn’t differentiate between people and other kinds of things, and it doesn’t use any kind of pronoun substitution at all. The difference encoded by the author is capitalization (for which the associated phrase assumes a subject role in the sentence), and the built-in logic is responsive to the proper-named/improper-named status of the object in question. Since an NPC named John is likely to be proper-named, you get:
John looks closely at John.
You could change this rule to:
The report other people examining rule is not listed in any rulebook.
Report someone examining (this is the revised report other people examining rule):
if the actor is a person and the actor is the noun:
say "[The actor] [look] closely at [themselves]." (A);
otherwise:
say "[The actor] [look] closely at [the noun]." (B).
I would definitely call this a bug, yes. Even when you explicitly specify what case the pronoun should be printed in, it’s ignored.
The choice of whether to use a reflexive pronoun is more difficult, and also not handled very well at the moment. Personally, my fix would be to make all the nominative text substitutions set a global variable, and have the accusative ones check that variable to see if they should be reflexive or not. (This would be separate from the prior named object since it cares about case.)
Nominative pronouns are “I”, “he”, “she”, “we”, “they”. Accusatives are “me”, “him”, “her”, “us”, “them”. “Writing with Inform” implies that “[Those]” will always expand to nominatives when spelled with a capital, and accusatives otherwise. But “English Language” shows something else. “[those]” (beginning with lowercase) is accusative only when the prior named object is not the player. If the prior named object is the player, the nominative is always used.
This is a strange choice. In what context could we expect “[those]” to print “me”, “him” and “her” unless the prior named object is the player, in which case it will print “I”, “he” or “she”? This means that we’ll see “I can’t wear him!” when the player types WEAR JOHN, but “I can’t wear I!” when the player types WEAR MYSELF.
“Writing with Inform” also implies that you can use “[those in the accusative]” to explicitly set the case, but this also yields “I can’t wear I!” rather than “I can’t wear me!” So I wondered if this was intentional or not.
I tried digging a little deeper on the reflexives issue. Using this example:
"Yet Another Test"
When play begins:
now the story viewpoint is first person singular;
Test Lab is a room.
Bob is a man in the Lab.
Persuasion rule:
persuasion succeeds.
Xyzzying is an action applying to one thing. Understand "xyzzy [something]" as xyzzying.
Report an actor xyzzying:
say "[The actor] [say] 'xyzzy' to [the noun]."
Test xyzzy with "xyzzy myself / xyzzy bob / bob, xyzzy bob / bob, xyzzy me".
We get this result:
We get this result:
Test Lab
I can see Bob here.
>test xyzzy
(Testing.)
>[1] xyzzy myself
I say “xyzzy” to myself.
>[2] xyzzy bob
I say “xyzzy” to Bob.
>[3] bob, xyzzy bob
Bob says “xyzzy” to Bob.
>[4] bob, xyzzy me
Bob says “xyzzy” to myself.
Inform prints “myself” in these responses even though I haven’t asked it to use the reflexive at all (by using “[ourselves]”).
The line “[The actor] [say] ‘xyzzy’ to [the noun].” does different things depending on whether “[The actor]” is the player. Inform appears to use the reflexive when “[the noun]” is the player, without checking if the actor is the noun.
This is all very well when the actor is the player, but it falls down if the actor is not the player. That explains “Bob says ‘xyzzy’ to myself” when “to me” would have been better, and “Bob says ‘xyzzy’ to Bob.”
I think the reflexive is needed when:
The actor is the noun. (“You attack yourself.”)
The actor is the second noun. (“You tie the rope to yourself.”)
The noun is the second noun. (“You tie the rope to itself.”)
Have you checked out the code at the link I mentioned above? I would be interested to know whether it seems like an improvement in your situation.
EDIT: Things seem much improved when supplementing that code with:
To say the noun:
let N be the noun;
if N is the person asked:
say "[regarding N][themselves]";
otherwise:
say "[the N]".
To say the second noun:
let SN be the second noun;
if SN is the person asked:
say "[regarding SN][themselves]";
otherwise:
say "[the SN]".
That, along with your link, does solve the immediate issue. Thanks!
(Also, I couldn’t get the code in your link to compile under Inform 10, but I’m still using 9.3, so this isn’t a big deal for me.)