Mission Editor – Prefabs
Editor sub-module for managing a mission's **prefab file list**. Prefabs are `.prefab.json` files spawned into the scene when the mission starts.
Editor sub-module for managing a mission's prefab file list. Prefabs are .prefab.json files spawned into the scene when the mission starts.
Overview
Manages mission.prefabs, an ordered array of file paths to prefab files. Provides UI for adding, removing, editing paths, browsing via file dialog, spawning prefabs into the scene, and toggling collision reload.
Class Methods
| Method | Signature | Description |
|---|---|---|
C:init | (missionEditor) | Stores editor reference, initialises state. |
C:setMission | (mission) | Caches mission, creates ImGui input buffers per prefab, sets collision reload flag. |
C:draw | () | Renders the prefab list with per-entry controls. |
UI Controls Per Prefab
| Control | Description |
|---|---|
| Delete button | Removes the prefab entry |
| Text input | Edit the file path directly |
... button | Opens file dialog (.prefab.json or .prefab) |
| Check/Error icon | Green check if file exists, red error if not |
| Spawn button | Spawns the prefab at origin into MissionGroup and selects it |
Additional Options
| Option | Description |
|---|---|
| Add button | Appends a new empty prefab entry |
| Requires collision reload | Checkbox; sets mission.prefabsRequireCollisionReload (only shown when prefabs exist) |
Usage Example
local prefabsTab = require('extensions/editor/missionEditor/prefabs')(missionEditorRef)
prefabsTab:setMission(currentMission)
prefabsTab:draw()
-- mission.prefabs → { "/levels/east_coast/missions/race001/cones.prefab.json" }See Also
- Mission Editor - Additional Attributes - Related reference
- Mission Editor - Career Setup - Related reference
- Mission Editor - Conditions - Related reference
- World Editor Guide - Guide
Mission Editor – Playbook Utils
Editor sub-module that provides **quick-add buttons** for inserting mission attempt instructions into the Mission Playbook from within the Mission Editor.
Mission Editor – Preview Checker
Editor sub-module that **validates and displays** a mission's preview image and thumbnail. Checks for correct file existence, dimensions, and file size.