Editor Level Validator
Level validation tool that scans scene objects and forest items for common issues (missing shapes, out-of-bounds placement, invalid transforms). Displays categorized logs with filtering, sorting, and
Level validation tool that scans scene objects and forest items for common issues (missing shapes, out-of-bounds placement, invalid transforms). Displays categorized logs with filtering, sorting, and per-object fix/ignore actions.
Module Overview
| Aspect | Detail |
|---|---|
| File | extensions/editor/levelValidator.lua |
| Returns | M table |
| Dependencies | core_forest |
| Window | levelValidator |
Public Functions
| Function | Signature | Description |
|---|---|---|
M.onEditorInitialized | () | Registers the validator window and Debug menu item |
M.onEditorGui | () | Renders the validator UI with log table, filters, and actions |
M.onClientStartMission | () | Hook called when a mission/level starts |
M.onExtensionLoaded | () | Extension load hook |
M.onEditorRegisterPreferences | (prefsRegistry) | Registers validator preferences |
M.onEditorAfterSaveLevel | (state) | Hook after level save |
M.onEditorPreferenceValueChanged | (path, value) | Responds to preference changes |
M.startLevelValidation | () | Triggers a full level validation scan |
M.getLevelLogs | () → table | Returns raw validation logs |
M.getLevelLogsAggregated | () → table | Returns aggregated validation logs |
Validation Features
| Feature | Description |
|---|---|
| Scene object scan | Validates all objects in the scene tree |
| Forest item scan | Validates all forest items via core_forest data |
| Terrain bounds check | Detects objects outside terrain extents |
| Log levels | Error (E), Warning (W), Info (I), Debug (D) with color coding |
| Sortable columns | LogLevel, Code, Description, Origin, ObjectName, File, Line |
| Filter by severity | Toggle E/W/I/D log level visibility |
| Ignore objects | Mark individual objects/forest items as ignored |
| Remove forest items | Direct removal of problematic forest items |
Log Entry Structure
logEntry = {
logLevel = "E", -- E/W/I/D
uniqueErrorCode = 1001, -- Numeric error code
message = "Missing shape", -- Human-readable description
origin = "sceneValidator", -- Validation source
object = simObject, -- Scene object reference (if applicable)
objectId = 12345, -- Object ID
forestItem = forestItem, -- Forest item reference (if applicable)
filename = "level.lua", -- Source file
lineNumber = 42, -- Source line
}Internal State
| Variable | Description |
|---|---|
sceneObjectNodes | Cached scene tree nodes for validation |
forestItemNodes | Cached forest item nodes |
terrainSize / terrainMinExtents / terrainMaxExtents | Terrain bounds for out-of-bounds detection |
objectLogs | Per-object validation log entries |
numberOfIssues | Total issue count |
ignoredObjects | Set of objects marked as ignored (keyed by "forest_KEY" or "object_ID") |
Usage
Access via editor menu: Window → Debug → Level Validator
-- The validator runs checks and populates logs
-- Users can filter, sort, click to select objects, and apply fixesModule Variables
dependencies(table) - Module variable.
Functions
startLevelValidation()
Handles start level validation.
getLevelLogs()
Returns the level logs.
Returns: levelLogs
getLevelLogsAggregated()
Returns the level logs aggregated.
Returns: self
onClientStartMission()
Callback for client start mission event.
onExtensionLoaded()
Callback for extension loaded event.
onEditorRegisterPreferences(prefsRegistry)
Callback for editor register preferences event.
prefsRegistry(any)
onEditorAfterSaveLevel(state)
Callback for editor after save level event.
state(any)
onEditorPreferenceValueChanged(path, value)
Callback for editor preference value changed event.
path(string)value(any)
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
Editor Level Settings
Registers a custom inspector type handler for level-wide settings, allowing level configuration to be shown in the standard inspector panel.
Editor Logger
Minimal logger extension stub. Currently a no-op placeholder that registers the `onEditorGui` and `onExtensionLoaded` hooks without implementation.