Script

From Blue Mars Developer Guidebook

Jump to: navigation, search
There are security restrictions on this article

Overview

These functions are mostly used by top-level scripts such as 'Game/Scripts/main.lua;.

See Entity functions for controlling entity scripts.

Loading/Unloading

ReloadScripts()
reload all scripts previously loaded
example - none
ReloadScript(filename)
Executes the script file.
ReloadEntityScript(className)
reload the entity script file for a class. Similar to LoadScript/ReloadScript.
LoadScript(filename, reload, failonerror)
Executes the script file. Any global variables and function definitions will persist for the lifetime of the script system.
UnloadScript(filename)
Remove script from the list of already-loaded scripts. Typically used to force a later reload of the script.
example - none
DumpLoadedScripts()
For debugging - print to the console and log names of all loaded scripts.
example - none

Timers

SetTimer(nMilliseconds,Function)
SetTimerForFunction(nMilliseconds,Function)
KillTimer(nTimerId)
Problems with this wiki page? Contact us either by: Support Email or Support Ticket System

Blue Mars Guidebook Privacy Policy
Blue Mars Guidebook Community Guidelines

Personal tools