[Package Index | Mudlib Index | Effect Index]

File /std/room/inherit/terrain_map/handler_base.c

Base inherit for terrain map handler.

When creating a new terrain map, inherit from this file to make your area handler.

When inheriting from this file, it is essential that the functions query_map_file() and setup_handler() be overriden to return the full pathname of the area map, and to set up type mappings.

To inherit from this file, use the following lines:

See also:
terrain_map_inside.c, terrain_map_outside.c, terrain_map_intro.c and terrain_map_example.c

Written by Dek

Started Thurs April 12 2001 Too Damn Early BST

Inherits

This class inherits the following classes /std/room/inherit/terrain_map/distance_str.c

Includes

This class includes the following files /include/weather.h, /include/terrain_map.h and /include/dirs.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

add_exit_at
varargs void add_exit_at(int x,
                         int y,
                         string direc,
                         string dest,
                         string type,
                         mixed modifiers)

This method is used to add a standard exit to a specified location in a terrain map. The chief use is to insert exits to standard rooms or other terrain maps. This method is deprecated. Use add_z_exit_at() instead.

Parameters:
x - the x coordinate of the room (internal coordinate system)
y - the y coordinate of the room (internal coordinate system)
direc - the direction of the exit (as in add_exit)
dest - the path of the exit's destination (as in add_exit)
type - the type of exit (as in add_exit)
modifiers - an optional array of exit modifiers (as in modify_exit)

See also:
add_room_type.c, add_road_type.c, add_obstacle_type.c, add_exit.c and modify_exit .c

Example:
   add_exit_at(8, 0, "south", PEARWOOD + "stream_entrance", "road",
                      ({ "move mess", "You wade along the stream bed.\n",
                         "enter mess", "$N wades in from the north.",
                         "exit mess", "$N wades off to the $T." }));

add_feature
void add_feature(string title,
                 int x,
                 int y,
                 int width,
                 int height,
                 int range,
                 string * descs,
                 mixed items,
                 mixed item_desc,
                 string * night_descs,
                 mixed night_items)

This method is called to add a new 'feature' to a terrain map. Features have no real existance, but add atmosphere to a whole area, by being visible across a large number of locations. You define location, size, item desc, and add an array of 'longs' sorted by distance, plus the usual item descriptions. Any occurrences of $D in the longs array will be replaced by the direction in which the feature lies.

Parameters:
title - the name of the feature
x - the x coordinate of the room (internal coordinate system)
y - the y coordinate of the room (internal coordinate system)
width - the width of the feature
height - the height of the feature
range - the distance (number of rooms) it can be seen for
descs - array of descriptions to be shown at different ranges. These are divided equally along the total range
items - add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding
night_descs - the night description array
night_items - the descriptions for the items at night

See also:
add_road_type.c, add_obstacle_type.c, set_feature_chats.c, modify_feature.c and add_item .c

Example:
  add_feature("northmountain", 3, 0, 5, 1, 7,
           ({ "A huge snowy mountain towers over you to the $D.",
              "A huge snowy mountain looms to the $D.",
              "A fair way off to the $D, you can see a huge snowy mountain.",
              "A long way $Dwards, you glimpse the snowy peak of a "
              "mountain." }),
              "mountain", "From here, it looks quite astoundingly huge.",
           ({ "A huge black bulk obscures the sky to the $D.",
              "A huge black bulk covers the horizon to the $D.",
              "A black lump obscures the horizon to the $D",
              "" }),
              "The dark black silloette looks like a mountain.");

add_feature_ob
void add_feature_ob(string title,
                    object feature)

This method is called to add a new 'feature' to a terrain map. Features have no real existance, but add atmosphere to a whole area, by being visible across a large number of locations. You define location, size, item desc, and add an array of 'longs' sorted by distance, plus the usual item descriptions. Any occurrences of $D in the longs array will be replaced by the direction in which the feature lies.

Parameters:
title - the name of the feature
region - the region object to use in calculating the feature
range - the distance (number of rooms) it can be seen for
descs - array of descriptions to be shown at different ranges. These are divided equally along the total range
items - add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding
whole_sentance - use a whole sentance for the descriptions or wrap them up into fragments

See also:
add_road_type.c, add_obstacle_type.c, set_feature_chats.c, modify_feature.c and add_item .c

Example:
  region = clone_object(TERRAIN_MAP_REGION_POLYGON);
  region->add_vertex(12, 13);
  region->add_vertex(14,15);
  region->add_vertex(17,18);
  add_feature_region("northmountain", region, 7,
           ({ "A huge snowy mountain towers over you to the $D.",
              "A huge snowy mountain looms to the $D.",
              "A fair way off to the $D, you can see a huge snowy mountain.",
              "A long way $Dwards, you glimpse the snowy peak of a "
              "mountain." }),
              "mountain", "From here, it looks quite astoundingly huge.",
           ({ }), 0 );

add_feature_region
void add_feature_region(string title,
                        object region,
                        int range,
                        string * descs,
                        mixed items,
                        mixed item_desc,
                        string * night_descs,
                        mixed night_items,
                        int whole_sentance)

This method is called to add a new 'feature' to a terrain map. Features have no real existance, but add atmosphere to a whole area, by being visible across a large number of locations. You define location, size, item desc, and add an array of 'longs' sorted by distance, plus the usual item descriptions. Any occurrences of $D in the longs array will be replaced by the direction in which the feature lies.

Parameters:
title - the name of the feature
region - the region object to use in calculating the feature
range - the distance (number of rooms) it can be seen for
descs - array of descriptions to be shown at different ranges. These are divided equally along the total range
items - add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding
whole_sentance - use a whole sentance for the descriptions or wrap them up into fragments

See also:
add_road_type.c, add_obstacle_type.c, set_feature_chats.c, modify_feature.c and add_item .c

Example:
  region = clone_object(TERRAIN_MAP_REGION_POLYGON);
  region->add_vertex(12, 13);
  region->add_vertex(14,15);
  region->add_vertex(17,18);
  add_feature_region("northmountain", region, 7,
           ({ "A huge snowy mountain towers over you to the $D.",
              "A huge snowy mountain looms to the $D.",
              "A fair way off to the $D, you can see a huge snowy mountain.",
              "A long way $Dwards, you glimpse the snowy peak of a "
              "mountain." }),
              "mountain", "From here, it looks quite astoundingly huge.",
           ({ }), 0 );

add_feature_sentance
void add_feature_sentance(string title,
                          int x,
                          int y,
                          int width,
                          int height,
                          int range,
                          string * descs,
                          mixed items,
                          mixed item_desc,
                          string * night_descs,
                          mixed night_items)

This method is called to add a new 'feature' to a terrain map. Features have no real existance, but add atmosphere to a whole area, by being visible across a large number of locations. This method is different to the normal add_feature in that the system will try and construct a sentance from the features instead of once sentance per feature. You define location, size, item desc, and add an array of 'longs' sorted by distance, plus the usual item descriptions. Any occurrences of $D in the longs array will be replaced by the direction in which the feature lies.

Parameters:
title - the name of the feature
x - the x coordinate of the room (internal coordinate system)
y - the y coordinate of the room (internal coordinate system)
width - the width of the feature
height - the height of the feature
range - the distance (number of rooms) it can be seen for
descs - array of descriptions to be shown at different ranges.
items - add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding These are divided equally along the total range

See also:
add_road_type.c, add_obstacle_type.c, set_feature_chats.c, modify_feature.c and add_item .c

Example:
  add_feature_sentance("northmountain", 3, 0, 5, 1, 7,
           ({ "a huge snowy mountain towers over you to the $D",
              "a huge snowy mountain looms to the $D",
              "a fair way off to the $D, you can see a huge snowy mountain",
              "a long way $Dwards, you glimpse the snowy peak of a "
              "mountain" }),
              "mountain", "From here, it looks quite astoundingly huge." );

add_obstacle_type
varargs void add_obstacle_type(string type,
                               string description,
                               mixed items,
                               mixed item_desc,
                               string room_desc)

