LuaScript

LuaScript
ID 184
Category Tools/effects
Sublayer width 14

Scriptable object, write your own Lua programs that can interact with and control the level. This allows for more complex creations and games, being able to draw arbitrary graphics and more.

Lua is a small programming language that focuses on being easily embeddable within other programs. You may have stumbled upon it being used somewhere else. Every program implements its own API on top of the Lua standard library, including Principia. Don't expect any non-standard Lua standard library extensions provided in other programs to necessarily exist in Principia.

Principia uses Lua version 5.2, so any generic tutorials for Lua 5.2 should apply to Principia as well. For general information about the programming language see the Lua 5.2 Reference Manual.

For help with Lua you can ask either in the #lua channel in the Principia Discord or in the Lua forum.

Libraries

The following built-in libraries are available in the Principia Lua environment:

API reference

In addition to the reference, you can see LuaScript/Examples for small complete examples that use the API.

Other resources