From the NannyMUD documentation

LAST CHANGE

2003-05-30

NAME

        basic_room - A simple standard room.

INHERITS

        /std/basic

FUNCTIONS

SETUP FUNCTIONS

        add_exit
        add_hidden_exit
        remove_exit

QUERY FUNCTIONS

        query_exits
        query_long
        short
        query_dest_dir (compatibiltiy reasons)
        is_room

PROPERTIES

EXTERNAL PROPERTIES


PROPERTY NAME

        sound_effect - Sound effect when entering a location.

DESCRIPTION

        When a player enters a room, this property is read from the
        room. If the result is a string, it is processed by the
        mud_sound system. If the player has enabled sound support, and
        his client can handle it, a sound can be played at his
        terminal.

NOTE

        The sound_effect property is checked just before the
        sound_ambient property.

SEE ALSO

        sound_ambient in std/room/basic_room

SEE ALSO

        msp in obj/msp

PROPERTY NAME

        sound_ambient - Ambient sound when entering a location.

DESCRIPTION

        When a player enters a room, this property is read from the
        room. If the result is a string, it is processed by the
        mud_sound system. If the player has enabled sound support, and
        his client can handle it, ambient sound can be played at his
        terminal.

NOTE

        The sound_ambient property is checked just after the
        sound_effect property.

SEE ALSO

        sound_effect in std/room/basic_room

SEE ALSO

        msp in obj/msp

INTERNAL PROPERTIES


PROPERTY NAME

        help_string - Location-specific help.

DESCRIPTION

        If set, the property will be used with the 'help here' command
        in the ihelp. It should be used to provide location-specific
        help. The main focus of this is help for mortals, not wizards.

PROPERTY NAME

        indoors - Mark this room as being indoors.

DESCRIPTION

        If set, this property tells the MUD that this location is
        considered to be indoors.

PROPERTY NAME

        outdoors - Mark this room as being outdoors.

DESCRIPTION

        If set, this property tells the MUD that this location is
        considered to be outdoors.

PROPERTY NAME

        no_clean_up - Do not use the automatic cleanup.

DESCRIPTION

        If this property is set in the room, there will be no
        automatic cleanup. If you are using this, you should be
        prepared to handle all that yourself - and really do that,
        too.

PROPERTY NAME

        hard_clean_up - Use a more thorough cleanup.

DESCRIPTION

        If set, this room will clean out everything and itself in
        cleanup, unless there's a player present.

PROPERTY NAME

        no_obvious_exits - The name says it all.

DESCRIPTION

        If this property is set, the obvious exits will not appear in
        the long description.

PROPERTY NAME

        sort_exits - Sort the exits

DESCRIPTION

        If set, the exits in short and long are sorted in a some way. If the
        property is set to a simple integer, a default order will be applied.
        In this, the order is n, s, e, w, ne, nw, se, sw, u, d, enter, in,
        exit and out. Any other exits (if any) are sorted alphabetically.

        You can get a call to your own sort function by setting the property
        to the usual eval syntax, either "@func()" or "@path->func()". In the
        former case, the function 'func' is called in the room object or, if
        the propery __remote is set, in the remote object. For the latter
        form, the function 'func' is called in the object described by 'path'
        (upon which expand_file_name is performed). In all cases will the
        _second_ argument to the function be a array with all the exit
        directions. The function must return a re-arrangement of this array.

DESCRIPTION

        If things in the rooms inventory has the function
        query_in_long_short() return a string, this string will be
        shown just before the obvious exits in the room.
        Note that the return value of query_in_long_short() is cached,
        so if you want to remove/add/change any of these descriptions
        you should call compute_extra_long(0) in the room to flush the
        cache.

FUNCTION


NAME

        add_exit - Add an exit to this room.

SYNTAX

        void add_exit(string direction,
                      mixed whereto,
                      [string leave_message,
                        [string check_function] ]);

DESCRIPTION

        Add an exit in the direction 'direction' leading to the room 'whereto'.
        Whereto will be passed to eval before any action is taken, with
        the "move" or "query" as optional_argument. Depending on wether
        someone is moving or just wants to know the directions.
        If the eval returns zero, nothing happens and 'What?' is printed. 
        If it returns 1, nothing happens and nothing is printed, all other
        values are supposed to be the destination to where the player should
        be moved to.

        Normally, whereto will simply be a filename, relative to the
        directory the room is located in.

        The optional third argument is used as an exit message if present,
        ie. instead of north in the string 'Foo leaves north.' It is sent
        to eval in the same way as 'whereto', but eval is always suppose
        to return a string.

        The optional fourth argument is a function to call to see if the
        exit is blocked. If this function returns 1, the player will not
        be moved. Note that this function might be given as a plain string
        for compatibility reasons, but you may also give it in the standard
        eval notation, ie. "@check_south()" or similar.

EXAMPLE

        add_exit("south", "~mats/wherever2","southwards","check_south");
        add_exit("north", "~mats/wherever");

FUNCTION


NAME

        add_hidden_exit - Add a hidden exit to this room.

SYNTAX

        void add_hidden_exit(string direction,
                             mixed whereto,
                             [string leave_message,
                               [string check_function] ]);

DESCRIPTION

        This function works just like add_exit(), but adds a hidden
        exit. A hidden exit is an exit that is never shown in the rooms
        description, and when used, the players leave message does not
        reveal the direction.

NOTE

        If you add both an exit and a hidden exit with the same direction,
        the normal exit will be used.

EXAMPLE

        add_hidden_exit("north", "~brom/wherever");
        add_hidden_exit("south", "~brom/wherever2", 0, "check_south");

FUNCTION


NAME

        remove_exit - Remove an exit

SYNTAX

        void remove_exit(string direction);

DESCRIPTION

        Remove the exit leading in the direction 'direction'.

FUNCTION


NAME

        query_exits - Return a mapping describing exits in this room.

SYNTAX

        mapping query_exits();

DESCRIPTION

        This function returns a mapping describing the exits and
        desctinations in this room. The mapping has the form:

        ([ "direction 1": INFO_1,
           "direction 2": INFO_2,
           ...
        ])

        The 'INFO' can be one of two things:
        1/ A string, holding the absolute path to the destination,
        2/ An array of information. The array has the following
           content, matching how 'add_exit' was called for the
           direction:
           
           ({ "/absolute/path/to/destination",
              "leave message",
              "check function"
           })

FUNCTION


NAME

        query_long - Return the long description of the room.

SYNTAX

        varargs string query_long(string item, int raw)

DESCRIPTION

        If given no arguments, the long description of the room, including
        exits, are returned. If the first argument is given, the description
        as added with add_item for that item is returned. If the second
        argument is given, the long description is returned, but without
        the exits added. This can be used if you need to put things between
        the long description and the exits.

FUNCTION


NAME

        short - Return the short description of the location.

SYNTAX

        varargs string short(int raw, int no_meta)

DESCRIPTION

        This function returns the short desc, including dirs. If you provide
        the argument 'raw', no exits will be added. If you provide the
        argument 'no_meta', no meta-information (like colour) will be added.

FUNCTION


NAME

        is_room - Is this object a room?

SYNTAX

        int is_room()

DESCRIPTION

        This function returns 1, thus ensuring the user that the room
        can fully function as a room in the MUD. This makes life easier
        for creating wizards:

        + You know if a room is, indeed, working as a room.
        + You don't have to check a lot of filenames.
        + You can create your own room objects.

NOTE

        If you define this function in an object which is not a room,
        you will break lots of things. Please don't do that.