LevelResource - stingray.LevelResource namespace reference - Stingray Lua API Reference

stingray.LevelResource namespace reference

Description

Contains functions that operate on level resources set up in the level editor.

These functions can be used to extract information from level resources without having to load the level into the world. The level resources must be loaded prior to calling these functions.

Functions

Parameters

level_resource :

string

The name of a currently loaded level resource.

Returns

stingray.NavigationMesh

The newly created navigation mesh.

Users are responsible for calling destroy_navigation_mesh() on the returned navigation mesh once they are done with it.

Parameters

level_resource :

string

The name of a currently loaded level resource.

Returns

stingray.DynamicData

A dynamic data object for the level.

This allows you to extract the same script data that is accessible through Level.get_data() without spawning the level.

Parameters

level_resource :

string

The name of a currently loaded level resource.

mesh :

stingray.NavigationMesh

The navigation mesh to destroy.

Returns
This function does not return any values.

This function should only be called on navigation meshes obtained through the create_navigation_mesh() function. Do not attempt to destroy a navigation mesh that was obtained using Level.navigation_mesh().

Parameters

level_resource :

string

The name of a currently loaded level resource.

Returns

string[]

A list of object set names.

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
Parameters

level_resource :

string

The name of a currently loaded level resource.

index :

integer

The index of the unit.

Returns

stingray.DynamicData

A dynamic data object for the unit.

This allows you to extract the same script data that is accessible through Unit.get_data() without spawning the level.

Parameters

level_resource :

string

The name of a currently loaded level resource.

unit_name :

string

The name of the unit resource.

Returns

integer[]

A list of unit indices.

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
Parameters

level_resource :

string

The name of a currently loaded level resource.

object_set_name :

string

An object set inside the level resource.

Returns

integer[]

A list of unit indices belonging to the object set.

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
Parameters

level_resource :

string

The name of a currently loaded level resource.

unit_index :

integer

The index of the unit.

Returns

stingray.Vector3

The position of the unit set up in the level resource.

Parameters

level_resource :

string

The name of a currently loaded level resource.

unit_index :

integer

The index of the unit.

Returns

stingray.Quaternion

The rotation of the unit set up in the level resource.