RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Activity ManagerAudio Bank ManagerAudio Ribbon SystemBus Route ManagerCamera SystemCore Chat (IRC)Core CheckpointsCore Command HandlerCoupler Camera ModifierDevices (RGB Peripherals)Dynamic PropsEnvironmentFlowgraph ManagerForestFun StuffGame ContextGame StateGround Marker ArrowsGround MarkersHardware InfoHighscoresHotlappingInventoryJob SystemLap TimesLevelsLoad Map CommandMetricsMod ManagerMultiseatMultiseat CameraMulti SpawnOnlinePaths (Camera Paths)Quick Access (Radial Menu)Recovery PromptRemote ControllerReplayRepositoryRope Visual TestScheme Command ServerCore SnapshotCore SoundsCore TerrainTraffic SignalsTrailer RespawnVehicle Active PoolingVehicle Bridge (GE ↔ VLua Communication)Vehicle MirrorsVehicle PaintsCore VehiclesVehicle TriggersVersion UpdateWeather SystemWindows Console

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 Extensionscore

Core Terrain

Provides terrain queries: height, normal, and smooth normal lookups.

Provides terrain queries: height, normal, and smooth normal lookups.


Overview

Extension: core_terrain - Simple utility that caches the active TerrainBlock and exposes height/normal queries. Automatically finds the first TerrainBlock in the scene if none is cached.


Public Functions

FunctionReturnsDescription
M.getTerrain()TerrainBlockReturns the cached (or first found) TerrainBlock object
M.getTerrainHeight(point)numberReturns terrain height at the given point
M.getTerrainNormal(point)vec3Returns terrain surface normal at the point
M.getTerrainSmoothNormal(point)vec3Returns interpolated smooth normal at the point

Usage Examples

-- Get terrain height at a position
local height = core_terrain.getTerrainHeight(vec3(100, 200, 0))

-- Get normal for slope calculations
local normal = core_terrain.getTerrainNormal(playerPos)
local steepness = math.acos(normal:dot(vec3(0, 0, 1)))

-- Access raw TerrainBlock object
local tb = core_terrain.getTerrain()
if tb then
  log('I', '', 'Terrain found: ' .. tostring(tb:getName()))
end

Implementation Notes

  • The TerrainBlock is found via scenetree.findClassObjects("TerrainBlock") and cached by ID.
  • If the cached ID becomes invalid (level change), it auto-discovers the new terrain.
  • Returns nil if no terrain exists in the scene.

See Also

  • Globals - scenetree scene graph queries

Core Sounds

Manages GE-side sound system: global audio parameters, engine/exhaust sound init, cabin filter, and audio blur.

Traffic Signals

Comprehensive traffic signal system with instances, controllers, sequences, and intersection management.

On this page

OverviewPublic FunctionsUsage ExamplesImplementation NotesSee Also