Write Outpost 2 missions in Lua - no compiler, no DLL authoring.
OP2LuaSDK is everything you need to make your own Outpost 2 missions in Lua. You do not build
or compile anything - the runtime (OP2LuaCore.dll) is prebuilt and included. You write two small
(or large) text files and you have a mission.
| File | What it is |
|---|---|
cMyMission.placement.lua |
Players, starting units, resources, beacons, named regions. The starting layout. |
cMyMission.lua |
What happens during the mission (timers, attack waves, win/lose, reactions). |
That is the whole job: edit Lua, drop the files in the game, play. Missions are
multiplayer-safe by construction (see docs/API.md).
OP2LuaSDK/
README.md - you are here
INSTALL.md - where files go (Outpost 2 1.4.1 folder layout)
bin/
OP2LuaCore.dll - the prebuilt runtime (drop into OPU). Ships once, runs every mission.
LuaMission.dll - the mission stub template (used by the new-mission tools)
docs/
API.md - the full mission scripting API reference
GETTING-STARTED.md - write your first mission, step by step
LOGGING.md - the logging/debug standard (Main / Mission / AI logs, in-game AI events)
samples/ - complete, commented missions to play and learn from
hold-the-line/ - DEFENSE: survive escalating waves
strike-team/ - OFFENSE: destroy the enemy Command Center
the-convoy/ - ESCORT: get a cargo truck to safety
hold-the-beacon/ - CONTROL: hold a region for a set time
seek-and-destroy/ - HUNT: destroy scattered enemy outposts
cold-front/ - COLONY: build, survive a volcanic eruption, evacuate to the starship
(living AI base, lava disaster, difficulty, starship victory; see its README.md)
cataclysm/ - SURVIVAL: keep your Command Center standing through every disaster type
(meteor, quake, storm, vortex, eruption, blight) on eden01.map
disaster-director/ - HELPER: a copy-paste random/weighted disaster scheduler (meteor, quake,
storm, vortex, lava, blight) with base-targeting and a min-gap timer
tools/
op2lua-newmission.exe - scaffold a new named mission, Windows (DLL + skeleton scripts)
op2lua-newmission - the same tool, prebuilt for Linux (x86-64, static). `chmod +x` it.
new-mission.ps1 - the same scaffolder as a PowerShell script (Windows)
(macOS / other: build from source - op2lua-newmission/ in the OP2Lua repo)
- Install the runtime. Copy
bin/OP2LuaCore.dllinto your Outpost 2OPUfolder (seeINSTALL.mdfor the exact path on 1.4.1). - Play a sample. Copy the three files from a
samples/folder (e.g.hold-the-line/) intoOPU\maps\LUA\, launch Outpost 2, and pick it from the Colony Games list. (A mission lists under Colony Games when its.dllfilename starts withc- seeINSTALL.md.) - Read its
.lua. Opensamples/hold-the-line/HoldTheLine.lua- that's the entire mission. - Make your own. Run
tools/op2lua-newmission "My First Mission"(ortools/new-mission.ps1 -Name "My First Mission") and edit the two.luafiles it generates. Seedocs/GETTING-STARTED.md.
You never open a compiler. The only files you ever edit are .lua text files.
When you place a unit, use the coordinates shown on the in-game status bar (hover a tile to read them - the same numbers OP2MissionEditor shows):
{ type = "Lynx", player = 1, at = { 30, 54 } } -- appears at 30,54 in-gameNo offsets to remember - type what you see, the unit lands there.
A visual editor for building mission layouts. Load a map as the backdrop, place units, draw regions, set mission properties, and save it straight to placement.lua. It also scaffolds new missions (clones + names the stub DLL) so you can go from blank to playable without touching a compiler.
Outpost 2 multiplayer is a lockstep simulation, so missions must behave identically on every
player's machine. The SDK makes the safe path the easy path: use the scheduler (after/every/
when), use game.rand for randomness, and you're deterministic by default. The full rules are a
short read at the bottom of docs/API.md.
- Full API:
docs/API.md - Tutorial:
docs/GETTING-STARTED.md - Place layouts visually: OP2MissionEditor -
load a map and drag units/structures/beacons/regions into place, then save an
.opm. - Convert
.opm->placement.lua: OP2OpmTools - turns a saved.opminto a mission'splacement.lua. - The engine itself (building
OP2LuaCore.dll, internals): the separate OP2Lua repo. You don't need it to make missions.
