[Package Index | Mudlib Index | Effect Index]
See also:
/std/room/outside.c
Written by Pinkfish
void add_alias(mixed alias, string name)
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" );
varargs int add_day_item(mixed shorts, mixed desc, mixed no_plural)
int add_enchant(int number)
int add_exit(string direc, mixed dest, string type)
The types are controlled by /obj/handlers/room_handler.c and the current types and what this all means are:
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.
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");
int add_exit_callback(string func_name, object ob, mixed * args ...)
int add_hidden_object(object thing)
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.
#includesign = 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());
varargs int add_item(mixed shorts, mixed desc, int no_plural)
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 "
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.
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,
Round and round, and round again
({ 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.
({ 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.
The argument to the room_chat method is an array of the format:
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.
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".
The sizes are all radii's so they are half the actual width of the room.
shorts - the short description of the item
desc - the description of the item
no_plural - do not automaticaly add a plural for the item
1 if successfully added, 0 if not
query_item(), remove_item() and modify_item()
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 :),
"
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.
/std/room->add_item() and add_day_item()
void add_resource(string resource)
void add_room_chats(string * new_chats)
Adds more chats to the existing set of room chats
managed by this chatter object.
new_chats - an array of new chat strings
remove_room_chats.c, query_room_chats.c and /std/room/basic/chatter
.c
int add_room_day_chat(string str)
int add_room_night_chat(string str)
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.
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
the object for the sign
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.
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.
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#include
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) );
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.
thing - the thing whose inventory bits are to be exported
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.
set_zone(), query_zones() and /obj/monster->add_move_zone()
varargs int attack_speed(object attacker)
This method sets the default attack speed for the room.
This defaults to 15.
the default attack speed
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).
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<
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".
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#include
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.
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.
query_co_ord() and modify_exit()
void calc_exits()
This method calculates all the exit strings to be used for this room.
void calc_long_exit()
This method creates the long exit description used in the room long
descriptions.
query_long_exit()
string calc_short_exit_string()
This method returns the exit string used when in brief mode.
the brief exit string
calc_exit_string()
string calc_short_exit_string_mxp()
This method returns the exit string used when in brief mode, but with MXP.
the brief exit string with mxp
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.
1 if it can be used, 0 if not
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.
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
handle useful for halting the changes later. It is typically
a small positive integer.
shutdown_situation.c, add_situation.c, automate_situation.c and goto learning search situation for working examples.chandle=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" }) );
void check_day_night_switch(int old)
string clear_frame_map()
int do_exits()
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.
label - label for the situation
add_situation.c, start_situation.c, automate_situation.c and change_situation
.c
string expand_alias(string word)
int faction_check(string str,
object ob,
string special_mess)
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.
words - the words to match on
looker - the person doing the pmacthing
the array of objects to match on
string flesh_map(string map)
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.
set_co_ord(), calc_co_ord(), query_co_ord() and query_co_ord_calculated()
class faction_exit * get_faction_exits(string direction)
int has_exit_callbacks()
int is_allowed_position(string poss)
This method tells us if the passed i nposition is
allowed in this type of room.
poss - the position to check
string lookmap(int kind)
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.
xval - integer to use to make a seed (eg. x coordinate)
yval - integer to use to make a seed (eg. y coordinate)
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.
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.
word - the name of the item to change
new_desc - the bits of the item to change
remove_item() and add_item()
string * query_aliases()
This method returns the current exit aliases for the room.
the exit aliases of the room
add_alias() and remove_alias()
int query_background_enchant()
This method returns the background enchantment of the room.
the theft handler of the room
query_enchant()
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!".
the message to print when it is too bright
query_dark_mess(), long() and set_bright_mess()
object query_chatter()
This method returns the current chatter object.
the chatter object
add_room_chat()
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.
the current co-ordinates
set_co_ord()
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.
1 if it is calculated, 0 if it is not
query_co_ord() and set_co_ord()
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.
the busy percentage
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?".
the dark message
set_dark_mess(), long() and query_bright_mess()
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.
1 for day, 0 for night.
void init() {
::init();
if(query_day()) {
setup_daytime_stuff();
} else {
setup_nighttime_stuff();
}
}
class variable_item * query_day_items()
These are the items only visible during the day.
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.
the night long for the room.
varargs mixed query_default_position()
This method returns the current default position asigned to this
room.
the current default position
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, ... })
thing - used to get the relative directions according to thing
the array of direction, destination pairs
query_dest_other() and add_exit()
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.
modify_exit() and query_dest_dir()
varargs string query_destination(string exit,
object mover)
This method returns the destination room for an exit.
exit - the exit name
the path of the destination room, or ROOM_VOID on error
query_dest_dir()#include
varargs string * query_direc(object thing)
This method just returns all the directions available to leave from
the room.
Working slowly down under.
Sliding up the sides
Eating a meal, fresh cream and syrup.
Grining micheviously
One tongue at play
Firm and hard, fresh strawberries today.
thing - used to get the relative directions according to thing
the array of directions
query_dest_other() and add_exit()
varargs string query_door(mixed dest,
string name)
This method determines if the specified exit is a door or not.
dest - the destination to check for being a door
name - the name of the door
0 if it is not a door, the direction if it is
query_exit() and add_exit()
varargs mixed query_door_control(string direc,
string name)
This returns the information about the door in the specified direction.
direc - the direction to query the door in
name - the name of the exit
the door control information
modify_exit()
int query_door_locked(string direc)
This method checks to see if the door is locked.
direc - the direction of the door
-1 on an error, 0 for unlocked, 1 for locked
modify_exit()
int query_door_open(string direc)
This method checks to see if the door is open.
direc - the direction of the door
-1 on an error, 0 for closed, 1 for open
modify_exit()
int query_door_transparent(string direc)
This method checks to see if the door is transparent.
direc - the direction of the door
-1 on an error, 0 for opaque, 1 for transparent
modify_exit()
float query_dynamic_enchant()
This method returns the current dynamic enchantment of the room.
the theft handler of the room
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.
the current enchantment
set_enchant()
int query_exit(string direc)
This method determines if there is an exit in the specified direction.
direc - the exit to test for
1 if it exists, 0 if it does now
mixed * query_exit_callbacks()
string * query_exits()
This returns the current array of exits.
the exits array
add_exit(), remove_exit() and modify_exit()
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
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.
the array of hidden objects
add_hidden_object() and remove_hidden_object()
int query_is_room()
Returns 1 to indicate that this object is a room.
1 to indicate that this is a room
object query_item()
This method returns the current item object.
the current item object
add_item()
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.
the status of the keep room loaded flag
object query_linker()
This method returns the current linker object.
the linker object
string query_long_exit()
This returns the long exit string. This is calculated when it is
first needed by the calc_long_exit function.
the long exit string
calc_long_exit() and long()
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.
the long exit string
calc_long_exit() and long()
string query_look(string direc)
mixed * query_look_func(string direc)
int query_nice_relative(string direc)
This method checks to see if the exit is a relative one.
direc - the direction to check
modify_exit()
class variable_item * query_night_items()
These are the items only visible at night.
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.
the night long for the room.
int query_not_replaceable()
This method checks to see if the program is replaceable.
1 if the program is not replaceable
set_not_replaceable()
int query_not_replaceable_inherit()
This method checks to see if the inherit is replaceable (that is, only
setup() is replaceable, and not create()).
1 if setup() must be present to be replaceable
set_not_replaceable()
int query_notrack()
This method returns the value of no_track flag associated with the room.
the value of the no_track flag.
query_notrack()
string * query_random_event_categories()
int query_relative(string direc)
This method checks to see if the exit is a relative one.
direc - the direction to check
modify_exit()
string * query_resources()
mixed * query_room_chats()
Returns the current set of room chats
managed by the chatter object.
pointer to the mixed array of chat args
add_room_chats.c, remove_room_chats.c, room_chat.c and /std/room/basic/chatter
.c ({ 120, 240, ({ "A frog gimbles the curtains.",
"A truly revolting smell drifts insidiously "
"from the rug." }) })
mixed * query_room_day_chats()
This returns the set of chats visible only during the day.
the chat array used during the day
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.
the mixed set of chats
mixed * query_room_night_chats()
This returns the set of chats visible only at night.
the chat array used at night.
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.
the size of the room
set_room_size() and query_room_size_array()
int * query_room_size_array()
This method returns the size of the room as a three element array always.
the size of the room as a three element array
query_room_size() and set_room_size()
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.
the short exit string
calc_short_exit_string() and query_exit_string()
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.
the short exit string with mxp
query_short_exit_string()
object query_situation_changer()
This method returns the current situation changer object.
the situation changer object
add_situation(), automate_situation() and change_situation
.c
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.
direc - the direction of the exit to check
the size of the exit
modify_exit()
object query_terrain()
This method returns the current terrain object.
the terrain object
add_room_chat()
string query_theft_handler()
This method returns the current theft handler for the room.
the theft handler of the room
set_theft_handler()
mixed * query_tracking()
This method returns the array of tracking data stored in this room.
array of tracking data.
query_notrack(), set_notrack()
object * query_use_internal_objects()
This method returns all the current use internal objects available.
the list of use internal objects here
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.
the visbility
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.
add_zone() and /obj/monster->add_move_zone()
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).
names - the names to remove
word - what they were aliased to
add_alias() and query_aliases()remove_exit( "board carriage" );
remove_alias( "board", "board carriage" );
int remove_exit(string direc)
This method removes the specified exit from the room.
add_exit() and modify_exit()
int remove_exit_callback(int id)
This is used to remove an exit callback.
id - The id number of the callback to remove. This is returned by
add_exit_callback.
1 if successful.
int remove_hidden_object(object thing)
This method removes a hidden object.
thing - the hidden object to remove
1 on success, 0 on failure
add_hidden_object() and query_hidden_objects()
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.
word - the name of the item to remove
1 if successful, 0 on a failure
add_item() and query_item()
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");
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.
dead_chats - an array of chat strings to remove
add_room_chats.c, query_room_chats.c and /std/room/basic/chatter
.c
void remove_use_internal_object(object thing)
This method removes an object whose interor bits want to export.
thing - the object to remove
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.
add_zone(), query_zones() and /obj/monster->add_move_zone()
void reset_exits()
This method removes all the current exits in the room.
add_exit(), remove_exit() and modify_exit()
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!
({ 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.
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
stop_room_chat(), add_room_chats(), remove_room_chats() and set_chat_min_max()
room_chat(({ 120, 240, ({ "A string frog wanders past.",
"#make_soggy_bread",
"A trully revolting smell drifts insidiously "
"from the bakery." }) }) );
void room_day_chat(mixed * args)
This method sets up chats for when the room is in the day cycle.
args - the chatter arguements
room_night_chat() and /std/room->room_chat()
string room_identifier()
void room_night_chat(mixed * args)
This method sets up chats for when the room is in the night cycle.
args - the chatter arguements
room_day_chat() and /std/room->room_chat()
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.
match - The obj_match class containing the results of the search
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
void send_room_info(object player,
string map)
void set_background_enchant(int number)
This method sets the background enchantment of the room.
the theft handler of the room
set_enchant()
void set_bright_mess(string word)
This method sets the bright message associated with the room.
word - the new bright message
query_bright_mess() and long()
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.
new_co_ord - the new co-ordinates
void set_chat_min_max(int min,
int max)
Allows the chat interval to be changed.
min - minimum interval between chats (seconds)
max - maximum interval between chats (seconds)
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.
new_co_ord - the new co-ordinates for the room.
query_co_ord() and query_co_ord_calculated()
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.
percentage - the busy percentage
void set_dark_mess(string word)
This method sets the dark message associated with the room.
word - the new dark message
query_dark_mess() and long()
void set_day_long(mixed str)
This method sets the long description to display during the day time.
str - the new day long description
query_day_long() and set_night_long()
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.
pos - the default position
/ostd/living/living->set_default_position()
void set_dynamic_enchant(float number)
This method sets the current dynamic enchantment of the room.
the theft handler of the room
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.
number - the new enchantment level to set
query_enchant()
void set_faction_exit(mixed dirs,
string faction,
int rank)
void set_is_day(int d)
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.
flag - the room being cleaned up flag
query_keep_room_loaded()
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.
rooms - the rooms to link together
d_prep - the dynamic preposition
s_prep - the static preposition
r_name - the name of the room/area
set_linker( ({ PATH + "room1", PATH + "room2", }),
"into", "in", "fluffy square");
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.
str - the new night long description
set_day_long() and query_night_long()
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.
replace - 1 to make the room not replacable
query_not_replaceable()
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())
replace - 1 to make the inherit not replacable, and require setup() to
be present for replaceing.
set_not_replaceable() and query_not_replaceable_inherit()
int set_notrack(int set)
This method turns the no_track flag on/off for the room.
set - 1 for making the room notrack, 0 for letting the room store data (default).
the value set with this method.
query_notrack()
void set_random_event_categories(mixed val)
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 })
number - the new size of the room
query_room_size() and query_room_size_array()
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.
changer - optional parameter specifying either a path for
the changer object or an existing object to use.
add_situation.c, start_situation.c, automate_situation.c and change_situation.cIf 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
int set_terrain(string terrain_name)
void set_theft_handler(string word)
This method sets the current theft handler for the room.
word - the new theft handler for the room
query_theft_handler()
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.
add_zone() and query_zones()
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.
add_situation.c, automate_situation.c and change_situation
.c
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.
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
automate_situation.c and change_situation
.c
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.
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.
add_situation.c, end_situation.c, automate_situation.c and change_situation
.c
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.
room_chat()
void track_trigger(object ob,
string message,
object to)
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.
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.
class variable_item { int item_id; int day_night; mixed shorts; mixed desc; int no_plural; }