Naikari Lua API
This is the API used in Naikari to interact with the game from Lua.
Lua is a relatively simple scripting language used for a large portion of Naikari's content. Missions, events, GUIs and AIs are all written using Lua and Naikari's API, as are many minor features such as system backgrounds, reputation handling and others.
The API documentation provides common usage examples for each function.
Most API modules can also be used from the in-game Lua console (accessible by pressing F2 by default) for cheating experimenting to your heart's content.
Modules
ai | Controls the Pilot AI. |
fleet | Functions for adding fleets of pilots. |
fmt | Functions for formatting strings. |
misnhelper | Generic mission-helping functions. |
audio | Lua bindings to interact with audio. |
bkg | Lua bindings to interact with the background. |
camera | Lua bindings to interact with the Camera. |
canvas | Lua bindings to interact with canvass. |
colour | Lua bindings to interact with colours. |
commodity | Lua bindings to interact with commodities. |
data | Lua bindings to interact with datas. |
debug | Handles the Lua debug bindings. |
diff | Lua bindings to apply/remove Universe Diffs. |
evt | Event system Lua bindings. |
faction | Lua bindings to deal with factions. |
file | Lua bindings to interact with files. |
font | Lua bindings to interact with fonts. |
gfx | Lua bindings to interact with rendering and the Naev graphical environment. |
gui | Lua bindings to interact with the GUI elements. |
hook | Lua bindings to manipulate hooks. |
jump | This module allows you to handle the jumps from Lua. |
misn | Mission Lua bindings. |
music | Music Lua module. |
naik | Naikari generic Lua bindings. |
news | Lua bindings to interact with the news. |
outfit | Lua bindings to interact with outfits. |
pilot | Lua bindings to interact with pilots. |
planet | This module allows you to handle the planets from Lua. |
player | Lua bindings to interact with the player. |
rnd | Bindings for interacting with the random number generator. |
shader | Lua bindings to interact with shaders. |
ship | Lua bindings to interact with ships. |
shiplog | Bindings for adding log entries to the ship log. |
system | Lua system module. |
tex | Lua bindings to interact with OpenGL textures. |
time | Bindings for interacting with the time. |
tk | Bindings for interacting with the Toolkit. |
transform | Lua bindings to interact with transforms. |
var | Mission variable Lua bindings. |
vec2 | Represents a 2D vector in Lua. |
pilotname | Pilot name generating functions |
portrait | Functions for handling portraits in Naikari. |
prng | Simple deterministic Lua PRNG. |
tablehelper | Functions which assist with working with tables. |