17.30. Supplying a missing noun/second noun

| Chapter 17: Activities |

| 17.30. Supplying a missing noun/second noun

1. When it happens. (Two different activities here, but identical except for applying to different nouns.) Suppose that, because of an instruction to Understand something even though it would be lacking a noun - say, 'Understand "take" as taking.' - an incomplete action is generated, one which is required to have a noun, but doesn't. "Supplying a missing noun" takes place to remedy the problem. It can either:

(i) Set a noun, printing text like "(presumably the black bag)" if it wants, in which case the action goes forward, though it is still subject to the full rules on accessibility exactly as any other action would be; or

(ii) Make no choice, in which case no action takes place and the player's command is rejected. If the activity printed nothing, Inform will produce a generic reply to the player that "You must supply a noun.".

2. The default behaviour. In the default grammar for Inform, only three such half-finished actions are ever Understood. One is "going" with no direction, for which this activity simply prints a refusal. The other two are the two undirected senses, "smelling" and "listening". In each case, the "supplying a missing noun" activity sets the noun to the current location: so, for instance, typing the bare command "listen" might generate the action "listening to the Shoreline".

3. Examples. (a) This is the definition Inform uses to make "listen" work as outlined above:

> Rule for supplying a missing noun while listening (this is the ambient sound rule):
> now the noun is the location.

(b) It can be elegant to allow second nouns to be dropped with habitual actions, or where the choice is obvious:

> Understand "unlock [something]" as unlocking it with.

> Rule for supplying a missing second noun while unlocking:
> if the skeleton key is carried, now the second noun is the skeleton key;
> otherwise say "You will have to specify what to unlock [the noun] with."

Note that, in order for our activity to succeed, we do need to supply a grammar line allowing the player to try "unlocking it with" using only one noun. Otherwise, the command "unlock something" will still produce the question "What do you want to unlock the door with?"

357
| Example Latin Lessons Supplying missing nouns and second nouns for other characters besides the player. |
RB

358
| Example Minimal Movement Supplying a default direction for "go", so that "leave", "go", etc., are always interpreted as "out". |
RB

Sometimes it would be nice to respond a little more sensitively to a vague command such as "leave" -- converting it, perhaps, to a "go out" command. "Minimal Movement" The Doll-like House is a room. The Postage-Stamp-Sized Garden is outside from the House. Rule for supplying a missing noun while going: now noun is outside. This particular situation is very slightly complicated by the existing rules about vague movement, but fortunately we can easily turn those off. The block vaguely going rule is not listed in the for supplying a missing noun rules. Test me with "go".

Previous | Contents | Next