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
`adasUltrasonic.lua``cameraPreview.lua``capturePlayer.lua``license.lua``lidarTest.lua``multiscreen.lua``openDriveExporter.lua``openStreetMapExporter.lua``partAnnotations.lua``platoonFunctions.lua``pythonExport.lua``rawLidar.lua``rawLidarEmpty.lua``sensors.lua``sumoExporter.lua``techCore.lua``terrainImporter.lua``ultrasonicTest.lua``utils.lua`

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 Extensionstech

`platoonFunctions.lua`

> This Source Code Form is subject to the terms of the bCDDL, v. 1.1.

This Source Code Form is subject to the terms of the bCDDL, v. 1.1. If a copy of the bCDDL was not distributed with this file, You can obtain one at http://beamng.com/bCDDL-1.1.txt

Module variable: M

Hooks

  • onExtensionLoaded
  • onUpdate

Exported Functions

M.onExtensionLoaded()

Line 358

Returns: M

M.onUpdate(dtReal, dtSim, dtRaw)

Line 332

Public interface

Returns: M

M.leavePlatoon(leaderID, vid)

Line 243

M.loadWithID(leaderID, vid, speed, debugFlag)

Line 192

end of Platoon Architecure file replacement code--------------------------------

M.joinWithID(leaderID, vid, speed, debugFlag)

Line 220

M.changeSpeed(speed)

Line 38

M.launchPlatoon(leaderID, leaderMode, speed)

Line 250

M.endPlatoon(platoonID)

Line 258

M.leaderExitPlatoon(leaderID)

Line 273

ADDED for NFSA

M.splitPlatoon(leaderID, vehicleID)

Line 301

M.createPlatoon(leaderID, sensorID)

Line 44

start Platoon Architecure file replacement code-----------------------------

M.addVehicleToPlatoon(leaderID, vehicleID, sensorID)

Line 73

Function to add a vehicle to the platoon based on the leader's ID

M.removeVehicleFromPlatoon(vehiclesData)

Line 121

Function to remove a vehicle from a platoon based on the leader's ID

M.changePlatoonLeaderID(oldleaderID)

Line 155

M.printPlatoons()

Line 179

M.getVehicleIndex(leaderID, vehicleID)

Line 52

Returns: i -- Return the index of the vehicle in the platoon

M.joinInBetween(leaderID, relayVehicleID, externalVehicleID, speed, debugFlag)

Line 313

M.getRelayVehiclesID(leaderID, vehicleIndex)

Line 107

M.addVehicleInPlatoon(leaderID, index, vehicleID, sensorID)

Line 90

Exported Variables

M.onExtensionUnloaded

Line 359 - unload

M.load

Line 361 - load

M.leaderExitPlatoonByPlatoonID

Line 367 - leaderExitPlatoonByPlatoonID

M.leaderExitPlatoonByLeaderID

Line 368 - leaderExitPlatoonByLeaderID

Internal Functions

Show internal functions
  • changeSpeed(speed) (line 38)
  • createPlatoon(leaderID, sensorID) (line 44)

    start Platoon Architecure file replacement code-----------------------------

  • getVehicleIndex(leaderID, vehicleID) (line 52)
  • addVehicleToPlatoon(leaderID, vehicleID, sensorID) (line 73)

    Function to add a vehicle to the platoon based on the leader's ID

  • addVehicleInPlatoon(leaderID, index, vehicleID, sensorID) (line 90)
  • getRelayVehiclesID(leaderID, vehicleIndex) (line 107)
  • removeVehicleFromPlatoon(vehiclesData) (line 121)

    Function to remove a vehicle from a platoon based on the leader's ID

  • changePlatoonLeaderID(oldleaderID) (line 155)
  • printPlatoons() (line 179)
  • loadWithID(leaderID, vid, speed, debugFlag) (line 192)

    end of Platoon Architecure file replacement code--------------------------------

  • joinWithID(leaderID, vid, speed, debugFlag) (line 220)
  • leavePlatoon(leaderID, vid) (line 243)
  • launchPlatoon(leaderID, leaderMode, speed) (line 250)
  • endPlatoon(platoonID) (line 258)
  • leaderExitPlatoon(leaderID) (line 273)

    ADDED for NFSA

  • splitPlatoon(leaderID, vehicleID) (line 301)
  • joinInBetween(leaderID, relayVehicleID, externalVehicleID, speed, debugFlag) (line 313)
  • onUpdate(dtReal, dtSim, dtRaw) (line 332)

`partAnnotations.lua`

> This Source Code Form is subject to the terms of the bCDDL, v. 1.1.

`pythonExport.lua`

> This Source Code Form is subject to the terms of the bCDDL, v. 1.1.

On this page

HooksExported FunctionsM.onExtensionLoaded()M.onUpdate(dtReal, dtSim, dtRaw)M.leavePlatoon(leaderID, vid)M.loadWithID(leaderID, vid, speed, debugFlag)M.joinWithID(leaderID, vid, speed, debugFlag)M.changeSpeed(speed)M.launchPlatoon(leaderID, leaderMode, speed)M.endPlatoon(platoonID)M.leaderExitPlatoon(leaderID)M.splitPlatoon(leaderID, vehicleID)M.createPlatoon(leaderID, sensorID)M.addVehicleToPlatoon(leaderID, vehicleID, sensorID)M.removeVehicleFromPlatoon(vehiclesData)M.changePlatoonLeaderID(oldleaderID)M.printPlatoons()M.getVehicleIndex(leaderID, vehicleID)M.joinInBetween(leaderID, relayVehicleID, externalVehicleID, speed, debugFlag)M.getRelayVehiclesID(leaderID, vehicleIndex)M.addVehicleInPlatoon(leaderID, index, vehicleID, sensorID)Exported VariablesM.onExtensionUnloadedM.loadM.leaderExitPlatoonByPlatoonIDM.leaderExitPlatoonByLeaderIDInternal Functions