Manual:DIL Manual/mapx

From DikuMUD Wiki
Jump to navigation Jump to search

mapx

Field (integer, read-only; units: rooms).

room.mapx : integer

The room's X coordinate on the graphical map, set with gmap(x, y) in the zone file; -1 when the room has none. The look command (baselook.zon) sends it to the web client as map='x,y' in the room title.

Notes

  • On anything that is not a room it is -1, not a failure; a unitptr variable that is null gives -1 too.
  • vmc accepts an assignment, but it never works: at run time the program logs "DIL SERIOUS: ... Type error in lvalue assignemt" and stops.

Example

dilbegin string map_attr(room : unitptr);
code
{
   if (room.mapx == -1)
      return ("");
   return (" map='" + itoa(room.mapx) + "," + itoa(room.mapy) + "'");
}
dilend

Makes the map attribute of a room title, as baselook.zon does.

See also