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?
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!
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.
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]?";