Skip to content

$world

Search the whole world for components.

4 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).

get_all_components

read-only
$world.get_all_components(script_name: string, name: string, owner: User, var_name: string, var_value: var) -> list

Get all components in the world with a given type, plus optional additional filters.

ParameterTypeMeaning
script_namestringThe script name.
namestring(Optional) When specified, only objects with this name will be returned. Omit to return all results. Warns on NULL.
ownerUser(Optional) Filters results to only values owned by the indicated user. Omit to return all results. Warns on NULL.
var_namestring(Optional) Filters results to only values with the specified field. Omit to return all results. Warns on NULL.
var_valuevar(Optional, required if 'var' specified) Filters results to only values where the 'var' field has the specified value. Omit to return all results.

Returns list: List of components.

get_entity

read-only
$world.get_entity(name: string, owner: User) -> Entity

Get an entity by its name.

ParameterTypeMeaning
namestringThe name of the entity to search for.
ownerUser(Optional) Filters results to only values owned by the indicated user. Omit to return all results. Warns on NULL.

Returns Entity: The named entity.

get_first_component

read-only
$world.get_first_component(script_name: string, name: string, owner: User, var_name: string, var_value: var) -> Component

Get the first component in the world with a given type, plus optional additional filters.

ParameterTypeMeaning
script_namestringThe script name.
namestring(Optional) When specified, only objects with this name will be returned. Omit to return all results. Warns on NULL.
ownerUser(Optional) Filters results to only values owned by the indicated user. Omit to return all results. Warns on NULL.
var_namestring(Optional) Filters results to only values with the specified field. Omit to return all results. Warns on NULL.
var_valuevar(Optional, required if 'var' specified) Filters results to only values where the 'var' field has the specified value. Omit to return all results.

Returns Component: The found component, or null.

queue_event

read-only
$world.queue_event(name: string, args: list, end_of_frame: bool)

Enqueue an event to broadcast to the world.

ParameterTypeMeaning
namestringName of the event.
argslistEvent arguments.
end_of_frameboolIf true, the event is queued to run at the end of the frame, otherwise it runs at the end of the active event.