API ReferenceGE Extensionseditor
Road Decorations
Utility module for placing repeating props (TSStatic objects) along DecalRoad edges at configurable intervals.
Utility module for placing repeating props (TSStatic objects) along DecalRoad edges at configurable intervals.
Overview
Provides functions to place decoration objects along both sides of a DecalRoad at regular intervals. Calculates offset positions from road edges and optional alignment between sides.
Public API
| Function | Signature | Description |
|---|---|---|
M.decorateProps | M.decorateProps(roadName, shapeName, distance, period, rotation, zOff, align) | Places props along both sides of a road at given intervals. Returns SimGroup ID. |
M.findOffsetPoint | M.findOffsetPoint(spline, length, distance, left) | Calculates a point offset from a road spline at given distance. |
Parameters for decorateProps
| Parameter | Type | Description |
|---|---|---|
roadName | string/number | DecalRoad object name or ID |
shapeName | string | Path to .dae/.dts shape file |
distance | number | Lateral offset from road edge (meters) |
period | number | Spacing between placements (meters) |
rotation | quat/nil | Additional rotation applied to props |
zOff | number | Vertical offset from terrain height |
align | boolean | If true, left/right props placed at same road length |
Internal Functions
| Function | Description |
|---|---|
findOffsetPoint(spline, length, distance, left) | Walks spline to find position at given length with lateral offset |
findOppositePoint(rightPoint, rightEdgePosition, roadNormal) | Mirrors a right-side point to the left side |
placeDecoration(group, roadName, idx, shapeName, pos, rot) | Creates and registers a TSStatic in a SimGroup |
Usage Example
-- Place reflectors every 25m, 2m from road edge
local groupId = extensions.editor_roadDecorations.decorateProps(
9459, "levels/driver_training/art/shapes/objects/reflector.dae",
2, 25, nil, 0, true
)See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Road Architect Editor
Full-featured road design tool for creating multi-lane roads with profiles, junctions, groups, and terraforming. Requires Tech license.
Road Editor (Decal Road)
Editor extension for creating and editing DecalRoad objects: node manipulation, road selection, duplication, templates, and material filtering.