The following example is a bare bones object. It really doesnt
do anything nor can you do anything with it but look at it.
inherit OBJ;
setup()
{
set_id( "terminal", "computer" );
set_adj( "dumb" );
set_long( "It looks like it has an IQ of about 30." );
}
This object will repond to the names "terminal" and "computer"
also will repond to "dumb terminal" and "dumb computer".
This object is very boring, completely useless. Lets make it
more interesting.
set_proper_name("Excalibur");
This will force the mud to refer to the object as Excalibur.
Please note that you still have to have set_id() and
set_adjectives() so the mud knows what the player can refer
to the object as. For example:
include <mudlib.h>
inherit OBJ;
setup()
{
set_id( "sword", "Excalibur" );
set_adj( "King Arthur's" );
set_long( "This is a hideously sharp blade" );
}
set_unique(1);
This will force the mud to refer to an object as 'the .....'.
Usually reserved for items that are unique. i.e. unique items
should probably be refered to as 'the' instead of 'a'.
set_in_room_desc("A dumb terminal sits in the corner of the room.\n");
This will replace the default message of 'a dumb terminal sits
here, discarded' with the above message. This works well.
However, for objects that can be taken, everytime you drop them
they will go to the corner of the room. This would be rather odd
in a round room. the solution is to use set_untouched_desc.
set_untouched_desc()
This can be used to give a very verbose description of where the
item is in the room. However once the item is moved this
description is no longer used.
========================================================================
Your base object is still useless as it cant be picked up or
used in any way. In order to change the functionality of your
object you need to inherit files of the form M_*. this will add
the necessary functions to allow you to change the way you object
behaves.
The following M_* files are available:
M_GETTABLE Functions for object that can be picked up
M_LOCKABLE Functions for objects that can be locked/unlocked
M_ANSI Functions for using %^ ansi protocol
M_WEARABLE Functions for things that can be worn
M_ITEMS Functions for providing virtual/fake items for
objects
M_OPENABLE Functions for objects that can be opened and closed
M_READABLE Functions for something that can be read
M_WIELDABLE Functions for something that can be wielded (weapons)
There are a few more inheritables that may be used also but dont fit
into the module category.
CONTAINER Makes your object a container for other objects.
ENTERABLE Makes your object able to be entered.
WEAPON Weapons
MONSTERS Monsters
DOOR Doors to places
LIVING Can hold things and perform actions(no fighting)
For the documentation on these inheritables please see the
appropriate help file for that inheritable. Also note that
work is in progress on these so they may not be entirely complete.