Re: Procedures and Parameters
Ferlin Scarborough wrote:
<snip>
With a typical adventure parser, you typically only need three variables:
verb, noun, and with. Typically, it's the job of the parser to fill in these
values:
look:
verb = look
noun = null
with = null
look at the vase
verb = look
noun = vase
with = null
look at the delicate ming vase
verb = look
noun = vase
with = null
look at the delicate ming vase with the magnifying glass
verb = look
noun = vase
with = magnifying_glass
I'd just stick the values in global variables.
It's also typically the job of the parser to dis-ambiguify input text. Some
games are really stupid about this. For example, I've played games where
there are no keys in the room, but I can still type:
> TAKE THE KEY
and the game will respond:
Which key do you mean, the gold or the silver key?
The over-helpful parser (like the one above) gives away too many clues. Even
worse, there is the parser can't figure out what you mean, even if only one
choice makes sense:
> OPEN THE DOOR WITH THE KEY
Which door do you mean, the red or the green door?
[parser doesn't notice there is only a GREEN door in the room]
THE GREEN DOOR
Huh?
[parser requires full sentance be re-typed]
> OPEN THE GREEN DOOR WITH THE KEY
Which key do you mean, the gold or the silver key?
[parser doesn't notice i only have SILVER key]
> OPEN THE GREEN DOOR WITH THE SILVER KEY
These sorts of parsers make game playing painful.
-- David Cuny
|
Not Categorized, Please Help
|
|