NAME basic_room.c - a simple standard room. INHERITS basic.c (read basic.doc for further details) SETUP FUNCTIONS add_exit remove_exit QUERY FUNCTIONS query_exits query_inorout (compatibility reasons) realm (compatibility reasons) query_dest_dir (compatibiltiy reasons) SPECIAL PROPERTIES indoors: Specifies that this room is indoors outdoors: Specifies that this room is outdoors realm: Specifies the realm of the room (if any) no_clean_up: Prevent that this room is destructed in clean_up no_obvious_exits: Do not show obvious exits in long() sort_exits: Sort the exits. OTHER SPECIALS If things in the rooms inventory has the function query_in_long_short() return a string, this string will be showed just before the obvious exits in the room. Note that the return value of query_in_long_short() is cached, so if you want to remove/add/change any of these descriptions you should call compute_extra_long(1) in the room to flush the cache. ======================================================================= NAME add_exit - add an exit to this room SYNTAX void add_exit(string directon, mixed whereto, [string leave_message,] [string check_function]); DESCRIPTION Add an exit in the direction 'direction' leading to the room 'whereto'. Whereto will be passed to eval before any action is taken, with the "move" or "query" as optional_argument. Depending on wether someone is moving or just wants to know the directions. If the eval returns zero, nothing happens and 'What?' is printed. If it returns 1, nothing happens and nothing is printed, all other values are supposed to be the destination to where the player should be moved to. Normally, whereto will simply be a filename, relative to the directory the room is located in. The optional third argument is used as an exit message if present, ie. instead of north in the string 'Foo leaves north.' It is sent to eval in the same way as 'whereto', but eval is always suppose to return a string. The optional fourth argument is a function to call to see if the exit is blocked. If this function returns 1, the player will not be moved. Note that this function might be given as a plain string for compatibility reasons, but you may also give it in the standard eval notation, ie. "@check_south()" or similar. EXAMPLE add_exit("north","~profezzorn/wherever"); add_exit("south","~profezzorn/wherever2","southwards","check_south"); ======================================================================= NAME remove_exit - remove an exit SYNTAX void remove_exit(string direction); DESCRIPTION Remove the exit leading in the direction 'direction'. ======================================================================= NAME query_exits - return a mapping describing exits in this room. SYNTAX mapping query_exits(); DESCRIPTION This function is similar to query_dest_dir, but returns a mapping of the form ([direction: destination, ... ]) ======================================================================= NAME properties - what special properties there are DESCRIPTION indoors If set, this marks the room as indoors. outdoors If set, this marks the room as outdoors. realm If set, marks this room as part of a special realm. Teleport spells will (must) only work of both start and end locations are within the same realm. no_clean_up Prevent this room from being detsructed in clean_up. no_obvious_exits Do not show obvious exits in the long description. sort_exits If set, the exits in short and long are sorted in a some way. If the property is set to a simple integer, a default order will be applied. In this, the order is n, s, e, w, ne, nw, se, sw, u, d, enter, in, exit and out. Any other exits (if any) are sorted alphabetically. You can get a call to your own sort function by setting the property to the usual eval syntax, either "@func()" or "@path->func()". In the former case, the function 'func' is called in the room object or, if the propery __remote is set, in the remote object. For the latter form, the function 'func' is called in the object described by 'path' (upon which expand_file_name is performed). In all cases will the _second_ argument to the function be a array with all the exit directions. The function must return a re-arrangement of this array. =======================================================================
Help topics available:
basic_room.doc | room.doc | water_room.doc |
You are guest number 95 since December 2019.
This file was last modified: June 2000.