Problem with disambiguation question

So I have created a new action, involving talking. One of the synonyms for it is “t” – and if the player types >t, the disambiguating question is “What do you want to t?”

But I’d like the response to be “What do you want to talk about?” (like how if you type >x the response is not “What do you want to x?” but “What do you want to examine?”).

Anyone know how I might go about making this happen?

Thanks!

Perhaps these will help? 18.31. Asking which do you mean | 18.32. Supplying a missing noun/second noun

1 Like

Ah – that’s close but not quite! It’s not a disambiguation question at all now that I think about it, though the activities section of the rulebook puts me in the right place – I thought for a moment it was the “Supplying a missing noun/second noun” activity but I don’t think that’s it either. I’ll keep looking, though I’m tempted at this point to just use the built-in ask and tell actions instead of making my own new one. Hmm, will think some more about it. Thanks!

1 Like

Looking at RESPONSES, it looks like this might be

parser clarification internal rule response (E): "What do you want [if the noun is not the player][the noun] [end if]to [parser command so far]?"

(in Inform 6M62, anyway).

I’m not sure what triggers that response, but you might be able to change it.

1 Like

This will probably make the good coders howl, but I’d do something like:

After reading a command:
   if the player's command matches "t":
      say "You'll have to specify what you want to t. Try a thing or a topic, like T HAT or T MURDER." instead.
1 Like

What you want is the I6 routine LanguageVerb, which by default looks like this:

[ LanguageVerb i;
    switch (i) {
      'i//','inv','inventory':
               print "take inventory";
      'l//':   print "look";
      'x//':   print "examine";
      'z//':   print "wait";
      default: rfalse;
    }
    rtrue;
];

This is responsible for converting abbreviations into full verbs. So try this:

Include (-
[ LanguageVerb i;
    switch (i) {
      'i//','inv','inventory':
               print "take inventory";
      'l//':   print "look";
      'x//':   print "examine";
      'z//':   print "wait";
      't//':   print "talk to"; ! New
      default: rfalse;
    }
    rtrue;
];
-) replacing "LanguageVerb".
2 Likes

I think you could do something with text matching or–this I like best–using the subcommands extension by Draconis. This seems to work.

the parser clarification internal rule response (E) is "[the clarifying question][run paragraph on]" 

to say the clarifying question:
	if the subcommand of the verb includes "t" or the subcommand of the verb includes "talk":
		say "Who do you want to talk to?";
	otherwise:
		say "What do you want [if the noun is not the player][the noun] [end if]to [parser command so far]?";

plan b, text matching

to say the clarifying question:
	let C be "[the player's command in lower case]";
	if C is "t" or C is "talk":
		say "Who do you want to talk to?";
	otherwise:
		say "What do you want [if the noun is not the player][the noun] [end if]to [parser command so far]?";

Thanks, everyone!