This method is used to add an 'obstacle' to an area map. An obstacle is effectively an area on the map which cannot be entered, and can be seen from adjacent locations. Any occurences of $D in the description will be replaced with the direction(s) in which the obstacle can be seen. An add_item is automatically performed to allow for consistency.

Parameters:
type - the ASCII type used on the map to denote the obstacle
description - the description of the obstacle, as seen from neighbouring rooms
items - a string, or array of strings giving the corresponding add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding
items - add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding item desc
room_desc - allows a description for the obstacle in the key

See also:
add_room_type.c, add_road_type.c, set_external_chats.c and add_item .c

Example:
  add_obstacle("*", "Thick green bushes block your way to the $D.",
                     ({ "bush", "bushes" }), "Thick and green.",
                     "Thick bushes");

add_random_chat
void add_random_chat(string types,
                     string * chats)

This method is to add to the list of random chats that can be added to specific room types. A specific random sequence is used so that the randoms won't vary over time.

Parameters:
types - the string of ASCII character type(s) that this desc could apply to
chats - an array of chats to add. Usual add_chat format.

See also:
set_random_desc_limit.c, set_random_chat_limit.c and add_random_chat .c


add_random_desc
void add_random_desc(string types,
                     string description,
                     mixed items,
                     mixed item_desc)

This method is to add to the list of random descriptions that can be added to specific room types. A specific random sequence is used so that the randoms won't vary over time.

Parameters:
types - the string of ASCII character type(s) that this desc could apply to
items - add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding item desc

See also:
set_random_desc_limit.c, set_random_chat_limit.c, add_random_chat.c and add_item .c


add_road_special_type
varargs void add_road_special_type(string type,
                                   string base_path,
                                   int size,
                                   int road_skip,
                                   int height,
                                   string room_desc,
                                   string description,
                                   mixed items,
                                   mixed item_desc,
                                   mapping height_rooms)

This method is used to add a standard road type to the terrain map, mapped to an ASCII character as used in the ASCII room map. A road is a terrain map room which can be seen from adjacent locations. The handler uses 'room_desc' to add an entry to the room description, describing where the road goes. 'description' is added to the descriptions of adjacent locations, to enable the road to be seen. In 'room_desc' and 'description', $D will be expanded to the relevant directions. A skipped room is one in which every nth room in the terrain will be skipped unless it has something interesting in it.

Parameters:
type - the ASCII type used on the map to denote the room
base_path - the full pathname of the source file for the room
size - the number of rooms in each clump to skip over
road_skip - if this is 1 then the skip type is a 'road skip', this will assume the path is one wide and try to follow around curves
height - the height of the room
room_desc - the 'continuation' description, which added to the room description to show where the road leads
description - the 'adjacent' description, which is seen from adjacent locations.
items - add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding item desc
height_rooms - is a mapping containing what rooms to use at different height levels

See also:
add_room_type.c, add_road_type.c, set_external_chats.c and add_item .c

Example:
   add_road_type("+", ROOMS + "path", "The dusty path leads $D.",
                 "There is a dusty path to the $D.",
                 "path", "Hey! Look! A path!");

add_road_type
varargs void add_road_type(string type,
                           string base_path,
                           string room_desc,
                           string description,
                           mixed items,
                           mixed item_desc)

This method is used to add a standard road type to the terrain map, mapped to an ASCII character as used in the ASCII room map. A road is a terrain map room which can be seen from adjacent locations. The handler uses 'room_desc' to add an entry to the room description, describing where the road goes. 'description' is added to the descriptions of adjacent locations, to enable the road to be seen. In 'room_desc' and 'description', $D will be expanded to the relevant directions.

Parameters:
type - the ASCII type used on the map to denote the room
base_path - the full pathname of the source file for the room
room_desc - the 'continuation' description, which added to the room description to show where the road leads
description - the 'adjacent' description, which is seen from adjacent locations.
items - add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding item desc

See also:
add_room_type.c, add_road_type.c, set_external_chats.c and add_item .c

Example:
   add_road_type("+", ROOMS + "path", "The dusty path leads $D.",
                 "There is a dusty path to the $D.",
                 "path", "Hey! Look! A path!");

add_room_type
void add_room_type(string type,
                   string base_path)

This method is used to add a standard room type to the terrain map, mapped to an ASCII character as used in the ASCII room map.

Parameters:
type - the ASCII type used on the map to denote the room
base_path - the full pathname of the source file for the room

See also:
add_room_type.c, add_road_type.c and add_obstacle_type .c

Example:
   add_room_type(".", ROOMS + "field");

add_sign
void add_sign(int x,
              int y,
              string sign_long,
              mixed sign_read_mess,
              string sign_short,
              mixed sign_name,
              string sign_language)

This method is used to add a signpost into a specified location in a terrain_map. It is identical to the /std/room/ add_sign, except for the x and y coordinates which specify where the sign should go.

Parameters:
title - the name of the feature
x - the x coordinate of the center point
y - the y coordinate of the center point

See also:
add_sign .c

Example:
  add_sign(4, 3, "A wooden signpost.\n",
                 "\n-----------------\n"
                   "| Ladder: East  |\n"
                   "| Bridge: South |\n"
                   "-----------------",
                 "signpost", ({ "signpost", "sign" }), "common");

add_special_type
void add_special_type(string type,
                      string base_path,
                      int size,
                      int road_skip,
                      int height,
                      mapping height_rooms)

This method is used to add a standard skip room type to the terrain map. Mapped to an ASCII character as used in the ASCII room map. A skipped room is one in which every nth room in the terrain will be skipped unless it has something interesting in it. The height is used to do specific sorts of checks, like if a specific direction is passable or not.

Parameters:
type - the ASCII type used on the map to denote the room
base_path - the full pathname of the source file for the room
size - the number of rooms in each clump to skip over
road_skip - if this is 1 then the skip type is a 'road skip', this will assume the path is one wide and try to follow around curves
height - the height of the room
height_rooms - is a mapping containing what rooms to use at different height levels

See also:
add_room_type.c, add_road_type.c and add_obstacle_type .c

Example:
   add_room_type(".", ROOMS + "field");

add_topology_level
void add_topology_level(string char,
                        int height)

This method sets the topology mapping for the specific topology string. We use this to replace things inside rooms and to add an extra dimension of control to the terrain system.

The string it is mapped to is free form and the string of type %TOPO% in the path will be replaced with this character when mapped.

Parameters:
char - the caracter to map
str - what to map it to


add_world_room_type
varargs void add_world_room_type(string type,
                                 string base_path)

This method is used to add a world map based file into the terrain. It handles all the options like a special road type, but queries all the details off the base room instead.

Parameters:
type - the ASCII type used on the map to denote the room
base_path - the full pathname of the source file for the room

See also:
add_room_type.c, add_road_type.c, set_external_chats.c and add_item .c

Example:
   add_world_room_type("+", ROOMS + "path", "The dusty path leads $D.",
                 "There is a dusty path to the $D.",
                 "path", "Hey! Look! A path!");

add_z_exit_at
varargs void add_z_exit_at(int x,
                           int y,
                           int z,
                           string direc,
                           string dest,
                           string type,
                           mixed modifiers)

This method is used to add a standard exit to a specified location in a terrain map. The chief use is to insert exits to standard rooms or other terrain maps.

Parameters:
x - the x coordinate of the room (internal coordinate system)
y - the y coordinate of the room (internal coordinate system)
direc - the direction of the exit (as in add_exit)
dest - the path of the exit's destination (as in add_exit)
type - the type of exit (as in add_exit)
modifiers - an optional array of exit modifiers (as in modify_exit)

See also:
add_room_type.c, add_road_type.c, add_obstacle_type.c, add_exit.c and modify_exit .c

Example:
   add_exit_at(8, 0, "south", PEARWOOD + "stream_entrance", "road",
                      ({ "move mess", "You wade along the stream bed.\n",
                         "enter mess", "$N wades in from the north.",
                         "exit mess", "$N wades off to the $T." }));

add_zones
void add_zones(string type,
               string * zone_names)

