I can get the text the player typed with gAction.getOrigText. But if the player’s command requires disambiguation, gAction.getOrigText only includes the original, undisambiguated command. How can I get the text of the answer to the disambiguation question? (I want to have a look at it during a beforeAction, to check if the player used a specific word to refer to one of the NPCs.)
This seems to get the job done.
StringPreParser
doParsing(str, which) {
if (which == rmcDisambig)
libGlobal.disambigText = str;
else
libGlobal.disambigText = nil;
return str;
}
;
modify libGlobal
disambigText = nil
;
EDIT: used a StringPreParser rather than replacing readMainCommand() directly.
That works, thanks! I just had to change this line:
if (which == rmcDisambig)
to:
if (which is in (rmcDisambig, rmcAskObject))
to catch cases where the player didn’t originally specify an object at all.