Builtin Library
README.md
debug.inspect
Inspect entity component state — script components, native ECS components, or both — for every entity matching the target.
debug.inspect("player")
debug.inspect("lamp", { include = "ecs" })
debug.inspect("enemy_*", { types = { "Health" }, limit = 5 })
The target is an entity id, a name, an entity proxy, or an array of them.
A name resolves to every matching entity (names are not unique; globs
like enemy_* work), an id to itself.
Options:
{
include = "all", -- "script" | "ecs" | "all" (default)
types = nil, -- restrict to these component types; full identity
-- or leaf name ("Camera" matches
-- "@builtin::components.Camera")
limit = 10, -- cap on matches
}
Returns:
{
query = { target, count },
matches = {
{
id = "ent_...",
name = string?,
script = { [componentType] = data }, -- serialized public data
ecs = { [componentName] = fields }, -- native component fields
},
...
},
}
script data is the serialized form (entity refs as id strings, asset refs
as { __ref, name, type } envelopes) produced by the component_snapshot
module; ecs is ecs.snapshot per entity. For live gameplay reads and
writes, use entity(id).component.get / getAll — the data those return
is the running component's proxy, not a snapshot.