Named parts of the map: circles, boxes, polygons, terrain regions; enter / leave events (since API 3).
A zone is a named part of the map: a circle, a box, a polygon or the whole map, cut down by conditions (land or
water, near water, ground height, slope, a height range). The hunter and, when asked, creatures fire zone_enter /
zone_leave as they cross its edge. Zones also serve populations (where creatures live) and
groups (territories, zones they avoid).
Zones made by a script are its own: they go when the scripts are reloaded (make them in main.lua; they stay from hunt
to hunt). A mod's zones.json / populations.json makes them too (read again for every hunt). The guide:
Zones, populations, herds and packs.
the zone: name, a shape (circle = {x, z, radius}, box = {x1, z1, x2, z2}, polygon = {{x, z}, ...}, or none: the whole map), conditions (water = true / land = true, nearWater, awayFromWater, minHeight / maxHeight of the ground, maxSlope, minY / maxY of what is tested), areas / maps (only on these maps), tracking (hunter = false, creatures = true or {species = {...}, team = n, group = id, predator = bool})
-- the lake shore of one map: land within 2 km of water, inside a boxzone.create{name = "shore", box = {x1 = 60000, z1 = -90000, x2 = 90000, z2 = -60000},
nearWater = 2000, land = true, areas = {2}}
A handle to one zone (zone.circle, zone.get ...). Handles compare equal when they are the same zone.
Fields
Field
Type
Access
name
string
read
its name (unique: a zone made with a name that exists replaces that one)
kind
string
read
"circle", "box", "polygon" or "map" (a terrain region)
valid
boolean
read
false once it was removed (or the scripts were reloaded)
id
integer
read
a number for it
hunterInside
boolean
read
the hunter is in it right now
active
boolean
read
it exists on this hunt's map (areas / maps)
mod
string
read
the mod that made it
x
number?
read / write
circle: its middle (writable)
z
number?
read / write
circle: its middle (writable)
radius
number?
read / write
circle: its radius (writable: a ring that shrinks, a camp that moves; who is inside is kept, and the next frame fires zone_enter / zone_leave for what the new circle takes in or leaves out)