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

stingray.Mod namespace reference

Description

The interface to access the mod system.

Functions

Parameters

mod :

integer

The index of the mod whose details you want to retrieve.

Returns

string

The information file about the mod.

This is typically a Lua file that is executed in a sandbox environment.

Parameters
This function does not accept any parameters.
Returns

boolean

Returns true if a mod scan is in progress, or false otherwise.

Parameters
This function does not accept any parameters.
Returns

integer[]

A list of integer indices for all the available mods.

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

rp :

stingray.ResourcePackage

The resource package you want to release.

Returns
This function does not return any values.
Parameters

mod :

integer

The index of the mod whose resource package you want to retrieve.

name :

string

The name of the resource package within the mod.

Returns

stingray.ResourcePackage

Returns the resource package with the specified name from the mod.

The package can be loaded using the same functions you use to load any other resource package. However, resource packages returned by Mod.resource_package() must be released with stingray.Mod.release_resource_package().

Parameters

options :

any(integer, string, boolean)+

One or more of the security option constants in the Set Security Options group, each followed by the value or values to set for that option.

The + notation indicates that there may be one or more instances of the specified type.
The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.
Returns
This function does not return any values.

This is useful when running untrusted data (mods).

For example:

Parameters
This function does not accept any parameters.
Returns

boolean

Returns false if a scan is already running, or true otherwise. You cannot run multiple scans simultaneously.

You need to scan for mods before you can use the mod system. You can rescan at a later time to find changes to mods or new mods that have just been installed.

NOTE: Do not rescan while any mod packages are loaded.

Set Security Options

The security options listed in this group can be passed as arguments to stingray.Mod.set_security_options().

For example, "FlowCallbacks". Functions outside the named tables cannot be called by the custom script flow nodes. If you use an empty list (the default), the custom script flow nodes can call anything. The value you set for this option must be one or more strings.

Even when disabled, custom script nodes can still be used. The value you set for this option must be a boolean.