These global functions and variables are available in all scripts.
Sleep | Suspends the script for a specified number of milliseconds |
WaitFor | Suspends the script until the specified object is "ready" |
Random | Returns a pseudo-random number from a specified range |
SetScriptTimeSlice | The script will be automatically suspended after a specified time interval |
Debug | Pauses game execution and displays a debugging console |
MakeRGBA | Packs the Red, Green, Blue and Alpha color values into one number |
GetRValue | Extracts a Red portion of a color |
GetGValue | Extracts a Green portion of a color |
GetBValue | Extracts a Blue portion of a color |
GetAValue | Extracts an Alpha portion of a color |
MakeHSL | Packs the Hue, Saturation and Luminance color component into one number |
GetHValue | Extracts a Hue portion of a color |
GetSValue | Extracts a Saturation portion of a color |
GetLValue | Extracts a Luminance portion of a color |
ToString | Converts a specified value to a string |
ToInt | Converts a specified value to an integer number |
ToBool | Converts a specified value to a boolean (logical) value |
ToFloat | Converts a specified value to a floating point number |
Game (read only) | The one and only game object reference |
Suspends the script for a specified number of milliseconds
The Sleep function suspends the script and returns control back to the engine. If you have a script that runs for a very long time, you should periodically call the Sleep function, otherwise the game will seem to be "stuck" until the script finishes.
Suspends the script until the specified object is "ready"
The object is "ready", when it doesn't perform any action (like talking, walking etc.).
Returns a pseudo-random number from a specified range
The script will be automatically suspended after a specified time interval
If you have a script that runs for a very long time, you should return control to the engine from time to time. You can do it either manually by calling the Sleep function, or you can set the time-slice interval. In that case, the engine will suspend the script automatically, perform other tasks, and return to the script again.
Pauses game execution and displays a debugging console
If debugging console isn't enabled, this function is ignored.
Packs the Red, Green, Blue and Alpha color values into one number
Returns a color value based on the specified color components
All the color components range from 0 to 255. The alpha component specifies the transparency of the resulting color. It ranges from 0 (completely transparent) to 255 (opaque).
Extracts a Red portion of a color
Extracts a Green portion of a color
Extracts a Blue portion of a color
Extracts an Alpha portion of a color
Packs the Hue, Saturation and Luminance color component into one number
Returns a color value based on the specified color components
All the color components range from 0 to 255.
Extracts a Hue portion of a color
Extracts a Saturation portion of a color
Extracts a Luminance portion of a color
Converts a specified value to a string
Converts a specified value to an integer number
Converts a specified value to a boolean (logical) value
Converts a specified value to a floating point number