For working with surfaces.
Surfaces are the “domain” of the world.
local Surface = require('__stdlib__/stdlib/area/surface')
lookup(surface) | Flexible and safe lookup function for surfaces. |
find_all_entities(search_criteria) | Given a search criteria, find all entities that match the criteria. |
get_surface_bounds(surface) | Gets the area which covers the entirety of a given surface. |
set_daytime_thresholds(surface, morning, dawn, dusk, evening) | Sets the daytime transition thresholds on a given surface |
search_criteria | This table should be passed into find_all_entities function to find entities that match the criteria. |
Flexible and safe lookup function for surfaces.
Given a search criteria, find all entities that match the criteria.
surface.find_all_entities({ type = 'unit', surface = 'nauvis', area = {{-1000,20},{-153,2214}})
-- returns a list containing all unit entities on the nauvis surface in the given area
Gets the area which covers the entirety of a given surface.
This function is useful if you wish to compare the total number of chunks against the number of chunks within the entire area of a given surface.
Parameters:Sets the daytime transition thresholds on a given surface
Parameters:
This table should be passed into find_all_entities function to find entities that match the criteria.
Fields: