Supplying a missing noun when there's only one possibility

I think this may be the same problem as here; you can’t define “a random person in the location which is not the player,” because “is not the player” isn’t a relation. You could probably borrow the solution from there:

[code]Difference relates a thing (called X) to a thing (called Y) when X is not Y. The verb to be different from means the difference relation.

Rule for supplying a missing second noun while asking:
if the number of persons in the location is two:
now the second noun is the noun;
now the noun is a random (person in the location) which is different from the player.[/code]

Another trick is that (at least in a similar test) if you leave out those parentheses, then Inform will treat “which is different from the player” as modifying “location” rather than “person,” and so will randomly select either the person or the other person. Putting in the parentheses should let Inform understand that “which is different from the player” modifies “person in the location.”

If you often have occasion to pick out persons who aren’t the player, you could define a phrase for that:

Definition: A person is NPC when it is not the player.

Then you could write:

Rule for supplying a missing second noun while asking: if the number of NPC persons in the location is one: now the second noun is the noun; now the noun is a random NPC person in the location.

At least I think that should work… I seem to be getting an abject failure compiler error when I try to test this, which shouldn’t happen. I’ll kick it around a little more to see if I need to file a bug report. [UPDATE: Never mind, when I was trying to compile it I ended the “if” line with a semicolon, which is known to produce abject failures in the current Inform build.]

…oh, also, you have a line that ends with a period in the middle of your rule. Inform will treat that as ending the rule and will think the next line is meant to start a new rule. Make it a semicolon.

You may also want your Rule for supplying a missing noun to cover the case where two NPCs are in the location by printing a message saying that the player needs to say who to talk to.

(I’ve never seen “the first thing…” before; Arno, are you sure that works? I can’t get it to compile.)