Lua API reference

Lua API reference

161 classes and 206 functions for Evospace 0.22.1. The same list ships as type definitions for editor completion — see Evospace/lua-api. Writing a mod for the first time: start with First mod.

Globals

  • game Game Global game instance
  • db DB Global prototype database
  • engine Engine Global engine data
  • music Music Global music manager
  • quests QuestSubsystem Global quest manager
Top-level functions and values
prelude lua
--- @type boolean|nil
LuaLogFlag = false

--- Prints info to log
--- @param message string
function print_info(message) end

--- Prints error to log but do not breaks execution
--- @param message string
function print_err(message) end

--- Prints warning to log
--- @param message string
function print_warn(message) end

--- Dimension of the running session
--- @type Dimension
dim = {}

--- This mod's table of the local player, kept in the save under the player's profile: booleans, numbers, strings, Vec3i and tables of them. nil outside a game session
--- @type table|nil
storage = {}

Prototypes

Block logic

Inventories

Accessors

Widgets

  • ui.Border Single-slot border with uniform padding
  • ui.Button
  • ui.Grid Grid of equal cells, filled row by row
  • ui.HBox Horizontal container
  • ui.Image Square picture of a texture, such as an item image
  • ui.Inventory Grid of item slots showing an inventory with the game's own slot widget
  • ui.RichText Wrapping body text the way the game's descriptions read: tokens such as {item:Name} become links with icons, <blue>, <yellow>, <red> and <green> tint a run
  • ui.Scroll Vertical list that scrolls instead of overflowing
  • ui.Text Text label
  • ui.TextBox Single line the player types into
  • ui.VBox Vertical container
  • ui.Widget
  • ui.Window Top level window with a title bar the player can drag it by

World actors

Instances

Namespaces

Values and engine objects