[Package Index | Mudlib Index | Effect Index]

File /std/room/basic_room.c

The standard room inheritable. This contains all the stuff needed to construct a standard room.

See also:
/std/room/outside.c

Written by Pinkfish

Inherits

This class inherits the following classes /std/basic/id_match.c, /std/basic/cute_look.c, /std/basic/help_files.c, /std/basic/property.c, /std/basic/init.c, /std/room/basic/wall.c, /std/basic/effects.c, /std/basic/light.c, /std/basic/extra_look.c, /std/room/basic/linker_base.c, /std/basic/export_inventory.c and /std/basic/desc.c

Includes

This class includes the following files /include/obj_parser.h, /include/situations.h, /include/factions.h, /include/position.h, /include/move_failures.h, /include/zmp.h, /include/map_handler.h, /include/nroff.h, /include/armoury.h, /include/cmds/bury.h, /include/weather.h and /include/door.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

add_alias
void add_alias(mixed alias,
string name)

This method adds an exit alias to the room. Aliases are convenient extra forms that can be attached to certain exits. In the above functions, the variable names is either a string or an array of strings and is, respectively, the alias or aliases for the direction passed in word. Since, sometimes, the same alias could be used for more than one exit, remove_alias() requires both alias(es) and direction in order to remove the correct alias(es).

Parameters:
alias - the name to alias the exit to
name - the exit name to alias

See also:
query_aliases() and remove_alias()

Example:
add_exit( "north", PATH +"dining_hall", "corridor" );
add_alias( ({ "enter", "enter hall", "enter dining hall" }), "north" );

add_exit( "board carriage", PATH +"carriage", "door" );
add_alias( "board", "board carriage" );

add_day_item
varargs int add_day_item(mixed shorts,
mixed desc,
mixed no_plural)

This method sets up an item which will only be displayed during the day. All of the standard add_item things are available with this method.

See also:
/std/room->add_item() and add_night_item()


add_enchant
int add_enchant(int number)

Adds number to the current enchantment level of the room. The enchanment level controls things like what happens when you flip coins and some special messages which give wizards some idea about magic levels.

Parameters:
number - the new enchantment level to set

See also:
query_enchant()


add_exit
int add_exit(string direc,
mixed dest,
string type)

This method adds an exit to the room. The direction is the direction in which the exit should go. This is something like "north" or "enter gate". The destination field is where the player will go when they enter the exit. The type is a set type that sets a whole bunch of defaults for the room. The destination can be either a strong or an object.

The types are controlled by /obj/handlers/room_handler.c and the current types and what this all means are:

road
Wide road.
path
Narrower path
door
And exit with a door. Defaults to closed but not locked.
secret
A secret door. Defaults to closed but not locked.
corridor
A corridor (bing).
hidden
A hidden exit without a door

The room aliases are used to expand things for exits. However they don't expand the entire exit name. They expand it in bits. For instance, if the exit was "enter live eel", you could add_alias("eel", "live eel"); and add_alias("bing", "enter"); to get both of the bits of the exit. So "bing eel", "enter eel", "bing live eel" etc would work.

See also:
modify_exit(), query_dest_dir(), remove_exit() and /obj/handlers/room_handler .c

Example:
add_exit("north", PATH + "market2", "road");
add_alias("eel", "live eel");
add_exit("enter live eel", PATH + "live_eel", "secret");

object fluffy_room;

fluffy_room = clone_object(PATH + "fluffy_room");
add_exit("north", fluffy_room, "road");

add_exit_callback
int add_exit_callback(string func_name,
object ob,
mixed * args ...)

This adds a callback that will be triggered when something uses an exit in the room, either by leaving through it or entering through it. The function will be called with the following arguments: your_function( object room, object player, string direction, string destination, string arrive, string leave, int entering, args ) room is the room that the player entered/exited (this_object()) player is the player/npc that entered/exited direction is the exit name the player/npc used destination is the path of the destination arrive the message printed to the room they arrived in leave the message printed to the room they left from entering is 1 if the player entered this room or 0 if they exited args are any arguments you want passed (see below)

Parameters:
func_name - The name of the function to be called.
ob - The object to call func_name on.
args - Any arguments you want passed to the function.

Returns:
An id to remove the callback with.


add_hidden_object
int add_hidden_object(object thing)

This puts a hidden object into a room. A hidden object is an object that exists in the room as far as all the find_match calls go. So, for look at's and so on, but does not actually exist in the room so it does not show up in the inventory when the player does a look. This is the method used for putting signs and doors into rooms, that actually have shorts and you can do things to, but do not show up in the inventory. The function init is also called on these objects when init is called in the room. The only thing you cannot put in your init function is an add_action. You can however define up bunches of add_commands...

If this sounds complicated. Think of it as an object that IS in the room, but you cannot see it.

A word of warning here, the init() function will *not* be called on all the players when the object is added as hidden. This means that the commands on it will not be available until the player re-enters the room. You could get around this by moving everyone out of the room and then back in again.

Parameters:
thing - the hidden object to add

Returns:
1 if successful, 0 on a failure

See also:
query_hidden_object() and remove_hidden_object()

Example:
#include 
sign = clone_object(PATH + SIGN);
add_hidden_object(sign);

// Add a hidden object that has actions we want players to be able to
// use.
add_hidden_object(fluffy_container);
players = filter(all_inventory(), (: living :));
players->move(ROOM_VOID);
// This forces init() to be recalled.  (This is realtivatively icky
// way of doing it, but the driver does not give us many alternatives).
players->move(this_object());

add_item
varargs int add_item(mixed shorts,
mixed desc,
int no_plural)

This method adds an item description to a room. This allows you to set up objects which do not exist as individual pieces of code, but which can be looked at and (if you like) interacted with.

The first argument should be a string or an array of strings, which act as the name(s) of the item. If this is an array, the item can be referenced by any of the names in it, but the first element is the one that will be shown if e.g. the player glances at it. If you include multiple words in the name, all except the first will be treated as adjectives. The plural will be automagically added unless the no_plural flag is set.