This method is used to map ASCII characters used in the zone map onto one or more actual room zones.

Parameters:
type - the ASCII character used in the zone map
zones - a zone name or an array of zone names

Example:
  add_zones("*", ({ "zone2", "zone1" }));

calc_features
mapping calc_features(object room)



Returns:
the blocking data


calc_random_chats
void calc_random_chats(object room,
                       string key)
calc_random_descs
void calc_random_descs(object room,
                       string key)
debug_adjacent_terrains
string * debug_adjacent_terrains()
find_adjacent_terrain
string find_adjacent_terrain(int x,
                             int y)

THis method finds a terrain adjacent to us from this location in the specific direction.

Parameters:
x - the x location
y - the y location


find_all_adjacent_terrains
void find_all_adjacent_terrains()

This is specifically for debug. It finds al the adjacent terrains.
find_next_room_from
string * find_next_room_from(int x,
                             int y,
                             int z,
                             string direc)

This method finds the next room in the path. It returns the next room as the first element in the array and the list of the directions to get there as the second element.

Parameters:
x - the start x position
y - the start y position
z - the start z position
direc - the direction to go from here

Returns:
({ the end location, directions... })


find_room_at_real_coord
string find_room_at_real_coord(int x,
                               int y,
                               int z)

This method finds the room at the specific real coordinate.

Parameters:
x - the x location
y - the y location

Returns:
the room, or 0 on failure


load_room_at
object load_room_at(int x,
                    int y,
                    int z)

This method is used to find a room at the specified coordinates, or to clone and setup a new one if none exists so far.

Parameters:
x - the x coordinate of the room (internal coordinate system)
y - the y coordinate of the room (internal coordinate system)

Returns:
the room at those coordinates, or 0 if none can be cloned

See also:
load_room_at.c and query_room .c


modify_feature
varargs void modify_feature(string title,
                            string * descs,
                            mixed item_desc)

This method is used to modify the descriptions and/or item descs of an established feature. Changes will be instantly seen in all the rooms the feature is visible from.

Parameters:
title - the name of the feature
descs - array of descriptions to be shown at different ranges. add_item name(s) (identical to the 'shorts' parameter in add_item)
item_desc - a string, or array of strings giving the corresponding These are divided equally along the total range

See also:
set_feature_chats.c, add_feature.c and add_item .c


normalise_room_exits
void normalise_room_exits(object room)

This method fixes up the "obvious" settings for the rooms.

Parameters:
room - the room object to normalise.


query_access_control
int query_access_control()

This returns the current access control for this terrain. You can make terrains pt or cre only.,

Returns:
the access control


query_adjacent_terrains
mapping query_adjacent_terrains()
query_area_map
mixed * query_area_map()
query_base_room
string query_base_room(int x,
                       int y,
                       int z,
                       int map_room)

This returns the destination room in the given directoin, initially it tries for a normal exit type. If that fails, it tries for a climbing exit type. A climbing exit type is one that moves up or down from the current z height.

Parameters:
x - the x co-ordinate
y - the y co-ordinate
z - the z co-ordinate
base - the base path of the parent terrain handler


query_char_map_real_coord
class char_map_data query_char_map_real_coord(int x,
                                              int y)

This is used by the terrain system to work out what is beside us.

Parameters:
x - the x position
y - the y position


query_char_maps
mapping query_char_maps()
query_debug_map
string query_debug_map(int x,
                       int y,
                       int width,
                       int showx,
                       int showy)

This method returns a grid of the specified size around the center point to give creators an overview of where they are currently.

Parameters:
x - the x co-ordinate
y - the y co-ordinate
width - the width of the box


query_debug_map_char
string query_debug_map_char(int x,
                            int y)

This method returns the specific debug map character at the given location.

Parameters:
x - the x location
y - the y location

Returns:
the map character


query_debug_map_feature
string query_debug_map_feature(string name)

This method returns a grid of the specified size around the center point to give creators an overview of where they are currently.

Parameters:
x - the x co-ordinate
y - the y co-ordinate
width - the width of the box


query_debug_map_feature_distant
string query_debug_map_feature_distant(string feature)

