I7: Forcing indefinite articles

Hello helpful people,

This is a quick one. Here is my code:

B is a room. C is a room. D is a room. E is a room. F is a room.

C is north of B. D is south of B. E is east of B. F is west of B.

An extra is a kind of person.

There are 20 extras in B.

Every turn:
	repeat with P running through the extras:
		let W be a random direction;
		try P going W.

The player is in B.

Now when I run this and type “z”, I get:

How can I tell Inform to say “An extra goes XXX.” instead of “The extra goes XXX.”? I have been scratching my head over this for a few hours now. I know I could replace the whole going rule, but that seems cumbersome. Any help is appreciated.

If you add the following in front of your code, it seems to work as desired:

[code]Include Plurality by Emily Short.
Include Default Messages by Ron Newcomb.

Table of custom library messages (continued)
library-action library-message-id library-message-text
going action 10 “[A person asked] go[es] [noun][ignore library line break]”
going action 13 “[A person asked] arrive[s] from the [library message object][ignore library line break]”[/code]
You can also add replacements for other directions like “up” and “down”, if necessary (cf. the documentation for “Default Messages”, “Example D: The Complete Table”). The key is to replace “[The person asked]” with “[A person asked]”. I might be overlooking potential side-effects, but as far as I can tell from a brief test, it works well with proper-named persons and persons with special indefinite articles and so on. For example, add “The celebrity is an extra in B. The indefinite article of the celebrity is “your favourite”.”. If you want to have some people mentioned with the definite article, you can do it like this: “An extra called the policeman is in B.” (resulting in “The policeman goes west.” etc.).

The most Informish and least cumbersome way I can think of to solve the problem for the particular case of an extra going would be:

After an extra going when the room gone from is the location: say "An extra goes [noun]."

After an extra going when the room gone to is the location: say "An extra arrives from [the opposite of the noun]."

Thanks StJohnLimbo and Felix Larsson. Both solutions work fine. Felix’s is a little nicer as I don’t have to add in an extension.

I was kind of hoping Inform would support something like this:

The article of an extra is “an”.

Because although it works, replacing library messages seems like it’ll be prone to error. i.e. I’m likely to miss some obscure usage of “the”.

Either way you’re replacing the message. John’s solution will work for any time any not-proper-named person leaves or arrives. Felix’s is a little more specific.

You could also replace the ‘to say the…’ phrases, which would affect even more than John’s solution. You aren’t likely to find a better solution because of the way the standard rules rely on using the ‘to say the’ and ‘to say a’ phrases to emit the correct article.

Well, you may not want to do that, because you don’t want “x extra” to yield “You see nothing special about an extra.”

Actually, that wouldn’t affect the standard library messages (such as “The extra goes north”), since these are not (at least not currently) defined in I7 code but in an I6 template.

Also, I agree with Matt—indiscriminately replacing the definite article with the indefinite one throughout the standard library messages is likely to lead to some unwanted results. However, if you really, really want another default set of articles for your extras, here’s how you do it (with an I6 inclusion):

An extra is a kind of person. Include (- with articles "Yonder" "this here" "a kind of", -) when defining an extra. The first text after the word ‘articles’ in the above code replaces capitalized “The”, the second text replaces non-capitalized “the”, the third text replaces “a” and “A” and will be capitalized as needed.

Mmm, nice. Is it possible to turn one of those into a function or say-phrase or something?

As far as I can tell—no. It seems they have to be string constants.