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).
$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.
| Parameter | Type | Meaning |
|---|
script_name | string | The script name. |
name | string | (Optional) When specified, only objects with this name will be returned. Omit to return all results. Warns on NULL. |
owner | User | (Optional) Filters results to only values owned by the indicated user. Omit to return all results. Warns on NULL. |
var_name | string | (Optional) Filters results to only values with the specified field. Omit to return all results. Warns on NULL. |
var_value | var | (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.
$world.get_entity(name: string, owner: User) -> Entity
Get an entity by its name.
| Parameter | Type | Meaning |
|---|
name | string | The name of the entity to search for. |
owner | User | (Optional) Filters results to only values owned by the indicated user. Omit to return all results. Warns on NULL. |
Returns Entity: The named entity.
$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.
| Parameter | Type | Meaning |
|---|
script_name | string | The script name. |
name | string | (Optional) When specified, only objects with this name will be returned. Omit to return all results. Warns on NULL. |
owner | User | (Optional) Filters results to only values owned by the indicated user. Omit to return all results. Warns on NULL. |
var_name | string | (Optional) Filters results to only values with the specified field. Omit to return all results. Warns on NULL. |
var_value | var | (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.
$world.queue_event(name: string, args: list, end_of_frame: bool)
Enqueue an event to broadcast to the world.
| Parameter | Type | Meaning |
|---|
name | string | Name of the event. |
args | list | Event arguments. |
end_of_frame | bool | If true, the event is queued to run at the end of the frame, otherwise it runs at the end of the active event. |