Engine

core.engine.get_entity_types

Shared

Retrieves all currently registered entity category names

Syntax

local result = core.engine.get_entity_types()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
tableresultAn array of available entity category names
Each entry is usable as the category argument to core.engine.get_entities

Entity Types

CategoryAvailabilityStreamableDimensionNotes
core.modelclient | server✓✓Frustum-culled
core.cameraclient—✓Selects the dimension it renders
core.webviewclient——
core.fontclient——
core.imageclient——
core.svgclient——
core.rendertargetclient——
core.displayclient——
core.shaderclient——
core.audio_2dclient——
core.audio_3dclient✓✓Frustum-culled positional audio
core.databaseserver——
core.db_queryserver——
util.timerclient | server——
util.promiseclient | server——
util.threadclient | server——
light.directionalclient✓✓Always streamed
light.pointclient✓✓Frustum-culled
light.spotclient✓✓Frustum-culled
light.areaclient✓✓Frustum-culled
particle.gpuclient✓✓Frustum-culled
particle.trailclient✓✓Frustum-culled
physics.rigidclient | server✓✓Frustum-culled
physics.staticclient | server✓✓Frustum-culled
physics.characterclient | server✓✓Frustum-culled
physics.animatableclient | server✓✓Frustum-culled
physics.vehicleclient | server✓✓Frustum-culled
physics.vehicle_wheelclient | server✓✓Frustum-culled, follows its parent's dimension
physics.areaclient | server—✓
physics.collision_shapeclient | server✓✓Frustum-culled, follows its parent's dimension

Examples

Prints all registered entity categories
core.engine.iprint(core.engine.get_entity_types())
Counts entities across every category
for _, category in ipairs(core.engine.get_entity_types()) do
    core.engine.print("info", category, "count:", #core.engine.get_entities(category))
end
Registers a monitor for every entity category
for _, category in ipairs(core.engine.get_entity_types()) do
    util.monitor.register(category .. "_count", util.string.upper(category) .. "_COUNT", function() 
        return #core.engine.get_entities(category)
    end, util.monitor.stat_format.QUANTITY)
end

On this page