Luau API reference¶
Generated by Apogee.Runtime --luau-docs from the engine's registry: do not edit. The same information, as type definitions for luau-lsp, is apogee.d.luau (--luau-defs).
Globals¶
What the host sets in the VMs it runs scripts in.
world:World. The world the script runs in (--run sets it).physics:PhysicsWorld. The physics of the world: give entities bodies withphysics:add_body, ask what is where withphysics:raycast. It is stepped before the world each frame.audio:AudioSystem. The game's sound:audio:load_soundand the sounds it plays need OpenAL Soft installed (audio.is_activesays); an entity with the AudioListener component is the ear.steam:SteamSystem. The game's connection to Steam (the base game only; mods cannot use it): achievements, stats, leaderboards, rich presence, the overlay, cloud saves and Workshop mods.steam.is_activesays whether Steam is running; when it is not every call does nothing.net:NetSystem. The game's network (the base game only; mods cannot use it):net:listen(port)andnet:connect(address)makeNetConnections,connection:send(text)sends, and the signalsconnection_requested,connected,messageanddisconnectedsay what happened.net.is_activesays whether the network library is installed; when it is not every call does nothing.models:ModelLibrary. The models entities draw:models:load(path)returns the id to put in aModelRenderercomponent (the same id for the same path, 0 means none). A game with an entity that has theMainCameracomponent is drawn through it;Lightentities light it.ui:UiSystem. The game's user interface:ui:load_document(path)loads RML from a file,ui:create_document()makes an empty one; documents can carry<script>s,on*attributes and data models (ui:open_data_model); elements areUiElements you make, move and listen to. It is sized to the screen, fed the player's input, and drawn over the picture.input:InputActionRouter. The player's input as actions: define them oninput.map, setinput.contextseach frame, readinput:get_strength(action)and connectinput.action_fired.settings:Settings. The player's settings, kept inuser://settings.xml:settings:define(key, spec)the ones your game or mod needs,settings:getandsettings:setthem, and connectsettings.changed. The engine's own (window.*,graphics.vsync,audio.volume) are defined; a mod can change onlymod.<its id>.*.
Classes¶
- AssetLibrary: Asset identity for scripts, as the global assets: an asset is named by its path (res://models/car.glb), which people read, and has a UID (uid://4k2m9x7q1w3ze), which stays the same when the file is renamed or moved.
- AudioBus: A bus of the mix: a group of sounds with a volume, a mute and a pause of its own (Music, Vehicles, Environment, UI).
- AudioSound: A sound file loaded by AudioSystem.LoadSound: play it any number of times, on any bus.
- AudioSystem: The game's audio, on OpenAL Soft: sounds (WAV, FLAC, MP3, Ogg Vorbis) played in 3D around the entity that has an AudioListener, on buses, with reverb zones and occlusion.
- AudioVoice: Something that is playing, or about to: a sound on a source (AudioSound.Play).
- BodyDesc: What a body is made of and how it behaves: the shape, how it moves, its mass, surface and layers.
- CharacterController: A walking character: a capsule that slides along walls, climbs stairs and slopes, sticks to the ground going down and stands on moving platforms, without being a rigid body (Jolt's CharacterVirtual).
- Hitch: A hitch on a vehicle: a point on its body where an attachment or a trailer is attached.
- InputActionMap: Every action the player can bind, where each works (its contexts) and what it is bound to.
- InputActionRouter: Turns the player's input into the actions of an InputActionMap that fire in the active contexts, and says how far analog actions are pushed.
- ModelLibrary: The models that entities draw (ModelRenderer.Model is an id from here; scripts see this as models).
- NetConnection: One connection to another program, made by NetSystem.Connect or accepted by a NetSystem.Listen.
- NetSystem: The game's network: connections to other programs over UDP, with encryption, in order and reliably or not as each message asks (GameNetworkingSockets, Valve's open-source transport).
- PhysicsShape: A collision shape: an immutable thing a body (or another shape) is made of, in the body's local space.
- PhysicsWorld: The physics simulation of one ECS World: Jolt Physics with double-precision positions, stepped at a fixed rate.
- Settings: The player's settings, as the settings global: typed values under dotted keys (audio.volume, mod.coolmod.show_hints) that the engine and the game define (SettingDef), kept in user://settings.xml as the ones that differ from their defaults.
- SteamSystem
- Tween: An animation that tween.value, tween.property and tween.field start: a number, a vector, a colour (a linear-RGB vector) or a rotation (slerped) moving from one value to another over some seconds, with an easing curve.
- UiDataModel: A data model: a script's table tied to documents.
- UiElement: An element of a document (a div, a text node, a whole document) as scripts hold it.
- UiEvent: An event that reached a listener (UiElement.Listen).
- UiSystem
- Vehicle: A vehicle on a dynamic body: wheels with suspension and tires, or tracks, an engine and a clutch (Jolt's VehicleConstraint).
- VehicleDesc: A vehicle: its engine, drivetrain and wheels.
- WheelDesc: One wheel of a vehicle.
- World
Libraries¶
- debug_draw: Debug drawing for Luau scripts, as the global table debug_draw: lines and shapes that last one frame, drawn over the world.
- defs
- devtools: The devtools table of scripts: when to draw, and what to show in the debug window.
- fs
- game: What a game asks of the program that runs it, as the script table game: ending the run (a menu's Quit), and whether the Escape key still ends it.
- imgui: Dear ImGui for Luau scripts, as the global table imgui: snake_case functions over the same calls the dev tools use.
- packages
- task
- tween
- xml
Enums¶
See Enums.