Friday, October 31, 2014

Latchkey #61 - Recoding the Take Command, Parser

Figured out the crash with commands that are nothing but verbs.  At an early point in parsing, I splice out the verb, which means the rest of the input might be null, but I don't check for that.  I just removed the splices for now.  Thought it would be more efficient, I guess, but not really a big deal for now.

So in other news, it appears that the move and look commands work in a vaguely alpha way, if not a grammatically correct way.  So that's good.

Taking items works again now, too.  Some weird little bugs, but I've fixed the crashes that came up.  But now, although you can take the item, the item still stays in the room too, and I can't remove the duplicate. Eek.  It's basically because during the initial parsing, I don't differentiate between items in the player's hand and items in the room.

So now I'm in the middle of fixing that mess.  Which also means I'm rewriting the code for figuring out which item the player is talking about when they use adjectives.  I'm perhaps halfway through that, but it gets tricky.  The old code for it was quite sloppy, and wasn't perfect by any means, so I've got to get it a bit better before going further.

Tasks within tasks.

No comments:

Post a Comment