Re: Sit on objects. -0700"

From: James Turner (turnerjh@XTN.NET)
Date: 04/29/98

Doppleganger Software <doppsoft@TZC.COM> writes:

> >How would i make it so players could actually "Sit" On a chair or bench.
> >and when you typed look it would say something like
> >
> >"Bosstone sits here on a chair."
> >
> >??? Just think it would be neat.
> This is easy.  I did it myself...except my chairs have a few extra
> features.  They cast spells on you the longer you sit on them.  :)  Well,
> it's pretty simple.  It incolves adding in a structure to both objects
> and player to reference each other while they are sitting.  Also, you

I too have coded this.  The code is fairly simple.  There's no real
reason (at least, if the objects aren't tossing spells) to have the
furniture point at the characters.  Add a pointer to an obj_data to
the char_data structure.  When someone sits, point it at the furniture
(with appropriate checks that there aren't too many people sitting
there already).  Then clear the pointer to the furniture in
char_from_room and init_char.  Only downside is using "at" undoes
someone sitting on a piece of furniture (not a prob for morts).

Works well.  Might add a check in extract_obj to make sure no one is
sitting on a piece of furniture if it were to go away.

I would suggest making a new type of object for this type of code, and
using the values array for things like how many can sit in it, minimum
position (maybe not, it's possible to sleep in chairs, just not
hard).  Also, add one for the preposition that is used when a char
plops down (sitting in a chair, on a couch, under a tree, at a table,
etc, etc).

Players really like this kind of code... adds atmosphere.

James Turner     

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST