RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionseditor

Road Utilities

Utility module for road template operations - handles template loading, child road creation, decoration placement, random decal generation, and material management.

Utility module for road template operations - handles template loading, child road creation, decoration placement, random decal generation, and material management.


Public API

FunctionSignatureDescription
M.updateChildRoads(road)Recreates child DecalRoads from a road's template, computing widths and positions
M.reloadTemplates()Scans level's roadtemplates/ folder, loads materials, and applies templates to all roads
M.getMaterials()Returns loaded material texture objects array
M.getMaterialNames()Returns material name strings array
M.getRoadTemplateFiles()Returns array of .road.json file paths
M.reloadDecorations(road)Recreates 3D decorations for a road from its template
M.reloadDecals(road, template?)Recreates random decals for a road from its template

Key Internal Functions

FunctionPurpose
getRoadWidth(road, metres)Interpolates road width at a given metre position along the spline
randomizeDecoration(decoID, factor)Applies random position/rotation jitter to decoration objects

Template Application Flow

  1. reloadTemplates() scans for .road.json files in level's roadtemplates/ folder
  2. For each template road: applies fields to primary road, creates child roads with relative positioning
  3. Decorations are placed using roadDecorations.decorateProps() with spacing, rotation, alignment
  4. Random decals are generated with probability, size ranges, and horizontal offset

Usage Example

-- Reload all road templates (call after editing templates):
editor_roadUtils.reloadTemplates()

-- Get available template materials for UI:
local mats = editor_roadUtils.getMaterials()
for i, mat in ipairs(mats) do
  -- mat.texId for thumbnail rendering
end

Notes

  • Requires roadTemplates.general.loadTemplates preference to be true
  • Road resolution: 2 meters between sample points
  • Child roads use canSave = false - not persisted to disk
  • Calls be:reloadCollision() after template application

Module Variables

  • onEditorInitialized (nil) - Module variable.

Module Variables

  • onEditorInitialized (nil) - Module variable.

Additional Exports

  • M.onEditorInitialized

See Also

  • Editor AI Tests - Related reference
  • Editor AI Visualization - Related reference
  • Editor – Assembly Spline Tool - Related reference
  • World Editor Guide - Guide

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.

Scene Tree

The editor's scene tree window - a hierarchical tree view of all scene objects with filtering, drag-and-drop reordering, multi-selection, prefab support, virtual scrolling, and undo/redo for group ope

On this page

Public APIKey Internal FunctionsTemplate Application FlowUsage ExampleNotesModule VariablesModule VariablesAdditional ExportsSee Also