17.29. Asking which do you mean

| Chapter 17: Activities |

| 17.29. Asking which do you mean

1. When it happens. When the player has typed an ambiguous noun reference, and Inform has not been able to decide what was meant.

2. The default behaviour. A question such as "Which do you mean, the laminated mahogany box or the boom box?" is printed. (This activity shapes the question: it is not responsible for parsing the answer. It would be very mysterious to write rules for this activity such that nothing is printed, because the player would then have no idea what to type.)

3. Examples. The question is harder to print than may first appear, since one must not simply list the options, but also take into account collections of plural objects ("Which do you mean, the gold-tipped pen or a gold coin?"). It is probably better not to try to rewrite this.

(a) But we can place notes before or after: here is a verbose explanation for beginners to IF.

> Before asking which do you mean: say "Okay, so I'm going to have to ask a question now: you've typed something ambiguous, and I don't know which noun you're referring to."

> After asking which do you mean: say "(Just type a word or two to give me more information.)"

(b) We can also use this activity as a context for other activities. For instance:

> The Champs du Mars is a room. The great Eiffel Tower is here. "The great Tower stands high over you." The souvenir model Eiffel Tower is here. "Comparatively tiny is the souvenir version." The great Eiffel Tower is fixed in place. Understand "actual" as the great Tower.

> Rule for printing the name of the great Tower while asking which do you mean: say "actual Tower". Rule for printing the name of the souvenir tower while asking which do you mean: say "souvenir".

causes TAKE TOWER (for instance) to produce a nice tidy question in reply: "Which do you mean, the actual Tower or the souvenir?"

4. A note about actions. This activity takes place during the process of understanding the player's command, when the action that will take place is not fully known. So if the player types "TAKE SHOEBOX", this activity would happen when SHOEBOX is being examined for meaning. Inform knows that the action will be taking, but nothing else. That means attaching a proviso like "... while taking a container" to a rule for this activity will cause the rule to have no effect - whereas "... while taking" would be fine.

354
| Example Originals Allowing the player to create models of anything in the game world; parsing the name "model [thing]" or even just "[thing]" to refer to these newly-created models; asking "which do you mean, the model [thing] or the actual [thing]" when there is ambiguity. |
RB

We rely here on the understanding-by-relations rules we've already learned, but there is an additional trick: we want to make sure that if the player types "original" or "actual", this word will not be taken to refer to the thing modeled: "Originals" A model is a kind of thing. 100 models are in the model-repository. Appearance relates one thing to various models. The verb to be shown by implies the appearance relation. Indication relates a model (called X) to a thing (called Y) when Y is shown by X and Y is suitable. Understand "actual" or "original" as "[actual]". Understand "[actual]" as something when the item described is not a model. Definition: a thing is suitable: if the player's command includes "[actual]", no; yes. Understand "[something related by indication]" as a model. After printing the name of a model (called target): say " [random thing shown by the target]" Now our duplication command -- for the sake of simplicity, we'll suppose that in this scenario the player is duplicating objects by magic rather than creating them out of physical materials or supplies: Understand "duplicate [something]" as duplicating. Duplicating is an action applying to one visible thing. The duplicating action has an object called the selected model. Setting action variables for duplicating: let N be a random model in the model-repository; now the selected model is N. Check duplicating: if the selected model is nothing, say "You're out of power." instead. Carry out duplicating: now the noun is shown by the selected model; move the selected model to the player. Report duplicating: say "You concentrate and manifest [a selected model]." Now, the challenge is that we want to print the word "actual" before printing the name of an object, but only during disambiguation questions and only when we are not printing the name of the object as part of a model-name! (If we are not careful about the latter point, we will get responses such as "Which do you mean, the model actual deer or the actual deer?" which of course defeats the whole purpose. The way around this is to remember that activities stack: we're printing the name of the deer while printing the name of a model that involves the deer. So if we set a flag while printing the name of a model, we can control the way the deer's name prints during the transaction. (We could use our ...while clause to specify while not printing the name of a model, except that we're already using it for "while asking which do you mean", and these do not stack.) So: The virtual-context is a truth state that varies. The virtual-context is false. Before printing the name of a model: now virtual-context is true. After printing the name of a model: now virtual-context is false. Before printing the name of something (called target) while asking which do you mean: if the target is not a model and virtual-context is false: say "actual ". Forest is a room. It contains a deer and a daisy. The deer is an animal. Test me with "duplicate deer / x model deer / x deer model / drop deer / x deer / actual / x deer / model".

355
| Example Apples Prompting the player on how to disambiguate otherwise similar objects. |
RB

356
| Example Walls and Noses Responding to "EXAMINE WALL" with "In which direction?", and to "EXAMINE NOSE" with "Whose nose do you mean, Frederica's, Betty's, Wilma's or your own?" |
RB

Previous | Contents | Next