I7: Capitalising output from a substitution

Hello, helpful people.

I have the following:

The last mentioned person is a person that varies.

After printing the name of something (called the subject) when the subject is a person:
	now the last mentioned person is the subject.

To say he or she:
	if the last mentioned person is female:
		say "she";
	otherwise:
		say "he".

This is so that I write a generic replies like:

Report greeting:
	say "'Hello, [the noun].'";
	say "'Hello,' [he or she] replies. [He or she] blushes.".

It works well apart from one thing. I can’t figure out how to tell inform that the substitution should start with a capital letter. You can see my attempt above (“He or she”) which doesn’t work. The output I get in my test is:

“Hello, Katie.”
“Hello,” she replies. she blushes.

I know that it works for built-in substitutions like [The noun] v/s [the noun]. Is there any way to do this for substitutions I’ve created? If not, is there a better way to solve this problem?

Whoops, never mind. I found the syntax after all. If anyone’s interested, this will do it:

To say he or she:
   if the last mentioned person is female:
      say "she";
   otherwise:
      say "he".

To say He or she:
   if the last mentioned person is female:
      say "She";
   otherwise:
      say "He".

Hey Gurok,

Your solution probably works for your cases, but you may find part or all of it is already made possible by the ‘Plurality’ extension by Emily Short. This extension comes with Inform 7 by default, so you don’t have to download it, you only have to include it in your source.

I guess the advantage of using the extension over your own code is that it already covers tons of other cases that might come up later in your game but which you haven’t thought of yet. (EG It works out whether to say ‘it/It/they/They/them/Them/he/He/she/She’, and more.

I found it a little tricky to work out how to use this extension when I first broke it out, but if the docs don’t make it clear, just come back here later to check.

  • Wade