[MUD-Dev] Re: MUD Design doc (long)

Chris Gray cg at ami-cg.GraySage.Edmonton.AB.CA
Thu Dec 17 21:30:30 CET 1998


[Mik Clarke:]

 >  if target object not specified, 
 >    emote is in dire need of a bath
 >  else
 >    locate target object
 >    if not found,
 >      send_to_char "Sorry, can't find one of those."
 >    else
 >      if (!object->can_you_be(CMD_SNIFFED)) 
 >        send_to_char "It smells of nothing in particular."
 >      else
 >        object->you_are(CMD_SNIFFED, char)

Big nod here.

This is what I do in my system, and it works fairly well. It is also
possible to write generic code that will do this with lots of verbs,
so the skeleton can be re-used via a function call.

You can get more complex, too:

    - there can be command pre-empts attached to the room and the
	character, which may supercede any attached to the object.

    - to save effort, you can check for simple string responses as
	alternatives to methods - just emit the string.

    - locating the target object can vary a bit. I have two variants, one
	which searches only the character's inventory, and one which
	searches that, then the room's contents. (So far, 'get' is the
	only one that wants to search the room's contents before checking
	in the inventory.)

    - another simplification is to have rooms able to have lists of
	"scenery" words - if no matching object is found, check that
	list of words, and if a match is found, just say something
	generic like "You can't " + verbString + " the " + nounString.

    - there might be other places to sort-of check. For example, items
	for sale in a store might be off-limits to some verbs until
	you have purchased them.

--
Don't design inefficiency in - it'll happen in the implementation. - me

Chris Gray     cg at ami-cg.GraySage.Edmonton.AB.CA




More information about the mud-dev-archive mailing list