Lua API reference
169 classes and 242 functions for Evospace 0.22.2. 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
--- @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
- Biome Terrain biome definition
- BiomeFamily Biome that picks one of its sub-biomes per position
- BiomeWorldGenerator World generator driven by a global biome family
- Component Typed data every block of a type keeps from its placement, listed by StaticBlock.components; saved by field name and part of the sim state
- GhostStaticBlock Static block placed as a build ghost
- GlobalBiomeFamily Planet wide biome family that also drives the global height map
- HeightGenerator Terrain height built from a stack of noises
- ItemGroup Recipe ingredient that any one of its member items satisfies, one for one
- LogicExportOption One exportable signal option shown in the logic GUI
- LogicImportOption One importable signal option shown in the logic GUI
- LuaWorldGenerator World generator assembled from Lua defined biomes and heights
- NoiseGenerator Configurable FastNoise generator
- Prototype Database record
- Recipe Crafting-recipe prototype used by machines and crafting UIs
- RecipeDictionary Named group of recipes shared by machines of one family
- Setting Configurable game setting
- StaticAchievement Achievement progress record
- StaticBlock Placeable block prototype
- StaticChapter Group of quests unlocked together
- StaticCover Instanced mesh design used to skin blocks
- StaticCoverSet List of covers allowed by the design tool and designable blocks
- StaticItem Item prototype
- StaticItemPanel Block the recipe screen shows above the recipes of an item
- StaticModifier Bonus a research adds to a machine stat
- StaticObject Base prototype for anything placeable in the world
- StaticOreVein Ore vein every world places in the rock its targets replace, tried Count times per 16x16 column
- StaticPlanet Celestial body with its own day cycle in world ticks
- StaticPlayer What a player starts with and crafts in hand; the game reads the one named Player
- StaticProp Decoration prototype scattered by the world generator
- StaticPropList Prototype asset that owns several PropListData records
- StaticQuest Quest definition and its runtime progress
- StaticResearch Research base class
- StaticResearchBonusInventory Research granting extra player inventory slots
- StaticResearchDecorationUnlock Research unlocking decorations built from building material
- StaticResearchEfficiency Research adding a productivity bonus to a recipe
- StaticResearchModifier Research raising a global player modifier
- StaticResearchRecipe Research unlocking a set of recipes
- StaticResearchToolUnlock Research unlocking a player tool
- StaticStructure Map generation script object with a footprint
- StaticTip Encyclopedia entry shown to the player
- StaticWeather Weather preset a biome shows for one severity band
- Tesselator Sector mesh builder prototype
- TesselatorCube Sector mesh builder of cube blocks
- TesselatorMarching Sector mesh builder of smooth terrain
- WorldGenerator Terrain generator bound to a dimension
Block logic
- AbstractCrafter Base class for recipe processing machines
- AdminElectricGeneratorBlockLogic Creative generator producing unlimited power
- AutoCrafter Crafter that picks its recipe from the input inventory
- BedBlockLogic Bed used as a respawn point
- BlockLogic Runtime state of a placed block
- ChestBlockLogic Chest storage block
- ComputerBlockLogic Block that speeds up nearby machines
- ConductorBlockLogic Wire block carrying a resource network
- ConveyorBlockLogic Belt carrying one item per half cell
- DeepStorageBlockLogic Powered storage block holding one item type
- DesignableCoverBlockLogic Block whose center cover can be redesigned in game
- DesignableFenceBlockLogic Fence block connecting to its neighbors
- DoorBlockLogic Door the player can open and close
- DrillingMachineBase Base class of resource extracting machines
- DrillingRig Drilling machine that extracts ore from the ground
- ElectricityContainerBlockLogic Electricity storage node of a conductor network
- EnvironmentCrafter Crafter powered by solar or wind environment
- FenceBlockLogic Fence that connects to its neighbours
- FluidContainerBlockLogic Fluid storage node of a conductor network
- GhostBlockLogic Placeholder waiting to be materialized into a real block
- HeatContainerBlockLogic Heat storage node of a conductor network
- ItemRackBlockLogic Storage block holding one item type
- LandingPadBlockLogic Landing pad deliveries arrive on
- LedBlockLogic Screen lit by logic signals
- LoaderBaseBlockLogic Loader or robot arm taking items on its left side
- Pumpjack Drilling machine that extracts oil from deposits
- SelectCrafter Crafter with a player selected recipe
- SingleRecipeCrafter Crafter bound to the only recipe of its dictionary from the moment it is spawned; the recipe cannot be picked, found or reset
- SplitterBlockLogic Belt junction feeding several sides
- SpotlightBlockLogic Aimable colored spotlight
- StackedContainerBlockLogic Storage node whose covers merge into a vertical column
- StorageBlockLogic Base class for blocks that expose a storage inventory
Inventories
- AutosizeInventory Inventory that grows and shrinks with its contents
- BaseInventory Inventory storage base with slots, filter and capacity
- Inventory Multi slot inventory
- RecipeInventory Inventory that mirrors the slots of a recipe
- ResourceInventory Single slot inventory holding one resource item
- SingleSlotInventory Inventory with exactly one slot
Accessors
- Accessor Block side attachment point
- BaseInventoryAccessor Accessor that moves items in and out of a block
- ResourceAccessor Accessor that transfers a resource through a block side
Widgets
- ui.Border Plate drawn behind one child; padding is kept inside the plate
- ui.Button Button around one child; padding is kept inside the button
- ui.Grid Grid of equal cells, filled row by row
- ui.HBox Row of children laid out left to right
- ui.Image Picture of a texture, 64 by 64 unless its width and height say otherwise
- ui.Inventory Grid of item slots showing an inventory with the game's own slot widget
- ui.Scroll Vertical list that scrolls instead of overflowing
- ui.Spacer Empty space as wide and tall as its width and height
- ui.Text 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.TextBox Single line the player types into
- ui.VBox Column of children laid out top to bottom
- ui.Widget Base of every widget. A widget is built by calling its class with a table: named fields set its properties, the list part holds its children; ui.Text, ui.Window and ui.Button also take their main field alone, as ui.Text "...", ui.Window "..." and ui.Button(fn)
- ui.Window Top level window with a title bar the player can drag it by; its width and height size the window, its padding is kept around the content
World actors
- Actor World actor
- AnimatedBlockActor Block actor driven by the animation manager
- BlockActor World actor representing a placed block
- Dimension Playable surface holding the block world
- Player Local player controller
Instances
- Console Engine console
- DB Prototype database filled by mods
- EquipmentSlotFilter Filter that accepts items declaring the matching equipment slot
- GameSessionData Settings and counters of the current save
- GraphicsSettings Engine graphics quality settings
- Instance Instancable object
- InventoryAccess Inventory interface with add and remove operations
- InventoryBlackFilter Filter that rejects listed items
- InventoryContainer Composite inventory joining several inventories into one
- InventoryFilter Base class for inventory slot filters
- InventoryInventoryFilter Filter driven by the contents of another inventory
- InventoryReader Read only inventory interface
- InventoryWhiteFilter Filter that accepts only listed items
- LogicDecider Condition paired with the signals it emits
- LogicSettings Per-block choice of exported and imported logic signals
- QuestObjective Single trackable goal of a quest
- Region Square of the world map holding sources and structures
- RegionMap Grid of regions covering the surface
- SourceData Resource deposit placed on the map
- SurfaceDefinition Generation setup of one planetary surface
- Train Train on the railway of a surface. Schedule edits go out to the other peers the way the train window sends them and land at the host's stamped tick
- TrainScheduleStop One entry of a train schedule
Namespaces
- cs Block, sector and world coordinate conversions
- defines.block_state Values BlockLogic.state takes
- defines.events Identifiers of the gameplay events the event bus can emit
- defines.quest_state Values StaticQuest.state takes
- hud The player's own heads-up display
- sim Simulation tick scheduler
- ui
- weather Runtime weather control
Values and engine objects
- ActorComponent Engine actor component
- AnimSequence Engine skeletal animation sequence
- Class Engine class object
- Color 8 bit per channel RGBA color
- Engine Player facing engine and video settings
- EventSystem Gameplay event bus
- ExtractionData Item yielded by a resource deposit and its extraction speed
- FQuat Rotation quaternion
- Game Global game instance
- GenContext Column being generated, handed to StaticStructure.generate
- ItemData Item prototype paired with a count
- Kto Localization key table object
- Loc Localization data entry
- LocData Non localized data entry
- MapStructure Structure placed on the world map at an offset
- Material Engine material
- Music Background music playback control
- Object Engine object
- OreVeinTarget Rock an ore vein grows through and the ore block it leaves in that rock
- PlayerController Player input and view owner
- PropListData Structure that stores several StaticProp records (prop variations) with shared spawn chance
- QuestSubsystem Quest and chapter progression manager
- Railway Tracks, signals, stations and trains of a surface. Edits go out to the other peers the way the rail tools send them and land at the host's stamped tick
- RecipeItemData Per slot recipe metadata carried next to the item and its count
- RenderTexture Texture the game renders into, such as a block thumbnail
- Rotator Euler rotation in degrees
- SoundClass Engine sound class
- StaticMesh Engine static mesh
- TallSectorData Column of generated block cells
- Texture Engine texture, anything a picture can be drawn from
- Texture2D Texture loaded from an image, such as an item icon
- Transform Location, rotation and scale of an object
- Vec2i Integer vector 2
- Vec3 Float vector 3
- Vec3i Integer vector 3