Skip to content

GetLevelDoors

Every door of the level, touched or not.

The keys of every door the tables export lists for the level - the ones GetDoorPosition answers for - where a mode finds the level’s houses: a street to put someone in, a village to spread people over. Empty when the server runs without the tables export (or with one older than the doors). GetDoors lists only the doors anyone touched.

GetLevelDoors()

table - a list of door keys

-- the doors within 300 m of a town's centre: its houses
local houses = {}
for _, key in ipairs(GetLevelDoors()) do
local x, y = GetDoorPosition(key)
if (x - townX) ^ 2 + (y - townY) ^ 2 < 300 * 300 then houses[#houses + 1] = key end
end

GetDoorPosition · GetNearestDoor · GetDoors · the Doors and containers group of the index