Difference between revisions of "Bigmap (Programming)"

From Hellmoo Wiki Archive
Jump to navigation Jump to search
imported>Marvin
imported>Marvin
m (formatting)
 
Line 1: Line 1:
Big maps ($bigmap) are now used instead of the old contiguous map system. They work as a central settings database that rooms use when rendering maps.
Big maps ($bigmap) can be used instead of the old contiguous map system. They work as a central settings database that rooms use when rendering maps.
 
When a room renders its map ($room:_render_map) it will look to see if the room's area has a valid .bigmap property, if it does, it uses the bigmap for data instead of the area.


When a room renders its map ($room:_render_map) it will look to see if the room's area has a valid .bigmap property, if it does, it uses the bigmap for data instead of the area.


The following verbs are available:
The following verbs are available:
  * @setup-areas <bigmap object><br>
: '''@setup-areas''' <bigmap object> <br> Will set .bigmap on all areas in .areas to this object, if it already isn't set to this object.
  Will set .bigmap on all areas in .areas to this object, if it already isn&#39;t set to this object.
: '''@reset-maps''' <bigmap object> <br> Will go through every area in .areas and cause them to reset their maps.
 
  * @reset-maps &amp;lt;bigmap object&amp;gt;&lt;br&gt;
  Will go through every area in .areas and cause them to reset their maps.
 
The following functions are available:
  * area_link_icons()&lt;br&gt;
  Returns a lists of lists of icon_block data from all areas in .areas, formatted as {{#area, {data...}}, ...}. Used by $room:_render_map when rendering in bigmap mode.


The following properties are available:
The following properties are available:
: '''.areas''' <br> A list of areas in the big map.
: '''.blank_normal_icon''' <br> The blank icon for the normal map (non-client).
: '''.blank_client_icon''' <br> The blank icon for client mode.
: '''.sky_z''' <br> A room.z lesser or equal to this value (negative values represent up in coordinate system) will result in sky_normal_icon / sky_client_icon instead of the blanks and that Z entry in icon block data always being used for coordinates below or equal to sky_z value.
: '''.sky_normal_icon''', '''.sky_client_icon''' <br> Icons for rooms that meet sky_z criteria.
: '''.underground_z''' <br> A room.z greater or equal to this value (positive values represent down in coordinate system) will result in using underground_normal_icon / sky_client_icon instead of the blanks and that Z entry in icon block data always being used for coordinates greater or equal to underground_z value.
: '''.underground_normal_icon''', '''.underground_client_icon'' <br> Icons for rooms that meet underground_z criteria.
: '''.icon_block_z''' <br> A list of Z values, this corresponds with icon_block_data, so you can find the appropriate icon block data for your z (bigmap.icon_block_data[room.z in bigmap.icon_block_z]). This helps efficiency when a large number of icon blocks are present.
: '''.icon_block_data''' <br>  Icon block data, a list of lists, the top level is per-z. For each Z the format is the same as normal $area icon blocks, {z, x1, y1, x2, y2, icon}. For big maps, the Z in the actual icon block data is ignored.


  * areas&lt;br&gt;
[[Category:Programming]]
  A list of areas in the big map.
 
  * blank_normal_icon&lt;br&gt;
  The blank icon for the normal map (non-client).
 
  * blank_client_icon&lt;br&gt;
  The blank icon for client mode.
 
  * sky_z&lt;br&gt;
  A room.z lesser or equal to this value (negative values represent up in coordinate system) will result in sky_normal_icon / sky_client_icon instead of the blanks and that Z entry in icon block data always being used for coordinates below or equal to sky_z value.
 
  * sky_normal_icon, sky_client_icon&lt;br&gt;
  Icons for rooms that meet sky_z criteria.
 
  * underground_z&lt;br&gt;
  A room.z greater or equal to this value (positive values represent down in coordinate system) will result in using underground_normal_icon / sky_client_icon instead of the blanks and that Z entry in icon block data always being used for coordinates greater or equal to underground_z value.
 
  * underground_normal_icon, underground_client_icon&lt;br&gt;
  Icons for rooms that meet underground_z criteria.
 
  * icon_block_z&lt;br&gt;
  A list of Z values, this corresponds with icon_block_data, so you can find the appropriate icon block data for your z (bigmap.icon_block_data[room.z in bigmap.icon_block_z]). This helps efficiency when a large number of icon blocks are present.
 
  * icon_block_data&lt;br&gt;
  Icon block data, a list of lists, the top level is per-z. For each Z the format is the same as normal $area icon blocks, {z, x1, y1, x2, y2, icon}. For big maps, the Z in the actual icon block data is ignored.
 
-- Main.MarvIn - 04 Sep 2007

Latest revision as of 16:26, 26 December 2008

Big maps ($bigmap) can be used instead of the old contiguous map system. They work as a central settings database that rooms use when rendering maps.

When a room renders its map ($room:_render_map) it will look to see if the room's area has a valid .bigmap property, if it does, it uses the bigmap for data instead of the area.

The following verbs are available:

@setup-areas <bigmap object>
Will set .bigmap on all areas in .areas to this object, if it already isn't set to this object.
@reset-maps <bigmap object>
Will go through every area in .areas and cause them to reset their maps.

The following properties are available:

.areas
A list of areas in the big map.
.blank_normal_icon
The blank icon for the normal map (non-client).
.blank_client_icon
The blank icon for client mode.
.sky_z
A room.z lesser or equal to this value (negative values represent up in coordinate system) will result in sky_normal_icon / sky_client_icon instead of the blanks and that Z entry in icon block data always being used for coordinates below or equal to sky_z value.
.sky_normal_icon, .sky_client_icon
Icons for rooms that meet sky_z criteria.
.underground_z
A room.z greater or equal to this value (positive values represent down in coordinate system) will result in using underground_normal_icon / sky_client_icon instead of the blanks and that Z entry in icon block data always being used for coordinates greater or equal to underground_z value.
.underground_normal_icon', .underground_client_icon
Icons for rooms that meet underground_z criteria.
.icon_block_z
A list of Z values, this corresponds with icon_block_data, so you can find the appropriate icon block data for your z (bigmap.icon_block_data[room.z in bigmap.icon_block_z]). This helps efficiency when a large number of icon blocks are present.
.icon_block_data
Icon block data, a list of lists, the top level is per-z. For each Z the format is the same as normal $area icon blocks, {z, x1, y1, x2, y2, icon}. For big maps, the Z in the actual icon block data is ignored.