The second argument should be either a string, in which case that string is printed to a player when they look at the item, or a function pointer, in which case the function will be evaluated and its return result printed to a player when they look at the item, or an array, which can be used to add interactivity. The array should have an even number of elements; the odd-numbered elements define a keyword or verb, and the even-numbered elements set up what should happen when the players use the relevant command. Keywords include:

"bright" - makes the item emit a certain amount of light

"gather" and "gather mess" - defines behaviour when people try to gather the item

"long" - sets the long description (you should always have this)

"position" - allows people to use that item to do positions on, like stand, sit, lie etc.

"searchable" - defines behaviour when people try to search the item

Verbs can be anything, for example "turn", "prod", "take", etc. The even-numbered element that follows your verb can be a string (which is printed when the verb is used), a function pointer (which is evaluated and the result printed when the verb is used), or an array. Note that in the first two cases, everyone else in the room will see the player doing the thing in the form "$N $V $D.", e.g. "Kake prods the item."

If this even-numbered element is an array, then things get more complicated (but also more fun). The array can take several forms, some but not all of which are listed below:


({ SYNTAX, STR_PLAYER })
({ SYNTAX, ({ STR_PLAYER, STR_ROOM }) })
({ SYNTAX, FUNC })
({ SYNTAX, FUNC, PATT })
({ FUNC, PATT })

Here, SYNTAX denotes info that will show up when the player uses the syntax command for this verb, STR_PLAYER denotes a string that will be printed to the player when they use this verb, STR_ROOM denotes a string that will be printed to everyone else in the room, FUNC denotes a function that will be evaluated, and PATT denotes an add_command pattern.

If FUNC is specified but PATT is not, a pattern of "" will be assumed; and if STR_PLAYER is specified but STR_ROOM is not, a message of "$N $V $D.\n" will be assumed.

Parameters:
shorts - the short description of the item
desc - the description of the item
no_plural - do not automaticaly add a plural for the item

Returns:
1 if successfully added, 0 if not

See also:
query_item(), remove_item() and modify_item()

Example:
add_item( "green pot plant", "A nasty green pot plant lurks by the "
  "door.\n" );

add_item( ({ "telephone", "red phone" }), "A red phone sits in the "
  "corner, staring unhappily into space and thinking of cupcakes and "
  "better times.\n" );

add_item( "small book", ({
  "long", "A small red book with dots on the cover.\n",
  "read", "It says \"Rabbit!\" in big letters.\n" }) );

add_item( "green leather couch", ({
  "long", "The green leather couch is wonderful; so comfy!  So... Comfy!\n",
  "position", "the green leather couch",
  "flip", ({ "Flip the couch over.",
             ({ "You try to flip the couch but it's way too heavy.\n",
                "$N struggle$s with $D before giving up.\n" }) }) }) );

add_item( "rotating hologram", (: query_current_hologram_string :) );

add_item( "glue stick", ({
  "long", "The glue stick looks sticky, like you could slime something "
          "with it.\n",
  "slime", ({ "Slime something with a glue stick.", (: do_slime :),
              " with " }) }) );

add_night_item
varargs int add_night_item(mixed shorts,
mixed desc,
mixed no_plural)

This method sets up an item which will only be displayed during the night. All of the standard add_item things are available with this method.

See also:
/std/room->add_item() and add_day_item()


add_resource
void add_resource(string resource)
add_room_chats
void add_room_chats(string * new_chats)

Adds more chats to the existing set of room chats managed by this chatter object.

Parameters:
new_chats - an array of new chat strings

See also:
remove_room_chats.c, query_room_chats.c and /std/room/basic/chatter .c


add_room_day_chat
int add_room_day_chat(string str)
add_room_night_chat
int add_room_night_chat(string str)
add_sign
varargs object add_sign(string sign_long,
mixed sign_read_mess,
string sign_short,
mixed sign_name,
string sign_language)

This method adds a sign into the room. Any of these elements can be set to 0, except the long description.

Parameters:
sign_long - the long description of the sign
sign_read_mess - the readable message on the sign
sign_short - the short description of the sign
sign_name - the name of the sign
sign_language - the language the sign is written in

Returns:
the object for the sign


add_situation
void add_situation(mixed label,
class situation sit)

Adds a situation to the room. These situations can be invoked manually with start_situation or automatically via automate_situation.

Parameters:
label - string or number labelling the situation
sit - a structure (class) containing all the bits of the situation you want to add. It should be a variable of class situation. You should include situations.h where this class is defined. Every part is optional. eg. start_func function to be called at start of situation that might be used to load NPC's or anything beyond a message. The start function is passed the label, a do_start_mess flag and the room object. If the flag is 1 the situation is starting rather than being reloaded. Thus if do_start_mess is 0 then you should avoid any obvious start messages and make it look like the situation is already underway. end_func function to be called an the end of a situation. The end function is only passed the label and the room object. start_mess message told to the room at start of situation end_mess message told to the room at end of situation extra_look extra look string appended to rooms long during the situation chat_rate an array of 2 numbers giving the minimum and maximum delay between chats. If this is set then the chats are not merged with the existing chats but added independently with their own chat rates as given. chats an array of chat strings to be active during the situation add_items a mixed array of ({ item, item description }) pairs to be active during the situation random_words sets of words to insert into text to replace the special character #n where n is a number. The form of the array is ({ #1array, #2array, ... }) where #1array = ({ "#1word1","#1word2",... }) etc. For the duration of the situation one of the strings in #1array is used to replace all instances of #1 in the extra_look, start_mess, end_mess, chats and key and the long description part of the add_items. In a situation compounded of many situations the same random seed is used for choosing all #1's for each individual situation for the duration, and a different seed for all #2's etc.

See also:
start_situation.c, end_situation.c, automate_situation.c, change_situation.c, add_item.c, room_chat.c, add_extra_look.c, set_situation_changer.c, make_situation_seed.c, /include/situation.h and goto learning search situation for working examples.c

