command parsing

Adam Wiggins nightfall at inficad.com
Thu Mar 13 01:33:18 CET 1997


> :I guess it's the difference between making a wall and letting users get
> :over it in whatever way they can manage (whether it be flying, climbing,
> :becoming non-corporeal and walking through, or even smashing it down) and
> :doing a script like:
> :
> :if token++.Is("climb") and token.Is("wall")
> :  room_message("$n scale$s the wall.", ch);
> :  move_char(ch, UP)
> 
> You're going to have to have a very general scenario in order for all of
> those methods of getting past the wall work!

Ah...you seem to have summed up my point much more elegantly than I. :)

>You're not going to get any
> of them for free, I suspect.

Of course not.  But then again, no one on this list seems very fond
of the "easy way out", which I why I read (and post to) it.
Anyways, I've found that doing stuff really generalized always pays
off in the long run, and have been bitten in the ass when I tried to
"trick" my way out of doing something generalized.

> However, point taken, and I've added a note to my to-do list to think hard
> about moving all verbs to the main grammar. I instantly ran into the
> 3 definitions of 'read' - in the main scenario it reads text from some
> object, in the mail-room it reads your email, and in the newsroom it
> reads your set of subscribed newsgroups. The latter two forms don't
> take an object, but the first requires one!

Right...actually this is a particularly good example of confusing
mud-isms I run into all the time.  Sometimes "examine" gives you different
output than "look", but usually not.  Sometimes "read" or "study" give you
different output, as well, but again not always.  Two books from two different
zones - one you have to type "read book" the other you have to type, "open
book" and then "look page."  Huh?  Why?  And once again this is why I'm
fond of "passive" objects - instead of stating, "use the 'read' command
to read me" or even "here's what the user will see when they type 'read'",
it only stores what is written on its pages, in what language, the legibility
of the text, and whatever else you might desire.  Then your commands, be
they 'read' or 'study' or 'look' or whatever can pull the information they
need from it, and this will always be consistant.  Plus it makes actually
creating the book very easy, since you just write the text contained in the
book, tell what language etc, and don't even think about the implementation
of how users will actually manipulate it.  (This also has the nice side-effect
of allowing you to change how the system works completely and not needing
to modify any objects, since the text in the book is always the same
regardless of how the user accesses it.)





More information about the mud-dev-archive mailing list