§7.7. Saying Simple Things
There are times when even the commands ASK and TELL are overkill: sometimes the player doesn't have much information to offer, so TELL is never useful, for instance. If we don't want to make any distinction between modes of conversation, we can conflate the actions so that ASK LUCIUS ABOUT OLLIVANDER, TELL LUCIUS ABOUT OLLIVANDER and LUCIUS, OLLIVANDER all do the same thing: see Sybil 1.
If we are frequently permitting the player to say things like LUCIUS, OLLIVANDER as shorthand for "talk to Lucius about Ollivander", then we may also want to allow LUCIUS, OLLIVANDER? This makes the player character seem a bit slow (or at least Laconic), but it is an effective interface in some cases. The trick is that the question mark at the end of the command may prevent Inform from recognizing the keyword; should that problem arise, we may want to use Punctuation Removal to erase question marks from the player's command before attempting to interpret it.
Along the same lines, there are situations in conversation where similar commands do not correspond to the same actions within Inform; if we're careless about this, we may force the player to guess which vocabulary we want him to use, which is always vexing. Some cases to look out for:
Inform has actions for "saying yes" and "saying no". Sometimes this is useful, but sometimes we want YES and SAY YES TO FRED to do the same thing. Sybil 2 shows how to roll these responses into one; Proposal expands on the idea to show more ways in which a player could reasonably answer a question put by another character.
Again, if we want ASK SYBIL ABOUT CAKE to do the same thing as SHOW CAKE TO SYBIL, we might use the technique in Nameless to make objects into valid topics of conversation, and to make ASK and SHOW behave the same way.
Finally, if we want to be able to ASK and TELL an inanimate object -- say, a computer -- about something, we may use the extension Inanimate Listeners to add this capability.
See Remembering, Converting and Combining Actions for ways to redirect one conversation command to another conversation topic
See Varying What Is Read for a way of asking the player trivia questions that he can answer only on the next turn
![]() | Start of Chapter 7: Other Characters |
![]() | Back to §7.6. Getting Started with Conversation |
![]() | Onward to §7.8. Saying Complicated Things |
|
|
|
By default, ASK SOMEONE ABOUT... applies only to a text token. We might want also to offer the player the option of asking characters about pieces of physical evidence. This example implements an ASK PERSON ABOUT THING command that is mostly synonymous with SHOW, with the added nuance that the player can ask about things that are not currently visible, as long as he has encountered them at some time in the past.
Now we create our new action, "interrogating it about". We write the grammar lines so that we can show any object in sight to someone, but also ask someone about any object that we have ever interacted with in the game, whether it is currently visible or not.
Now we replace and redirect the showing action. This gets rid of the requirement in the default library that the player be holding anything he shows to another character:
This bit keeps track of what the player has seen, for the purposes of "any known thing":
Here we define what happens by default when we interrogate someone about something; we use the same response we get to asking someone about something that isn't otherwise interesting:
Now redirect all asking to a topic table, and all interrogating to an object table:
And just so that we can test what happens when asking someone about something out of sight:
...and something unknown:
|
|
By default, ASK SOMEONE ABOUT... applies only to a text token. We might want also to offer the player the option of asking characters about pieces of physical evidence. This example implements an ASK PERSON ABOUT THING command that is mostly synonymous with SHOW, with the added nuance that the player can ask about things that are not currently visible, as long as he has encountered them at some time in the past.
Now we create our new action, "interrogating it about". We write the grammar lines so that we can show any object in sight to someone, but also ask someone about any object that we have ever interacted with in the game, whether it is currently visible or not.
Now we replace and redirect the showing action. This gets rid of the requirement in the default library that the player be holding anything he shows to another character:
This bit keeps track of what the player has seen, for the purposes of "any known thing":
Here we define what happens by default when we interrogate someone about something; we use the same response we get to asking someone about something that isn't otherwise interesting:
Now redirect all asking to a topic table, and all interrogating to an object table:
And just so that we can test what happens when asking someone about something out of sight:
...and something unknown:
|