Packages
API packages
API packages provide functions that can be called by scripts. I.e. it is a script-to-engine interaction.
A package can be loaded with require('<package name>').
It can not be overloaded even if there is a lua file with the same name.
The list of available packages is different for global and for local scripts.
Player scripts are local scripts that are attached to a player.
Package |
Context |
Description |
|---|---|---|
menu player |
Controls background sounds for given player. |
|
local |
Animation controls. |
|
global menu local load |
Timers and callbacks. |
|
player |
Controls camera. |
|
load |
Content manipulation. |
|
global menu local load |
Functions that are common for both global and local scripts |
|
player |
Collection of debug utils. |
|
menu player |
User input. |
|
global menu local load |
Public interfaces of other scripts. |
|
global menu local load |
API to work with markup languages. |
|
menu |
Main menu functionality, such as managing game saves |
|
local |
Read-only access to the nearest area of the game world. |
|
player |
Controls post-process shaders. |
|
local |
Full access to the object the script is attached to. |
|
global menu local load |
Storage API. In particular can be used to store data between game sessions. |
|
global menu local |
Functions for specific types of game objects. |
|
menu player |
Controls user interface. |
|
global menu local load |
Defines utility functions and classes like 3D vectors, that don’t depend on the game world. |
|
global menu local load |
Read-only access to data directories via VFS. |
|
global |
Read-write access to the game world. |