nests
Server
modkit.nests lists and removes nests. A nest holds the eggs of its owner species. All three functions walk through all game objects, so use them on demand and not in a fast timer.
modkit.nests.list
modkit.nests.list()
Returns: array of tables, at most 1024.
| Field | Type | Description |
|---|---|---|
id |
integer | handle for destroy. It is only valid until the nest is gone, list again before you use an old id. |
species |
string | owner species, "" when the nest has no owner class |
x, y, z |
number | position |
for _, nest in ipairs(modkit.nests.list()) do
print(nest.id, nest.species, nest.x, nest.y)
end
modkit.nests.destroy
modkit.nests.destroy(id)
Returns: true when the id pointed to a living nest and it was destroyed.
modkit.nests.destroyAll
modkit.nests.destroyAll([species])
| Parameter | Type | Description |
|---|---|---|
| species | string | only nests of this species. Without it every nest goes. |
Returns: number of destroyed nests.
modkit.nests.destroyAll("Troodon")
For automatic cleanup of blocked species see modkit.population.setEggCleanup.