This method returns a grid of the specified size around the center point to give creators an overview of where they are currently.

Parameters:
x - the x co-ordinate
y - the y co-ordinate
width - the width of the box


query_debug_real_coord
class real_coords query_debug_real_coord()
query_dest_coordinate_string
string query_dest_coordinate_string(int x,
                                    int y,
                                    int z,
                                    string direc,
                                    string key)

This method finds the co-ordinates to use for getting to the next room. THis handles messing about to make bridges and things

Parameters:
x - the x coordinate
y - the y coordinate
z - the z coordinate
direc - the direction it is from
key - the key is it from

Returns:
the new mangled co-ordinates


query_dimensions
int * query_dimensions()
query_direction_distance
int query_direction_distance(string dir)

This method returns the distance that is moved if you go in the specified direction.

Returns:
the distance


query_feature_item_desc
varargs string query_feature_item_desc(string title)

This method returns the item description.

Parameters:
title - the title of the feature

Returns:
the feature item description


query_feature_ob
object query_feature_ob(string name)

This method returns the region used when calculating the extents of the feature.

Parameters:
name - the name of the feature to find the region of

Returns:
the feature region


query_feature_rooms
mapping query_feature_rooms()
query_features
mapping query_features()
query_ground_room
string query_ground_room(int x,
                         int y)

This method returns the location of the ground room. It is basically just the co-ordates connected onto the terrain_handler definition.

Parameters:
x - the x location
y - the y location

Returns:
the string name of the ground room


query_ground_room_co_ords
int * query_ground_room_co_ords(int x,
                                int y)

This method returns the ground room for a specific co-ordinate.

Parameters:
x - the x location
y - the y location

Returns:
the terrain co-ordinates of the ground room


query_map_file
string query_map_file()
query_more_terrains_rooms_from
mixed * query_more_terrains_rooms_from(int x,
                                       int y,
                                       int z,
                                       string direc,
                                       int moves_left,
                                       int jump,
                                       string main_key,
                                       int road_jump,
                                       int change_height)

This method is used by connecting terrains to find the next room in sequence.

Parameters:
x - the real x coordinate
y - the real y coordinate
moves_left - the number of moves left to pop along
jump - the jump length we are looking for
main_key - the key, this is only used for non-road jumps
road_jump - is this a road jump


query_player_map_internal_template
mapping query_player_map_internal_template(mixed * map,
                                           mapping key,
                                           mixed * colours,
                                           int x_c,
                                           int y_c,
                                           int z_c,
                                           int distance)

This method does the updating of the map based on the template. Pretty easy really, check each location in the map to see if it exists and what we should do with it.
query_player_map_template
string query_player_map_template(int x_c,
                                 int y_c,
                                 int z_c,
                                 int visibility,
                                 int max_size)

This method generates a player map using templates instead of using lines from the center point. This is more efficent than a line drawing method. THe max_size is used to make sure the size of the visible area is squashed, if we want a smaller partial map for other displays. The max size must be an odd number.
query_random_chats
mapping query_random_chats()
query_random_descs
mapping query_random_descs()
query_real_coords
mixed * query_real_coords()
query_real_from_terrain_coord
class coord query_real_from_terrain_coord(int x,
                                          int y,
                                          int z)

This method returns the real coordinates from the terrain coordinates. For simplicity we always assume the terrain sits at the water level.

Parameters:
x - the x coordinate
y - the y coordinate


query_room
mixed query_room(int x,
                 int y,
                 int z)

This method queries the path of a room. If it takes the form: '/d/full/path/name.c:x:y' where x and y are integers, it clones a new room at the specified coordinates, sets it up fully, and returns it. If the room path is of the standard form, it simply returns the loaded room.

Parameters:
room_path - the full pathname of the room to be cloned.

Returns:
the cloned/loaded room, or 0 if it could not be cloned/loaded

See also:
load_room_at.c and query_room_at .c


query_room_at
object query_room_at(int x,
                     int y,
                     int z)

This method is used to find a room at the specified coordinates, if one has already been cloned. If a room has been cloned at those coordinates, it is returned,

Parameters:
x - the x coordinate of the room (internal coordinate system)
y - the y coordinate of the room (internal coordinate system)

Returns:
the room at those coordinates, or 0 if none has been cloned

See also:
load_room_at.c, query_room.c, query_rooms_in_block.c and query_rooms_in_range .c


query_room_map
mixed * query_room_map()
query_room_zones
mapping query_room_zones()
query_rooms_in_block
object * query_rooms_in_block(int x,
                              int y,
                              int z,
                              int width,
                              int height)

This method is used to find all the rooms currently cloned within a specified rectangular area.

Parameters:
x - the x coordinate of rectangle's bottom left corner
y - the y coordinate of rectangle's bottom left corner
width - the width of the rectangle
height - the height of the rectangle

Returns:
an array containing any rooms currently cloned within the specified rectangle

See also:
query_room_at.c, query_rooms_in_range.c and query_rooms_in_zone .c


query_rooms_in_range
varargs object * query_rooms_in_range(int x,
                                      int y,
                                      int z,
                                      int max,
                                      int min)

This method is used to find all the rooms currently cloned within a specified distance of the specified coordinates.

Parameters:
x - the x coordinate of the center point
y - the y coordinate of the center point
max - the maximum distance of rooms to be returned
min - the minimum distance of rooms to be returned. Defaults to 0

Returns:
an array containing any rooms currently cloned within the specified range

See also:
query_room_at.c, query_rooms_in_block.c and query_rooms_in_zone .c


query_rooms_in_zone
object * query_rooms_in_zone(string zone)

This method is used to find all rooms currently loaded within the specified room zone.

Parameters:
zone - the name of the room zone

Returns:
an array containing all the currently cloned rooms within this zone

See also:
query_rooms_in_block.c and query_rooms_in_range .c


query_rooms_to
mixed * query_rooms_to(int x,
                       int y,
                       int z,
                       string direc,
                       int len,
                       string main_key,
                       int jump_len,
                       int road_type,
                       int change_height)

This method find the specific squence of rooms in the given direction with the given room jump. We do not worry about contents here. Only if it is a special interest marker or if there are two different ways from the location of the same type. Items in the map are set as being special interest to stop a jump.

Parameters:
x - the x co-ordinate to start from
y - the y co-ordinate to start from

Returns:
the list of rooms


query_signposts
mapping query_signposts()
query_special_exit_base_room
string query_special_exit_base_room(int x,
                                    int y,
                                    int z,
                                    int map_room,
                                    int ref new_z,
                                    int height_here)

This method returns the basic room as the specified location. A climb room type means a room that is up or down on the z axis from where we are, but we are allowed to climb to.

Parameters:
x - the x location
y - the y location
z - the z location
map_room - check down through the air for the room for the map
new_z - the updated z co-ordinate
height_here - the height of the room we are leaving, this is only valid in the case of exit finding

Returns:
the basic room for the location


query_standard_exits
mapping query_standard_exits()
query_terrain_from_real_coord
class coord query_terrain_from_real_coord(int x,
                                          int y,
                                          int z)

This method returns the room coordinates from the real coordinates.

Parameters:
x - the x coordinate
y - the y coordinate


query_topo_map
mixed * query_topo_map()
query_visible_distance
int query_visible_distance()

This method returns the distance that you can see in this terrain.

Returns:
the visible distance in the terrain


query_zdiff
int query_zdiff()

This method returns the z diff for the terrain, this is how much each terrain up is in terms of real co-ordinates

Returns:
the zdiff


query_zone_map
mixed * query_zone_map()
query_zone_types
mapping query_zone_types()
remove_feature
void remove_feature(string title)

This method is used to remove a named feature from the terrain map

Parameters:
title - the name of the feature

See also:
add_feature .c


set_access_control
void set_access_control(int access)

This method sets the current access control for this terrains. You can set the terrain to be pt or cre only. 1 for pt only and 2 for cre only.
set_external_chats
void set_external_chats(string type,
                        mixed chats)

