If I want to entirely make it impossible that the supplying a missing noun activity were ever to start, how would I go about it? Sometimes when I ask questions, people misunderstand my intention for my application, and suggest alternatives to the approach entirely, but I would like to really explore doing specifically what I am asking here, rather than discussing why it is a bad idea or something like that, if possible.
To clarify what i am trying to do, I want to intercept commands that lack a valid noun, but should have one, and try to apply contextual logic that will figure out the noun for the player. In the absolute worst-case scenario, this logic will choose the player himself, if absolutely no nouns other than the player exist in the location. This doesn’t mean that the resulting action must succeed… if the action is impossible with the noun selected, the action will still result in failing to do whatever it is with said noun, but I never want no noun to be selected if a command to take an action requiring a noun is entered.
So:
>take blarg
should never result in the response “You must supply a missing noun”. I don’t mean to change this library response, I mean this parser error should never occur.
Instead, I have other plans for ultimately changing the player’s command into something that will try to figure out what that action could apply to.
The beginnings of this, I thought, might be this:
After reading a command:
if the noun is nothing:
foo;
The problem with this, is that there are lots of commands that aren’t supposed to have nouns, like taking inventory, for example. This is problematic for me, because I don’t know how to differentiate what action is being attempted before it is attempted… that is, how to determine what the action is during the reading a command activity. Is there an easy way to determine what action is being attempted during the reading a command phase? Is there a better way to accomplish what I am trying to do here (again, to actually accomplish what I outlined above, not a different thing to code with a totally different premise).
Edit: I just realized this might be confusing, because usually the parser error is the can’t see any such thing error, but I’ve already accounted for that, never letting that one happen, and instead parsing the text of the command even if there are no things that match the noun… so the next parser error encountered is the one in question here, the supplying a missing noun error. I sometimes forget the other pieces upstream I’ve already changed…