I7: How do I force Inform to use the long form of a verb?

Hello helpful people,

I have the following action defined:

Becoming is an action applying to one visible thing.

Understand "become [something]" as becoming.

Carry out becoming:
	say "Okay, you become [the noun].".

Understand the commands "b" and "be" as "become".

Test Room is a room. The player is in Test Room.

It allows the player to switch roles and become another character in the game. The actual command has a far more complicated definition, but this is enough to demonstrate the problem. I seem to be unable to get Inform to ask “what do you want to become?”. See the output below:

x
What do you want to examine?

b
What do you want to b?

Inform uses the typed synonym verbatim. I had a look at the Standard Rules and couldn’t find anything peculiar about how Inform was doing it for examine:

Understand the commands "x", "watch", "describe" and "check" as "examine".

What am I missing here?

Never mind. I searched around a little more and found the location of the substitution in LanguageVerb. I fixed it by replacing LanguageVerb with a custom routine:

Include (-
Replace LanguageVerb;
-) after "Definitions.i6t".

Include (-
[ LanguageVerb i;
	switch (i) {
	  'i//','inv','inventory':
			   print "take inventory";
	  'l//':   print "look";
	  'x//':   print "examine";
	  'z//':   print "wait";
	  'b//':   print "become";
	  default: rfalse;
	}
	rtrue;
];
-) after "Language.i6t".

I wish there was a neater way.

Another way, not really any tidier, is to use an “after reading the player’s command” rule to change “b” to “become” in the input buffer.

Hrmm… along those lines, this is what I’ve come up with:

To decide which snippet is the player's verb:
	(- verb_wordnum * 100 + 1 -).

Repeating the player's verb is an activity.

Rule for repeating the player's verb:
	say the player's verb.

Rule for repeating the player's verb when the player's verb matches "i" or the player's verb matches "inv" or the player's verb matches "inventory":
	say "take inventory";

Rule for repeating the player's verb when the player's verb matches "x":
	say "examine";

Rule for repeating the player's verb when the player's verb matches "l":
	say "look";

Rule for repeating the player's verb when the player's verb matches "z":
	say "wait";

This is the language verb rule:
	carry out the repeating the player's verb activity.

Include (-
Replace LanguageVerb;
-) after "Definitions.i6t".

Include (-
[ LanguageVerb;
	(+ language verb rule+)();
	rtrue;
];

-) after "Language.i6t".

I thought it best to scan only the verb in question, not the entire input buffer. It works well.

My original effort, however, included a verb property for the activity:

To decide which snippet is the verb in the player's command:
	(- verb_wordnum * 100 + 1 -).

Repeating the player's verb is an activity.

The repeating the player's verb activity has a snippet called the verb.

Before repeating the player's verb: now the verb is the player's verb.

Rule for repeating the player's verb:
	say the player's verb.

Rule for repeating the player's verb when the verb matches "i" or the verb matches "inv" or the verb matches "inventory":
	say "take inventory";

Rule for repeating the player's verb when the verb matches "x":
	say "examine";

Rule for repeating the player's verb when the verb matches "l":
	say "look";

Rule for repeating the player's verb when the verb matches "z":
	say "wait";

This is the language verb rule:
	carry out the repeating the player's verb activity.

Include (-
Replace LanguageVerb;
-) after "Definitions.i6t".

Include (-
[ LanguageVerb;
	(+ language verb rule+)();
	rtrue;
];

-) after "Language.i6t".

When I compiled the original, I got errors like:

In the sentence ‘Rule for repeating the player’s verb when the verb matches “l”’ , I was expecting to read a value, but instead found some text that I couldn’t understand - ‘verb’.

And I wasn’t sure what was wrong. It seems Inform doesn’t like the extra level of indirection (“the verb”), but only if I list more than one rule with “the verb”. Does this make sense to anyone?

I believe that you’ve run into bug 410.