This method is used to setup 'external' chats for a road or obstacle, which will be added to the room chats of adjacent locations. You should supply the ASCII character corresponding to the road/obstacle type, and an array of chat strings (in the same format as supplied to room_chat)

Parameters:
type - the ASCII type used on the map to denote the room
base_path - the full pathname of the source file for the room set_external_chats("=", ({ "The stream bubbles merrily on its way.", "You hear a faint splashing sound from the stream." }));

See also:
add_road_type.c, add_obstacle_type.c, set_feature_chats.c and room_chat .c


set_feature_chats
void set_feature_chats(string title,
                       mixed * chats,
                       mixed * night_chats)

This method is used to add room chats to locations that can view a particular feature. $D substitution is carried out on the chats.

Parameters:
title - the name of the feature
chats - an array of strings (room chats related to the feature)

See also:
add_feature.c, modify_feature.c and room_chat .c


set_newline_mode
void set_newline_mode(int mode)

This method sets the 'newline' mode for room description extras. If set to 1, a newline will be inserted after all feature and neighbouring room items. 1 is the default.

Parameters:
mode - the new mode.


set_random_chat_limit
void set_random_chat_limit(int new_limit)

This method is used to limit the number of random chats that are picked out for each room.

Parameters:
new_limit - the new chat limit

See also:
set_random_desc_limit.c, add_random_desc.c and add_random_chat .c


set_random_desc_limit
void set_random_desc_limit(int new_limit)

This method is used to limit the number of random descs that are picked out for each room.

Parameters:
new_limit - the new desc limit

See also:
set_random_chat_limit.c, add_random_desc.c and add_random_chat .c


set_real_coordinates
varargs void set_real_coordinates(int x1,
                                  int y1,
                                  int x2,
                                  int y2,
                                  int zdiff)

This method sets the real coordinates for the room and informs the map handler.

Parameters:
x1the - start x location
y1 - the start y location
x1 - the end x location
y1 - the end y location
zdiff - the coord difference between z values (150 if not specified)


set_real_coordinates_no_inform
varargs void set_real_coordinates_no_inform(int x1,
                                            int y1,
                                            int x2,
                                            int y2,
                                            int zdiff)

This method sets the real coordinates for the room without informing the map handler.

Parameters:
x1 - the start x location
y1 - the start y location
x1 - the end x location
y1 - the end y location
zdiff - the coord difference between z values (150 if not specified)


set_real_offsets
void set_real_offsets(int xoff,
                      int yoff,
                      int zoff)

This method sets the real offsets for movement in the rooms. This is needed in rooms that do not have real co-ordinates set but still require movement to generate the correct messages.

Parameters:
xoff - how far you move in the x direction
yoff - how far you move in the y direction
zoff - how far you move in the z direction


set_visible_distance
void set_visible_distance(int distance)

This method sets the distance you can see in this terrain based on the map. The distance is used to determine nice little map things to show the players.

Parameters:
distance - the distance you can see


setup_handler
void setup_handler()
setup_room
void setup_room(object room,
                string base_path)

The main nasty func for setting up a room. It adds all the necessary exits, and adds to the room's extra_look & add_items for anything outside the room which should be visible. It's fairly nasty. But hey - it works.
tell_feature
varargs void tell_feature(string title,
                          mixed message)

This message displays messages in all rooms within range of a feature. The message can be either a string, which goes to all the rooms, or an array of strings, in which case they get spread across the distances (in which case you should supply the same number of array elements as in the descriptions in the original add_feature. Any occurences of $D in the message(s) will be replaced in each room with the direction that the feature lies in.

Parameters:
title - the name of the feature, as used in add_feature
message - the message to be displayed

See also:
tell_rooms_in_zone.c, add_feature.c, modify_feature.c and set_feature_chats .c


tell_zones
varargs void tell_zones(mixed zones,
                        string message,
                        mixed mess_class)

This method displays a message in all the currently loaded rooms within the specified zone(s).

Parameters:
zones - a zone name as a string, or an array of zone names
message - the message to be displayed
mess_class - the message type. Normally this need not be specified

See also:
query_rooms_in_zone.c and tell_feature .c


Classes

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