API ReferenceGE ExtensionseditorcrawlEditor
Crawl Editor Paths
Class-based path and pathnode editor for the Crawl Editor. Manages path creation, node selection, gizmo manipulation, and the ImGui detail panel.
Class-based path and pathnode editor for the Crawl Editor. Manages path creation, node selection, gizmo manipulation, and the ImGui detail panel.
Constructor
local Paths = require('editor/crawlEditor/paths')
local pathEditor = Paths(crawlEditorRef)Class Methods
| Method | Signature | Description |
|---|---|---|
C:init(crawlEditor) | Initialize with parent crawl editor reference | |
C:setPath(path) | Set the active path object | |
C:selectPathnode(index) | Select a pathnode by index | |
C:getSelectedPathnodeIndex() | → number | Returns selected pathnode index |
C:drawPathsList(allPaths, selection) | Renders selectable list of paths with Add/Delete | |
C:drawPathDetail(path) | Renders path name, description, file rename, and node list | |
C:getNewPath() | → table | Creates a new empty path template |
C:getNewPathnode() | → table | Creates and appends a new node to the current path |
C:findPathnode(mouseInfo, objects) | → table/nil | Raycasts to find closest pathnode sphere under mouse |
C:tryInsert(mouseInfo) | Alt-click inserts a node at midpoint between existing nodes | |
C:input(mouseInfo) | Handles Shift-click (add), Alt-click (insert), click (select) | |
C:draw(mouseInfo) | Updates gizmo, processes input, draws axis gizmo | |
C:drawPathnodeSelectionIndicators(mouseInfo) | Debug-draws spheres, direction arrows, segments between nodes | |
C:dropToTerrain(pos) | → vec3, bool | Snaps position to terrain height |
Node Flags
| Flag | Type | Description |
|---|---|---|
isRecoveryCheckpoint | boolean | Green color indicator, recovery spawn point |
isBonusCheckpoint | boolean | Gold color indicator, bonus scoring |
Usage Example
local pathEditor = require('editor/crawlEditor/paths')(crawlEditor)
pathEditor:setPath(myPath)
pathEditor:selectPathnode(1)
pathEditor:draw(mouseInfo)Notes
- Supports undo/redo via
editor.history:commitAction - Snap to terrain enabled by default (
self.snapToTerrain) - Gizmo supports translate and rotate modes
- Shift-click adds node at mouse position; Alt-click inserts between existing nodes
- Path rename uses
editor_crawlEditor.renameObjectFile
All Class Methods
| Method | Signature | Description |
|---|---|---|
C:init(crawlEditorParam) | Initialize with parent crawl editor reference | |
C:setFields(path) | Populate ImGui buffers from path data | |
C:setPath(pathParam) | Set the active path object | |
C:selectPathnode(index) | Select a pathnode by index | |
C:getSelectedPathnodeIndex() | → number | Returns selected pathnode index |
C:setSelectedPathnodeIndex(index) | Sets selected pathnode index (calls selectPathnode) | |
C:drawPathsList(allPaths, selection) | Render selectable list with Add/Delete context menu | |
C:drawPathDetail(path) | Full detail panel: name, file rename, description, node list with flags | |
C:getNewPath() | → table | Create a new empty path template |
C:getNewPathnode() | → table | Create and append a new node to the current path |
C:findPathnode(mouseInfo, objects) | → table/nil | Raycast to find closest pathnode sphere under mouse |
C:tryInsert(mouseInfo) | Alt-click inserts node at midpoint between existing nodes | |
C:input(mouseInfo) | Handle Shift-click (add), Alt-click (insert), click (select) | |
C:updateTransform() | Set gizmo transform from selected pathnode pos/rotation | |
C:beginDrag() | Capture pre-drag state for undo | |
C:dragging() | Handle translate/rotate gizmo interaction | |
C:dropToTerrain(pos) | → vec3, bool | Snap position to terrain height |
C:endDragging() | Commit undo action, snap to terrain | |
C:draw(mouseInfo) | Main draw loop: gizmo update + input | |
C:drawPathnodeSelectionIndicators(mouseInfo) | Debug-draw spheres, direction arrows, segments between nodes |
See Also
- Crawl Editor - Boundaries - Related reference
- Crawl Editor Input - Related reference
- Crawl Editor Mission Port Tool - Related reference
- World Editor Guide - Guide
Crawl Editor Mission Port Tool
Converts old crawl mission data (bounds.sites.json + race.race.json) into the new modular crawl system (boundary, path, starting position, trail files).
Crawl Editor Presets
Class-based preset and component management for the Crawl Editor. Handles save/load/delete of trails, boundaries, and pathnode presets, plus component-level persistence via `gameplay_crawl_saveSystem`