Example:
#include 

class situation frogs;
frogs = new(class situation,
    start_mess: "Water seeps out of the ground to form puddles.",
    extra_look: "There are large puddles on the ground here.",
    chat_rate: ({ 120,180 }),
    chats: ({"A hidden frog croaks quietly.",
             "There is a blooping sound." }),
    add_items:({ ({"puddle", "The puddles are dark and murky.  "
                   "They will probably dry up given time." }) }) );
add_situation( "frogs", frogs );

add_situation( "ship", new(class situation,
     start_mess: "A #1 ship hoves into view.",
     extra_look: "There is a #1 ship forging up the river.",
     chats: ({"The #1 ship's sails flap in the breeze.",
              "Shouts of sailors carry over to you from the #1 ship." }),
     add_items: ({ ({"ship", "The #1 ship, the \"#2\" is a small "
                   "sailing vessel that transports cargo up and "
                   "down the river."}) }),
     random_words: ({ ({ "old","waterlogged","heavily laden" }),
                      ({ "Jemima", "Old Sea Dog", "Randy Mermaid" }) })
     ) );
When the situation is started a random choice (eg. "old") replaces #1
and a name (eg. "Jemima") replaces #2 in the text strings for
the duration.

add_situation( "frogs", new(class situation,
     start_mess: "Water seeps out of the ground to form puddles.",
     extra_look: "There are large puddles on the ground here.",
     chats: ({"A hidden frog croaks quietly.",
              "There is a blooping sound." }),
     add_items: ({ ({"puddle", "The puddles are dark and murky.  "
                     "They will probably dry up given time." }) }) ));

This is an empty situation, useful for making pauses in the action.
add_situation( "pause", new(class situation) );

add_use_internal_object
void add_use_internal_object(object thing)

This method adds an object whose interior bits want to be able to export commands. You can use this for tables an so on, so that stuff on a table can still be used.

Parameters:
thing - the thing whose inventory bits are to be exported


add_zone
void add_zone(string zone)

This method adds a move zone into the current list of movement zones for the room. The move zones are used by npcs to see which rooms they are allowed to move into.

See also:
set_zone(), query_zones() and /obj/monster->add_move_zone()


attack_speed
varargs int attack_speed(object attacker)

This method sets the default attack speed for the room. This defaults to 15.

Returns:
the default attack speed


automate_situation
varargs void automate_situation(mixed label,
mixed duration,
mixed when,
mixed chance,
mixed category)

Automate starting and ending of a situation. These situations can be invoked manually with start_situation. The automated starting and ending is unaffected by the room unloading. When the room reloads the situation will be restarted unless its duration is up. You must include the file situations.h for the definitions of the when masks. The random seed needs to be set consistently for the situations. This is probably ok unless your rooms are clones (see make_situation_seed).

