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
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorExport (glTF)Follow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track (Gymkhana Generator)Rectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot Creator (Vehicle Thumbnails)ShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files Syntaxutil/vehicleRopeDebug - Rope Physics Debug UIutil/worker - Batch Job Workerutil/wsTest - WebSocket Test Server

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 Extensionsutil

Test Extension Proxies

Demonstration/test extension showing how to use `newExtensionProxy` to fan out extension hooks to multiple object instances.

Demonstration/test extension showing how to use newExtensionProxy to fan out extension hooks to multiple object instances.


Overview

util_testExtensionProxies creates an ExtensionProxy that dispatches extension events (like onUpdate) to a list of OOP instances. This is a test/example extension - not used in production.

Extension path: lua/ge/extensions/util/testExtensionProxies.lua


Exports (M)

FunctionSignatureDescription
onExtensionLoaded()Creates 11 test instances and registers them with an ExtensionProxy.
onExtensionUnloaded()Destroys the ExtensionProxy.

Internals

ExtensionProxyTester Class

A minimal class with an onUpdate method that prints its id and dtReal.

function ExtensionProxyTester:onUpdate(dtReal, dtSim, dtRaw)
  print('ExtensionProxyTester:onUpdate called: ' .. tostring(self.id) .. ', ' .. tostring(dtReal))
end

ExtensionProxy Pattern

  1. Create instances with event-sink methods (e.g., onUpdate).
  2. Call newExtensionProxy(M) - binds the proxy to this extension module.
  3. Call extProxy:submitEventSinks(instances) - registers instances as event receivers.
  4. When the extension receives onUpdate, the proxy fans it out to all instances.
  5. On unload, call extProxy:destroy() to clean up.

How It Works

  1. onExtensionLoaded creates 11 ExtensionProxyTester objects (ids 0–10).
  2. An ExtensionProxy is created and given the instances.
  3. Every frame, each instance's onUpdate is called with the frame's dt values.
  4. onExtensionUnloaded destroys the proxy.

Lua Examples

-- Load the test extension
extensions.load("util/testExtensionProxies")
-- Console will print 11 onUpdate messages per frame

-- The pattern for your own extension:
local proxy = newExtensionProxy(M)
proxy:submitEventSinks(myInstances)
-- Later:
proxy:destroy()

Additional Exports

  • M.onExtensionLoaded - (undocumented)
  • M.onExtensionUnloaded - (undocumented)

Terrain Generator

Creates terrain blocks from heightmap arrays, PNG files, or project directories with full material support.

Test JSON Files Syntax

Validates the syntax of every JSON, JBeam, and PC file in the game by attempting to decode each.

On this page

OverviewExports (M)InternalsExtensionProxyTester ClassExtensionProxy PatternHow It WorksLua ExamplesAdditional Exports