Zones

From OHRRPGCE-Wiki
Jump to navigation Jump to 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 parts of the map; think of it like a map layer with two states per tile: included in the zone, or not. Zones are edited in the map editor's Zone Mapping Mode (press F7 inside the editor). You can place each tile in multiple zones and there are 10000 zones per map. However each tile can only be in at most 15 different zones. The collection of all a map's zones is sometimes called the zonemap. Zones aren't really "created"; all maps have 10000 zones, which start out blank.

Just putting a tile in a zone has no effect (except for zone 10000 which marks one-way walls). You have to use the zone elsewhere. Currently, the only built-in used for zones is for restricting NPC or hero movement: NPC "Avoid Zone" and "Movement Zone" settings, and "Hero Move Zone" and "Hero Avoid Zone" in General Map 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 standing in a shadow, changing walkabout graphics when standing in a swamp, triggering animations while in an area, triggering cutscenes when crossing the boundary of an area, and a zillion other uses. The metadata that you can define for each zone -- the zone name and extra data array -- 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.

See Also[edit]

Scripts: