I have used the LanguageVerb function a lot to deal with the “only understood as far as” error for unusual metaverbs, e.g. “about.”
But I’m confused by how to get 2-word commands to work.
Include (-
Replace LanguageVerb;
-) after "Definitions.i6t".
room 1 is a room.
Include (-
[ LanguageVerb i;
switch (i) {
'i//','inv','inventory':
print "take inventory";
'l//': print "look";
'x//': print "examine";
'z//': print "wait";
'avada kedavra//': print "cast a killing curse (2 words)";
'avada': print "cast a killing curse (1 word)";
'about': print "see info about the game";
default: rfalse;
}
rtrue;
];
-) after "Language.i6t".
understand the command "avada kedavra" as something new.
understand "avada kedavra" as requesting the score. [ok, it does something else, but let's keep the example simple]
test ak with "avada kedavra x"
In the example above, I’d like to see “cast a killing curse (2 words)” but instead I see “cast a killing curse (2 words) kedavra.” This makes sense, since LanguageVerb is called from Parser.i6t on a word by word basis.
But is there an easy, sensible way to do this in inform 6? I suppose I could really hardcode things in Inform 7 with an "after reading the player’s command: (change regex “^avada kedavra” to “avadakedavra” and use avadakedavra as a command) but this looks like a hack.
I could also have a table that the “Rule for printing a parser error when the latest parser error is the only understood as far as error” reads through and then notes you used a 2 word command, but again, that feels like a real hack.
It’d be acceptable, but I can’t help feeling there’s something a lot better.
Thanks for any and all help!