The interface to access the mod system.
Other related reference items
info ( mod ) : stringReturns an information file about the mod.
|
mod : | integer | The index of the mod whose details you want to retrieve. |
string |
The information file about the mod. |
This is typically a Lua file that is executed in a sandbox environment.
is_scanning ( ) : booleanIndicates whether or not the system is currently scanning for mods.
|
This function does not accept any parameters. |
boolean |
Returns true if a mod scan is in progress, or false otherwise. |
mods ( ) : integer[]Returns a list of indices that identify all the available mods.
|
This function does not accept any parameters. |
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. |
release_resource_package ( rp )Releases a resource package allocated with stingray.Mod.resource_package().
|
rp : | The resource package you want to release. |
This function does not return any values. |
Other related reference items
resource_package ( mod, name ) : stingray.ResourcePackageReturns the resource package with the specified name from the mod.
|
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 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().
Other related reference items
set_security_options ( options )Sets the security options for the engine.
|
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. |
This function does not return any values. |
This is useful when running untrusted data (mods).
For example:
set_security_options(stingray.Mod.FLOW_SCRIPT_NODES_ENABLED, true, stingray.Mod.FLOW_CUSTOM_SCRIPT_TABLES, "FlowCallbacksLevel1", "FlowCallbacksLevel2")
Other related reference items
start_scan ( ) : booleanStarts scanning for mods.
|
This function does not accept any parameters. |
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.
The security options listed in this group can be passed as arguments to stingray.Mod.set_security_options().
FLOW_CUSTOM_SCRIPT_TABLES : integerSpecifies the names of the global tables that can be used by custom script nodes.
|
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.
Other related reference items
FLOW_SCRIPT_NODES_ENABLED : integerControls whether or not the flow nodes that allows the user to call arbitrary functions (Script Do String, Script Call Global) are enabled or disabled.
|
Even when disabled, custom script nodes can still be used. The value you set for this option must be a boolean.
Other related reference items