Jump to: navigation, search
The map editor in Zone Mapping Mode, Viewing submode. Each of the four zones on the map is displayed with a different set of stripes. (From Scripts:Stairs)

A zone simply (invisibly) marks part of the map; think of it like a map layer with two states per tile: included in the zone, or not. Zones are defined in the map editor's Zone Mapping Mode (press F7). You can place each tile in multiple zones and there are 9999 zones per map. The collection of all a map's zones is sometimes called the zonemap. Zones aren't really "created"; all maps have 9999 zones, which start out blank.

Just putting a tile in a zone has no effect. You have to use the zone elsewhere. Currently, the only built-in use for zones is for restricting NPC movement (NPC "Avoidance Zone" and "Movement Zone" settings). See How do I make a wall that NPCs can't pass, but heroes can?

Zones also tend to get used a lot in scripts -- any time when you want to check whether the hero or an NPC is at certain locations of the map. You check whether a tile is part of a zone with read zone or zone at spot. For example, to cause different walking sounds or speeds depending on terrain, changing palettes when in a shadow, changing walkabout graphics when standing in a swamp, and a zillion other uses. The metadata that you can define for each zone -- the zone name and extra data -- is only used by scripts.

Map editor[edit]

To define a zone, go to the Zone editing mode of the map editor, type in a zone ID number or press < and > to select a zone, press Z if necessary to switch from "Viewing" to "Editing" mode, and start adding/removing tiles to the zone by pressing SPACE. You can use a number of tools for drawing boxes and so forth (see Keyboard Shortcuts#zonemap mode for the basic controls).

Press F1 in the Zone editing mode for complete documentation of the editor (Note: there are different help pages for the different sub-modes).


NPC movement zones are useful for keeping NPCs nearby:


See Also[edit]