[I7] Pre-parsing the player's command.

So I’m trying to parse possessives again. And, as usual, discovered something I couldn’t really do.

After reading a command: if the player's command includes "[a person]", say "Whee!"

So far so good: clearly I’ve matched a person and Inform understands which person this is. However, it isn’t inclined to tell me; I can’t loop through people and match them in the same way, which kind of defeats the purpose.

So I’m wondering: at which point does it perform the match, and can the matched object be extracted? It’s possible for kinds of value, after all.

Draconis had a good suggestion in a previous thread for a similar problem that may be applicable. See:

https://intfiction.org/t/figuring-out-what-was-included/9159/1

It’s a good idea, but it doesn’t seem to allow for wholesale matching of the player’s command – which in turn is only the first part of what I want do do. This is rapidly turning into me trying to shave the yak. :frowning:

When you match an object, it puts it into the “noun” global variable. You can extract it from there.

True. At that point, though, there are limits to what you can gracefully do. My planned heuristic is as follows:

  • If the player’s command contains the pronoun “his”, look for a person being named in the player’s command before that point.
  • If there is no person mentioned, assume the “he” pronoun.
  • Replace “his” in the input with “[matched person] s”, which we can already handle using regular Understand tokens.

Something similar, albeit more complex, would be required for the “her” pronoun. I can see this method kinda sorta work, but it looks awfully chancy to me.