Parameters:
label - (mixed) label of the situation to start up. If you pass an array such as ({ "frog1", "frog2" }) for the label then that set of situations are started one at a time and the total duration is split evenly between them. Label is usually an integer or a string or an array of integers and/or strings. If the string is a list of labels separated by , then multiple situations are started using those labels.
duration - (int) total time (seconds) the overall situation should last. You can put an array of durations -- one for each situation if the label lists more than one situation and then the overall time is the sum of the numbers. -1 is a special duration. It means that the situaton given that duration is not part of the set but a special background or default situation that occurs all the time except when this automated situation is going.
when - (int) a time of the day mask. This limits when the situation is allowed to occur. The mask is composed of the allowed hours in AM time ( 24 hours clock, (1< chance - (int) chance in 1000 of starting the situation This is tested every duration seconds.
category - (optional) if you specify a cateory for the situation then no situations with the same category will overlap. category would usually be a string eg. "boats".

See also:
add_situation.c, start_situation.c, end_situation.c, situations.h, set_situation_changer.c, make_situation_seed.c and goto learning search situation for working examples.c

Example:
#include 

 automate_situation( "frog", 300, WHEN_ANY_TIME, 200 );

This will automatically start the situation labelled "frog"
at a random time that is any time of the day with a 200/1000
chance of it starting per 300 seconds.  It will last for
300 seconds (5 minutes).

 automate_situation( ({"frog1,pond","frog2,pond"}), 240,
                       WHEN_EVENING|WHEN_NIGHT, 300 );

This will automatically start a situation that is a combination
of "frog1" and "pond" followed by "frog2" and "pond".  They start
at a random time but only in the evening or at night.
There will be a 300/1000 chance of
it starting per 240 seconds.  Both the "frog1" and "frog2"
situations will get half the total time (as there are two),
120 seconds each, for a total duration of 240 seconds (4 minutes).

 automate_situation( ({"frog1,pond","frog2,pond"}), ({ 80,160 }),
                       WHEN_EVENING|WHEN_NIGHT, 300 );
Same as previous example except the durations of the individual
parts are set: "frog1,pond" for 80 seconds followed by "frog2,pond"
for 160 seconds.  The total time is 80+160.

calc_co_ord
void calc_co_ord()

This method calculates the co-ordinates of this room. The co-ordinates are based on the surrounding rooms co-ordinates, if one of those rooms are loaded. The function 'query_do_not_use_coords' is called on the rooms to see if the co-ordinates are allowed to leak out further or not.

See also:
query_co_ord() and modify_exit()


calc_exits
void calc_exits()

This method calculates all the exit strings to be used for this room.
calc_long_exit
void calc_long_exit()

This method creates the long exit description used in the room long descriptions.

See also:
query_long_exit()


calc_short_exit_string
string calc_short_exit_string()

This method returns the exit string used when in brief mode.

Returns:
the brief exit string

See also:
calc_exit_string()


calc_short_exit_string_mxp
string calc_short_exit_string_mxp()

This method returns the exit string used when in brief mode, but with MXP.

Returns:
the brief exit string with mxp


can_use_for_co_ords
int can_use_for_co_ords(string other)

This method is designed to allow a little more flexability in which rooms can be used for co-ordinates. It should be overridden by higher up rooms to do different checks.

Returns:
1 if it can be used, 0 if not


change_situation
varargs mixed change_situation(mixed label,
mixed duration,
mixed words)

Starts one or more situations that will end after a specified duration. You can use an array and make further situations commence when others end.

Parameters:
label - (mixed) label of the situation to start up. If you pass an array such as ({ "frog1", "frog2" }) for the label then that set of situations are started one at a time and the total duration is split evenly between them. Label is usually an integer or a string or an array of integers and/or strings. If the string is a list of labels separated by , then multiple situations are started using those labels.
duration - (int) total time (seconds) the overall situation should last. You can put an array of durations -- one for each situation if the label lists more than one situation and then the overall time is the sum of the numbers. -1 is a special duration. It means that the labelled situation goes on forever (and thus nothing after it in the array will ever go).
words - is a list of replacements for #n in the text OR a random number seed to use to choose words from random_words. eg. ({ "#1", "frog", "#2", "honey" }) or 22

Returns:
handle useful for halting the changes later. It is typically a small positive integer.

See also:
shutdown_situation.c, add_situation.c, automate_situation.c and goto learning search situation for working examples.c

Example:
handle=change_situation( ({ "sew1","sew2" }), ({ 60,60 }) );

if (over) shutdown_situation( handle, ({ "sew1","sew2" }) );

change_situation( ({ "background,sew1","background,sew2" }), 120 );

change_situation( ({ "building_falling","rubble" }), ({ 120, -1 }) );

add_situation( "boat1",
  new(class situation,
    start_mess: "A little fishing boat comes up to the pier.  "
       "It has the name \"#1\" painted on the side.\n"
       "A fisherman jumps off the boat and ties its painter to a post.",
    chats: ({"The little boat bobs up and down next to the pier.",
             "A fisherman hops off the little boat." }),
    chat_rate: ({ 20, 30 }),
    extra_look: "There is a little boat here.",
    add_items: ({ ({ ({ "#1","little boat" }),
      "There is little fishing boat tied up at the pier here.  "
      "The name \"#1\" is painted on the side."   }) }),
    end_mess: "The fishermen get back on board and "
       "the little boat moves on.",
    random_words: ({ ({ "Honey Toad", "Piker", "Bing" }) })
  )
);

change_situation( "boat1", 120, ({ "#1","Floating Egg" }) );

check_day_night_switch
void check_day_night_switch(int old)
clear_frame_map
string clear_frame_map()
do_exits
int do_exits()
end_situation
void end_situation(mixed label)

Ends a situation previously added and started on the room. These situations can be invoked manually with start_situation or automatically via automate_situation.

Parameters:
label - label for the situation

See also:
add_situation.c, start_situation.c, automate_situation.c and change_situation .c


expand_alias
string expand_alias(string word)
faction_check
int faction_check(string str,
object ob,
string special_mess)
find_inv_match
object * find_inv_match(string words,
object looker)

This method returns all the matchable objects in the room. This is used by find_match to determine the group of objects to select from.

Parameters:
words - the words to match on
looker - the person doing the pmacthing

Returns:
the array of objects to match on


flesh_map
string flesh_map(string map)
flush_co_ord
void flush_co_ord()

This method resets the co-ordinates for the room to zero, and resets a flag so that calc_co_ord() can be called again to redetermine the room's co-ordinates.

See also:
set_co_ord(), calc_co_ord(), query_co_ord() and query_co_ord_calculated()


get_faction_exits
class faction_exit * get_faction_exits(string direction)
has_exit_callbacks
int has_exit_callbacks()
is_allowed_position
int is_allowed_position(string poss)

This method tells us if the passed i nposition is allowed in this type of room.

Parameters:
poss - the position to check


lookmap
string lookmap(int kind)
make_situation_seed
void make_situation_seed(int xval,
int yval)

Makes a seed value for the random part of when situations turn on and off. The two ints should be constant for a given room -- eg. the coordinates. If this function is not called the seed is generated from the file_name of the object. For this reason, rooms that are clones will produce erratic results unless this function is called.

Parameters:
xval - integer to use to make a seed (eg. x coordinate)
yval - integer to use to make a seed (eg. y coordinate)


modify_exit
int modify_exit(mixed direc,
mixed * data)

This method modifies the parameters for the exit. See the docs in /doc/new/room/modify_exit for more complete information.
modify_item
int modify_item(mixed word,
mixed new_desc)

This method will modify certain bits of the specified item. This will change only the bits of the pattern that are specified. If you wish to remove elements a better method would be to remove the item and then readd it. The format of the new_desc array is the same as in the add_item code.

Parameters:
word - the name of the item to change
new_desc - the bits of the item to change

See also:
remove_item() and add_item()


query_aliases
string * query_aliases()

This method returns the current exit aliases for the room.

Returns:
the exit aliases of the room

See also:
add_alias() and remove_alias()


query_background_enchant
int query_background_enchant()

This method returns the background enchantment of the room.

Returns:
the theft handler of the room

See also:
query_enchant()


query_bright_mess
string query_bright_mess()

This method returns the message to use when it is too bright to see in the room. It defaults to: "It's too bright to see anything!".

Returns:
the message to print when it is too bright

See also:
query_dark_mess(), long() and set_bright_mess()


query_chatter
object query_chatter()

This method returns the current chatter object.

Returns:
the chatter object

See also:
add_room_chat()


query_co_ord
int * query_co_ord()

Returns the current co-ordinates of the room. The co-ordinates are 3d, ({ x, y, z }). So an array with three elements.

Returns:
the current co-ordinates

See also:
set_co_ord()


query_co_ord_calculated
int query_co_ord_calculated()

This tells us if the co-ordinates were set or if they were calculated. If they were set with set_co_ord then the value of this will be 0 otherwise it will be 1.

Returns:
1 if it is calculated, 0 if it is not

See also:
query_co_ord() and set_co_ord()


query_cover_percentage
int query_cover_percentage()

This is the code to use to determine how much cover the room has. This should be used to roughly equate to business in a city and covering branches and stuff outside. This is used by the follow code to determine difficulty in being followed. 100% means very busy and very hard to follow, 0% means no one else on the street.

Returns:
the busy percentage


query_dark_mess
string query_dark_mess()

This is the message to print instead of the room description when the room is dark. It defaults to the message "It's dark in here isn't it?".

Returns:
the dark message

See also:
set_dark_mess(), long() and query_bright_mess()


query_day
int query_day()

This method returns whether or not it is daytime. The value is automatically updated whenever anyone enters the room and so is more efficient than checking with the weather handler.

Returns:
1 for day, 0 for night.

Example:
void init() {
  ::init();
  if(query_day()) {
    setup_daytime_stuff();
  } else {
    setup_nighttime_stuff();
  }
}

query_day_items
class variable_item * query_day_items()

These are the items only visible during the day.
query_day_long
string query_day_long()

This method returns the long description of the room during the day. This is used to print out different strings for rooms during the day and during the night.

Returns:
the night long for the room.


query_default_position
varargs mixed query_default_position()

This method returns the current default position asigned to this room.

Returns:
the current default position


query_dest_dir
varargs string * query_dest_dir(object thing)

Returns an array containing just the destinations and directions used to get there. This is useful for monster or whatever that you want to scan a room for exits to leave out of. The array is of the format. ({ direction1, destination1, direction2, destination2, ... })

The thing passed in is used as the basis for the relative directions if it is an object. If it is not an object then this is ignored altogether.

Parameters:
thing - used to get the relative directions according to thing

Returns:
the array of direction, destination pairs

See also:
query_dest_other() and add_exit()


query_dest_other
varargs mixed * query_dest_other(string direc)

This returns information about the exits in the room. This is the information set by modify_exit(). The values from this are probably not very useful for normal coding.

See also:
modify_exit() and query_dest_dir()


query_destination
varargs string query_destination(string exit,
object mover)

This method returns the destination room for an exit.

Parameters:
exit - the exit name

Returns:
the path of the destination room, or ROOM_VOID on error

See also:
query_dest_dir()

Example:
#include 
string dest;

dest = room->query_destination("south");
if (dest == ROOM_VOID) {
   do_error();
} else {
   do_move("south");
}

query_direc
varargs string * query_direc(object thing)

This method just returns all the directions available to leave from the room.

The thing passed in is used as the basis for the relative directions if it is an object. If it is not an object then this is ignored altogether.

Strawberries

Starting from a above,
Working slowly down under.
Sliding up the sides
Eating a meal, fresh cream and syrup.

Round and round, and round again
Grining micheviously
One tongue at play
Firm and hard, fresh strawberries today.

Parameters:
thing - used to get the relative directions according to thing

Returns:
the array of directions

See also:
query_dest_other() and add_exit()


query_door
varargs string query_door(mixed dest,
string name)

This method determines if the specified exit is a door or not.

Parameters:
dest - the destination to check for being a door
name - the name of the door

Returns:
0 if it is not a door, the direction if it is

See also:
query_exit() and add_exit()


query_door_control
varargs mixed query_door_control(string direc,
string name)

This returns the information about the door in the specified direction.

Parameters:
direc - the direction to query the door in
name - the name of the exit

Returns:
the door control information

See also:
modify_exit()


query_door_locked
int query_door_locked(string direc)

This method checks to see if the door is locked.

Parameters:
direc - the direction of the door

Returns:
-1 on an error, 0 for unlocked, 1 for locked

See also:
modify_exit()


query_door_open
int query_door_open(string direc)

This method checks to see if the door is open.

Parameters:
direc - the direction of the door

Returns:
-1 on an error, 0 for closed, 1 for open

See also:
modify_exit()


query_door_transparent
int query_door_transparent(string direc)

This method checks to see if the door is transparent.

Parameters:
direc - the direction of the door

Returns:
-1 on an error, 0 for opaque, 1 for transparent

See also:
modify_exit()


query_dynamic_enchant
float query_dynamic_enchant()

This method returns the current dynamic enchantment of the room.

Returns:
the theft handler of the room

See also:
query_enchant()


query_enchant
int query_enchant()

Returns the current enchantment level of the room. The enchanment level controls things like what happens when you flip coins and some special messages which give wizards some idea about magic levels.

Returns:
the current enchantment

See also:
set_enchant()


query_exit
int query_exit(string direc)

This method determines if there is an exit in the specified direction.

Parameters:
direc - the exit to test for

Returns:
1 if it exists, 0 if it does now


query_exit_callbacks
mixed * query_exit_callbacks()
query_exits
string * query_exits()

This returns the current array of exits.

Returns:
the exits array

See also:
add_exit(), remove_exit() and modify_exit()


query_gmcp_data
mapping query_gmcp_data(object player)

This can be masked by inheriting objects to send more or less GMCP data. @param player The player that the data is being sent to. @return The mapping of the GMCP data. @see gmcp
query_hidden_objects
object * query_hidden_objects()

This returns the current array of hidden objects. The hidden objects are used to allow things to not actually be in the room description but be able to be manipulated by commands.

Returns:
the array of hidden objects

See also:
add_hidden_object() and remove_hidden_object()


query_is_room
int query_is_room()

Returns 1 to indicate that this object is a room.

Returns:
1 to indicate that this is a room


query_item
object query_item()

This method returns the current item object.

Returns:
the current item object

See also:
add_item()


query_keep_room_loaded
int query_keep_room_loaded()

This method returns the status of the keep room loaded flag. If they flag is non-0 then the room with not be unloaded.

Returns:
the status of the keep room loaded flag


query_linker
object query_linker()

This method returns the current linker object.

Returns:
the linker object


query_long_exit
string query_long_exit()

This returns the long exit string. This is calculated when it is first needed by the calc_long_exit function.

Returns:
the long exit string

See also:
calc_long_exit() and long()


query_long_exit_mxp
string query_long_exit_mxp()

This returns the long exit string with mxp codeds added. This is calculated when it is first needed by the calc_long_exit function.

Returns:
the long exit string

See also:
calc_long_exit() and long()


query_look
string query_look(string direc)
query_look_func
mixed * query_look_func(string direc)
query_nice_relative
int query_nice_relative(string direc)

This method checks to see if the exit is a relative one.

Parameters:
direc - the direction to check

See also:
modify_exit()


query_night_items
class variable_item * query_night_items()

These are the items only visible at night.
query_night_long
string query_night_long()

This method returns the long description of the room at night. This is used to print out different strings for rooms during the day and during the night.

Returns:
the night long for the room.


query_not_replaceable
int query_not_replaceable()

This method checks to see if the program is replaceable.

Returns:
1 if the program is not replaceable

See also:
set_not_replaceable()


query_not_replaceable_inherit
int query_not_replaceable_inherit()

This method checks to see if the inherit is replaceable (that is, only setup() is replaceable, and not create()).

Returns:
1 if setup() must be present to be replaceable

See also:
set_not_replaceable()


query_notrack
int query_notrack()

This method returns the value of no_track flag associated with the room.

Parameters:

Returns:
the value of the no_track flag.

See also:
query_notrack()


query_random_event_categories
string * query_random_event_categories()
query_relative
int query_relative(string direc)

This method checks to see if the exit is a relative one.

Parameters:
direc - the direction to check

See also:
modify_exit()


query_resources
string * query_resources()
query_room_chats
mixed * query_room_chats()

Returns the current set of room chats managed by the chatter object.

Returns:
pointer to the mixed array of chat args

See also:
add_room_chats.c, remove_room_chats.c, room_chat.c and /std/room/basic/chatter .c

Example:
 ({ 120, 240, ({ "A frog gimbles the curtains.",
                 "A truly revolting smell drifts insidiously "
                 "from the rug." }) })

query_room_day_chats
mixed * query_room_day_chats()

This returns the set of chats visible only during the day.

Returns:
the chat array used during the day


query_room_default_chats
mixed * query_room_default_chats()

This returns the default set of chats, these are mixed with the night and day chats to generate the current set.

Returns:
the mixed set of chats


query_room_night_chats
mixed * query_room_night_chats()

This returns the set of chats visible only at night.

Returns:
the chat array used at night.


query_room_size
mixed query_room_size()

This method queries the size of the room. The default size of a room is 10x10x10. A room can be any rectangular size, this method will return an array of three elements if the room is a non-cube. If it returns a single number then the room is assumed to be cubic.

({ north-south size, east-west size, up-down size })

The sizes are all radii's so they are half the actual width of the room.

Returns:
the size of the room

See also:
set_room_size() and query_room_size_array()


query_room_size_array
int * query_room_size_array()

This method returns the size of the room as a three element array always.

({ north-south size, east-west size, up-down size })

The sizes are all radii's so they are half the actual width of the room.

Returns:
the size of the room as a three element array

See also:
query_room_size() and set_room_size()


query_short_exit_string
string query_short_exit_string()

This method returns the short exit string. The short exit string is the string used in 'brief' mode of a players look.

Returns:
the short exit string

See also:
calc_short_exit_string() and query_exit_string()


query_short_exit_string_mxp
string query_short_exit_string_mxp()

This method returns the short exit string, but with MXP codes. The short exit string is the string used in 'brief' mode of a players look.

Returns:
the short exit string with mxp

See also:
query_short_exit_string()


query_situation_changer
object query_situation_changer()

This method returns the current situation changer object.

Returns:
the situation changer object

See also:
add_situation(), automate_situation() and change_situation .c


query_size
int query_size(string direc)

This method returns the size of the exit. This is used to check to make sure that people can enter it.

Parameters:
direc - the direction of the exit to check

Returns:
the size of the exit

See also:
modify_exit()


query_terrain
object query_terrain()

This method returns the current terrain object.

Returns:
the terrain object

See also:
add_room_chat()


query_theft_handler
string query_theft_handler()

This method returns the current theft handler for the room.

Returns:
the theft handler of the room

See also:
set_theft_handler()


query_tracking
mixed * query_tracking()

This method returns the array of tracking data stored in this room.

Parameters:

Returns:
array of tracking data.

See also:
query_notrack(), set_notrack()


query_use_internal_objects
object * query_use_internal_objects()

This method returns all the current use internal objects available.

Returns:
the list of use internal objects here


query_visibility
int query_visibility()

This method returns the visibility in this room. The visibility should be a percentage which represents the percentage of the maximum visibility in the room.

Returns:
the visbility


query_zones
string * query_zones()

This method returns the set of move zones for this room. This is used by npcs to see which rooms they are allowed to move into.

See also:
add_zone() and /obj/monster->add_move_zone()


remove_alias
void remove_alias(mixed alias,
string name)

This method removes the exit aliases from the room. Aliases are convenient extra forms that can be attached to certain exits. In the above functions, the variable names is either a string or an array of strings and is, respectively, the alias or aliases for the direction passed in word. Since, sometimes, the same alias could be used for more than one exit, remove_alias() requires both alias(es) and direction in order to remove the correct alias(es).

Parameters:
names - the names to remove
word - what they were aliased to

See also:
add_alias() and query_aliases()

Example:
remove_exit( "board carriage" );
remove_alias( "board", "board carriage" );

remove_exit
int remove_exit(string direc)

This method removes the specified exit from the room.

See also:
add_exit() and modify_exit()


remove_exit_callback
int remove_exit_callback(int id)

This is used to remove an exit callback.

Parameters:
id - The id number of the callback to remove. This is returned by add_exit_callback.

Returns:
1 if successful.


remove_hidden_object
int remove_hidden_object(object thing)

This method removes a hidden object.

Parameters:
thing - the hidden object to remove

Returns:
1 on success, 0 on failure

See also:
add_hidden_object() and query_hidden_objects()


remove_item
int remove_item(mixed word)

This method will attempt to remove the item defined by the given string. This will remove everything associated with that item, verbs, patterns, everything.

Parameters:
word - the name of the item to remove

Returns:
1 if successful, 0 on a failure

See also:
add_item() and query_item()

Example:
add_item("frog", "Cute, green and sitting on a lilly pad.  Yes!\n");
...
remove_item("frog");

add_item(({ "big bad chicken", "clucker" }),
         "The big bad chicken sits and stares at you.\n");
...
remove_item("big bad chicken");

remove_room_chats
void remove_room_chats(string * dead_chats)

Removes chats from the set of room chats managed by this chatter object. If there are no chats left the chatter is destructed.

Parameters:
dead_chats - an array of chat strings to remove

See also:
add_room_chats.c, query_room_chats.c and /std/room/basic/chatter .c


remove_use_internal_object
void remove_use_internal_object(object thing)

This method removes an object whose interor bits want to export.

Parameters:
thing - the object to remove


remove_zone
void remove_zone(string zone)

This method removes a move zone from the current list of movement zones for the room. The move zones are used by npcs to see which rooms they are allowed to move into.

See also:
add_zone(), query_zones() and /obj/monster->add_move_zone()


reset_exits
void reset_exits()

This method removes all the current exits in the room.

See also:
add_exit(), remove_exit() and modify_exit()


room_chat
varargs void room_chat(mixed * args,
object chatobj)

This method sets up the room chats. Room chats are strings which are printed at (semi) random intervals in rooms. They are used to add atmosphere to a room. A chat will be picked at random from the array of chats with a frequency controlled by the times min and max. ie. one will be picked every n seconds where n varies between min and max seconds. Please don't make the values for min and max too small or the messages just become annoying!

The argument to the room_chat method is an array of the format:
({ int min, int max, ({ string *chats }) }). In place of a chat string you may use "#function_name" where function_name is a function that exists on the room object.

Repeated calls to this function overwrite the chats for the default chatter.

If this function is used in combination with the day/night chats then this sets the default chat items for the chatter. The frequency of chats will be taken from the day/night chats, but the messages from here will be merged into the day/night chats.

Parameters:
args - the room chat arguments
chatobj - chatter object in case the default offends you. This argument may be omitted in which case you get /std/room/basic/item_chatter.c

See also:
stop_room_chat(), add_room_chats(), remove_room_chats() and set_chat_min_max()

Example:
room_chat(({ 120, 240, ({ "A string frog wanders past.",
                          "#make_soggy_bread",
                          "A trully revolting smell drifts insidiously "
                               "from the bakery." }) }) );

room_day_chat
void room_day_chat(mixed * args)

This method sets up chats for when the room is in the day cycle.

Parameters:
args - the chatter arguements

See also:
room_night_chat() and /std/room->room_chat()


room_identifier
string room_identifier()
room_night_chat
void room_night_chat(mixed * args)

This method sets up chats for when the room is in the night cycle.

Parameters:
args - the chatter arguements

See also:
room_day_chat() and /std/room->room_chat()


search_result
varargs int search_result(class obj_match match)

This is called if no searched-for object could handle the search, so that you can still get things done by overriding.

Parameters:
match - The obj_match class containing the results of the search

Returns:
Should return the same as a normal do_search: Success, with tell_object()s to reflect this: 1 Failure, using notify_fail(): 0 Standard failure message: -1


send_room_info
void send_room_info(object player,
string map)
set_background_enchant
void set_background_enchant(int number)

This method sets the background enchantment of the room.

Returns:
the theft handler of the room

See also:
set_enchant()


set_bright_mess
void set_bright_mess(string word)

This method sets the bright message associated with the room.

Parameters:
word - the new bright message

See also:
query_bright_mess() and long()


set_calculated_co_ord
void set_calculated_co_ord(int * new_co_ord)

This method should be used for setting pre-calculated co-ordinates. Things like walls and the terrain handler should use this function for setting their co-ordinates.

Parameters:
new_co_ord - the new co-ordinates


set_chat_min_max
void set_chat_min_max(int min,
int max)

Allows the chat interval to be changed.

Parameters:
min - minimum interval between chats (seconds)
max - maximum interval between chats (seconds)


set_co_ord
void set_co_ord(int * new_co_ord)

Sets the current co-ordinates of the room. The co-ordinates are 3d, ({ x, y, z }). So an array with three elements.

Parameters:
new_co_ord - the new co-ordinates for the room.

See also:
query_co_ord() and query_co_ord_calculated()


set_cover_percentage
void set_cover_percentage(int percentage)

This is the code to use to determine how busy the room is. This is used by the follow code to determine difficulty in being followed. 100% means very busy and very hard to follow, 0% means no one else on the street.

Parameters:
percentage - the busy percentage


set_dark_mess
void set_dark_mess(string word)

This method sets the dark message associated with the room.

Parameters:
word - the new dark message

See also:
query_dark_mess() and long()


set_day_long
void set_day_long(mixed str)

This method sets the long description to display during the day time.

Parameters:
str - the new day long description

See also:
query_day_long() and set_night_long()


set_default_position
void set_default_position(mixed stuff)

This method sets the default position for the room. Se the set default position in the living code for a more complete example of this.

Parameters:
pos - the default position

See also:
/ostd/living/living->set_default_position()


set_dynamic_enchant
void set_dynamic_enchant(float number)

This method sets the current dynamic enchantment of the room.

Returns:
the theft handler of the room

See also:
set_enchant()


set_enchant
int set_enchant(int number)

Sets the current enchantment level of the room. The enchanment level controls things like what happens when you flip coins and some special messages which give wizards some idea about magic levels. When called from the room itself, it sets a background level of enchantment that don't decay, when called from another object it sets the current enchantment which then decays towards the background level.

Parameters:
number - the new enchantment level to set

See also:
query_enchant()


set_faction_exit
void set_faction_exit(mixed dirs,
string faction,
int rank)
set_is_day
void set_is_day(int d)
set_keep_room_loaded
void set_keep_room_loaded(int flag)

This method sets the flag that enables or disables the room being cleaned up. If they flag is set to 1, then room is never cleaned up.

Parameters:
flag - the room being cleaned up flag

See also:
query_keep_room_loaded()


set_linker
varargs int set_linker(string * rooms,
string d_prep,
string s_prep,
string r_name)

This method sets up a linkage between the current room and othert rooms. The linkage broadcasts things like says and enter/exit messages between the rooms.

The dynamic preposition is used when someone enters/exits the room, the static preposition is used when someone says something in the room. The dynamic proposition defaults to "into" and the static preposition defaults to "in".

Parameters:
rooms - the rooms to link together
d_prep - the dynamic preposition
s_prep - the static preposition
r_name - the name of the room/area

Example:
set_linker( ({ PATH + "room1", PATH + "room2", }),
            "into", "in", "fluffy square");

set_night_long
void set_night_long(mixed str)

This method sets up the night long for the room. This will be the long description displayed at night in the room.

Parameters:
str - the new night long description

See also:
set_day_long() and query_night_long()


set_not_replaceable
void set_not_replaceable(int replace)

This method sets a property to make the program replaceable. A program will only be replaced if there is only a setup() or create() function in " the room. A reset() will stop the room from being replaced, and in fact any other function existing in there will stop it from being replaced as well.

Parameters:
replace - 1 to make the room not replacable

See also:
query_not_replaceable()


set_not_replaceable_inherit
void set_not_replaceable_inherit(int replace)

This method sets a property to make the program replaceable only if it contains a setup() and no other functions. It is intended to be used in inherits that define add_item()s, chats, or other things in create() that would otherwise be eaten by replaceing. Setting this makes it so that setup() must be present for replacement to take place. In other words, with this set, room inherits, which typically do not have a setup(), will not get replaced and lose the contents of create(), as is possible otherwise (since efun::replaceable() ignores create() as well as setup())

Parameters:
replace - 1 to make the inherit not replacable, and require setup() to be present for replaceing.

See also:
set_not_replaceable() and query_not_replaceable_inherit()


set_notrack
int set_notrack(int set)

This method turns the no_track flag on/off for the room.

Parameters:
set - 1 for making the room notrack, 0 for letting the room store data (default).

Returns:
the value set with this method.

See also:
query_notrack()


set_random_event_categories
void set_random_event_categories(mixed val)
set_room_size
void set_room_size(mixed number)

This method sets the rooms principle radii. If the parameter isa single number then the room is assumed to be cubic and dimension applies in all directions. If the input is a three element array then the elements apply to all the directions.
({ north-south size, east-west size, up-down size })

The sizes are all radii's so they are half the actual width of the room.

Parameters:
number - the new size of the room

See also:
query_room_size() and query_room_size_array()


set_situation_changer
varargs object set_situation_changer(mixed changer)

Set a situation changer (in place of the default). If there is no argument you get the default: /std/room/basic/situation_changer. You call this before any other situation related functions. If you create your own changer it should inherit one of /std/room/basic/situation_changer or /std/room/basic/multiroom_situation_changer or otherwsie provide the functionality of those objects.

Parameters:
changer - optional parameter specifying either a path for the changer object or an existing object to use.

See also:
add_situation.c, start_situation.c, automate_situation.c and change_situation.c

Example:
If you have a special changer object used for more than one room
then in setup for those rooms you should have:
set_situation_changer(load_object("/w/me/mychanger"));
Where /w/me/mychanger inherits
/std/room/basic/multiroom_situation_changer

set_terrain
int set_terrain(string terrain_name)
set_theft_handler
void set_theft_handler(string word)

This method sets the current theft handler for the room.

Parameters:
word - the new theft handler for the room

See also:
query_theft_handler()


set_zone
void set_zone(string zone)

This method adds a move zone into the current list of zones. This method is deprecated, add_zone should be used instead.

See also:
add_zone() and query_zones()


shutdown_all_situations
void shutdown_all_situations()

Shuts down all current and pending situations. It also turns off the automated situation manager so no more are added. It does not destruct this object so all the add_situations are still loaded and make be recommenced with automate_situation. dest_me is the appropriate call to permanently remove all situations. The call is passed to the situation changer object. If none exists then nothing happens. The situation changer is created when an add_situation call is performed.

See also:
add_situation.c, automate_situation.c and change_situation .c


shutdown_situation
void shutdown_situation(int call,
mixed label)

Shuts down a situation or set of situations initiated with change_situation based on the call_out handle returned by the call to change_situation.

Parameters:
callout - call_out handle. If 0 then the last known handle is used.
label - label or array of labels of situations to clean up with end_situation
the_room - the room

See also:
automate_situation.c and change_situation .c


start_situation
varargs void start_situation(mixed label,
int do_start_mess)

Starts a situation previously added to the room. These situations can be invoked manually with start_situation or automatically via automate_situation. The call is passed to the situation changer object. If there isn't one nothing happens.

Parameters:
label - label for the situation as passed to add_situation
do_start_mess - 0 to supress the start_mess string This is to fake it that a situation has been going for a while when really you just loaded it.

See also:
add_situation.c, end_situation.c, automate_situation.c and change_situation .c


stop_room_chats
void stop_room_chats()

This method stops all the room chats for the room. It also removes all the room chats, so if you want to have any more you must add them again.

See also:
room_chat()


track_trigger
void track_trigger(object ob,
string message,
object to)
trigger_exit_callbacks
void trigger_exit_callbacks(object player,
string direction,
string destination,
string arrive,
string leave,
int entering)

This is called by the room handler if it detects that this room has exit callbacks.

Parameters:
player - The player/NPC using the exit.
direction - The exit name the player/NPC used.
destination - The path name of the destination room.
arrive - The message printed to the destination room.
arrive - The message printed to the departure room.
entering - 1 if the player/NPC is entering this room, 0 if the player/NPC is leaving it.


Classes

These are nice data types for dealing with... Data!