I’m attempting to fluff up Inform’s ability to interact with npc’s by adding
some new verbs. Specifically, ‘hello’ now causes a VagueGreet action that
will address itself to any character who is in scope (there’s never more
than one in scope … at least not for now).
Here’s the problem: If the player uses the following syntax–
>hello, steve
–Inform thinks this is a list of commands. That is, ‘steve’ is interpreted
as a new action to be performed after VagueGreet, rather than as a noun. The
result is that the player gets to say hello to whoever is in scope, after
which Inform protests, "That’s not a verb I recognise."
I’ve tried adding a grammar line like this:
* ‘,’ creature ->Greet
…but it doesn’t work with ‘,’ or with ‘,//’ or with ",". That grammar line
is never matched, as far as I can see. Quite possibly the parser separates
out the chunks that are separated by commas BEFORE it consults the verb
grammar, thus preventing a match.
I don’t mind too much if the name of the character is just discarded. If the
user types ‘hello, sailor’ when in the presence of Pope Benedict XIII, she
can take the result and like it. But I need to suppress the error message
(and without printing a newline).
Suggestions welcome.
–Jim Aikin