Mission Playbook
Editor extension that provides a **Mission Playbook** - a scripted sequence of mission attempts used to batch-test career progression, rewards, and unlock chains.
Editor extension that provides a Mission Playbook - a scripted sequence of mission attempts used to batch-test career progression, rewards, and unlock chains.
Overview
The playbook is a list of missionAttempt instructions, each specifying a mission ID and which stars to unlock. Playing the book executes all attempts sequentially via gameplay_missions_progress.generateAttempt, allowing developers to simulate full career progressions and inspect results.
Module Interface (M)
| Function | Description |
|---|---|
M.onEditorInitialized() | Registers window and menu item under "Missions". |
M.onEditorGui() | Main draw loop: menus, instruction list, book viewer. |
M.onEditorRegisterPreferences() | Placeholder for preferences. |
M.show() | Shows the playbook window. |
M.drawBookViewer() | Page slider and condensed-mode toggle. |
M.onSerialize() → data | Saves book and condensed state. |
M.onDeserialized(data) | Restores book and condensed state. |
Dependencies
gameplay_missions_missionseditor_missionPlaybook_attributeViewereditor_missionPlaybook_unlockedMissionsViewereditor_missionPlaybook_missionTreeViewer
Book Structure
M.book = {
page = 1, -- current viewing page
instructions = {}, -- array of instruction tables
results = {} -- array of result data per step
}Instruction Format
{ type = "missionAttempt", missionId = "italy/delivery/001-mattress", stars = { piecesBronze = true } }Menu Actions
File Menu
| Action | Description |
|---|---|
| Clear | Reset book to empty |
| Save as... | Save to .missionPlaybook.json |
| Load | Load from file |
Run Menu
| Action | Description |
|---|---|
| Play | Execute all instructions with current career |
| Play with Empty Slot | Create clean career slot, then play |
Util Menu
| Action | Description |
|---|---|
| Clear Testing Slot | Reset to fresh career save slot |
Generate Menu
| Action | Description |
|---|---|
| All Missions | Generate attempts for all remaining stars |
| Only Tier N | Filter by branch tier |
| Only N stars | Limit attempt count |
| Only Default/Bonus Stars | Filter star type |
| Per-branch filters | Generate for specific career branches |
Internal Functions
| Function | Description |
|---|---|
play(untilIdx) | Executes instructions up to index, stores results |
getAllRemainingStarCombos(params) | Finds all missions with unearned stars, builds instruction list |
generateAndPlaybook(params) | Auto-generates and immediately executes a full playbook |
savePlaybook(book, savePath) | Writes book to JSON |
loadPlaybook(filename) | Reads book from JSON |
Usage Example
-- Show the playbook window
editor_missionPlaybook.show()
-- Access the current book
local book = editor_missionPlaybook.book
print(#book.instructions, "instructions")
print(#book.results, "results")Module Variables
dependencies(table) -{'gameplay_missions_missions', 'editor_missionPlaybook_attributeViewer', 'editor_missionPlaybook_unlockedMissionsViewer', 'editor_missionPlaybook_missionTreeViewer'}book(table) - Current playbook data (page, instructions, results).
Additional Exports
M.dependencies
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Mission Editor
Main editor tool for creating, editing, and managing gameplay missions. Provides a full ImGui interface for mission properties, conditions, career setup, objectives, start triggers, and flowgraph inte
Mission Start Position Editor
Editor extension providing a **3D edit mode** for visually repositioning mission start trigger positions in the viewport.