API ReferenceGE Extensionseditor
Road Template Editor
Editor window for creating, editing, saving, and loading road templates - composite road definitions with multiple DecalRoad layers, 3D decorations, and random decal patterns.
Editor window for creating, editing, saving, and loading road templates - composite road definitions with multiple DecalRoad layers, 3D decorations, and random decal patterns.
Public API
| Function | Signature | Description |
|---|---|---|
M.onEditorGui | () | Main editor GUI - template selection, road/decoration/decal management |
M.onEditorInitialized | () | Registers the Road Template Editor window and preferences |
M.onEditorRegisterPreferences | (prefsRegistry) | Registers roadTemplates.general.loadTemplates preference |
Dependencies
| Dependency | Purpose |
|---|---|
editor_roadEditor | Required for road creation/editing API |
Template Structure (JSON)
{
header = { type = "roadTemplate", version = 1.1 },
roads = { ... }, -- Array of DecalRoad field sets
decorations = { ... }, -- Array of decoration definitions (shapeName, distance, period, rotation, zOff, align, randomFactor)
decals = { ... }, -- Array of random decal definitions
}Key Features
- Template gallery: Visual thumbnail grid of available templates from level's
roadtemplates/folder - Multi-road support: Templates can contain multiple DecalRoad layers with relative positioning
- Decoration system: Place 3D shapes (props) along roads with configurable spacing and randomization
- Random decals: Procedurally-placed decal patterns along roads with probability and size controls
- Save/Load: Templates stored as
.road.jsonfiles inlevels/<levelName>/roadtemplates/
Usage Example
-- Templates are managed through the editor window:
-- Window → Roads → Road Template Editor
-- Preferences control whether templates load at startup:
editor.setPreference("roadTemplates.general.loadTemplates", true)Module Variables
dependencies(table) - Module variable.
Module Variables
dependencies(table) - Module variable.
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
Road Spline Editor
Main editor tool for creating and managing road splines - multi-layered DecalRoad-based road systems with support for materials, auto-generated detail layers, terrain painting, undo/redo, bitmap impor
Road Utilities
Utility module for road template operations - handles template loading, child road creation, decoration placement, random decal generation, and material management.