Where and when species live: counts, places, herds and packs, respawns (since API 3).
A population rule says where and when a species lives on the maps: how many (groups x group size), where
(zones, near water, ground height, slope, away from the hunter's start), when (the hunt's time of day, maps), as herds
or packs, whether it respawns during the hunt and up to which cap, and whether it adds to the game's own placement or
replaces it for that species. Rules come from a mod's populations.json, zones.json and spawns/*.json (read
again for every hunt) or from population.add; both take the same fields, listed in the guide:
Zones, populations, herds and packs. Species are given by id (world.spawn's ids, content
packs' too).
A rule added in main.lua takes part from the next hunt on; one added during a hunt places its creatures at once.
Reloading the scripts keeps the creatures of a rule the mod adds again (none are placed twice).
Adds a population rule (or replaces the rule with that id).
Parameter
Type
def
table
the rule: id, species, areas / maps, time, chance, groups, size (or count), herd / pack / group, where, mode, respawn, cap, speciesCap, territory, avoid (the guide has them all)
Returns
string
its id
population.add{id = "lake_herds", species = "parasaurolophus", time = "dawn", groups = {2, 3},
herd = {size = {4, 7}, formation = "loose"}, where = {nearWater = 2500},
respawn = {delay = 120}, cap = 15}