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

Replay

Replay recording and playback system. Records vehicle physics state to `.rpl` files, plays back with variable speed, seeking, and frame stepping. Supports mission auto-recording and user-saved replays

Replay recording and playback system. Records vehicle physics state to .rpl files, plays back with variable speed, seeking, and frame stepping. Supports mission auto-recording and user-saved replays.


Public Functions

FunctionSignatureDescription
M.toggleRecording(autoplay, isMission) → filenameStarts or stops recording; returns replay filename
M.toggleMissionRecording() → filenameToggle recording for mission replays
M.cancelRecording()Cancels active recording and deletes the file
M.togglePlay()Plays/pauses the loaded replay
M.loadFile(filename)Loads and pauses a replay file
M.stop()Stops playback/recording
M.pause(v)Sets pause state during playback
M.setSpeed(speed)Sets playback speed (1.0 = realtime)
M.toggleSpeed(val)Cycles speed: "realtime", "slowmotion", or ±1 step
M.seek(percent)Seeks to normalized position [0..1]
M.jumpTime(seconds)Jumps forward/backward by seconds
M.jumpFrames(offset)Steps forward/backward by frames
M.jump(offset)Alias for jumpFrames
M.getRecordings() → tableLists .rpl files in /replays/
M.getState() → stringCurrent state: "inactive", "recording", "playback"
M.isPaused() → booleanWhether playback is paused
M.getPositionSeconds() → numberCurrent playback position in seconds
M.getTotalSeconds() → numberTotal replay duration in seconds
M.getLoadedFile() → stringCurrently loaded replay filename
M.displayMsg(level, msg, context)Shows a toast notification
M.openReplayFolderInExplorer()Opens /replays/ in file explorer
M.startLevel(levelPath)Loads a level for replay playback
M.acceptRename(oldFile, newFile)Renames a replay file and reloads
M.saveMissionReplay(replayFile)Moves a mission replay to user-saved folder
M.getMissionReplayFiles(mission, onlyWithAttempt) → tableLists replays for a specific mission
M.getMissionReplaysPath() → stringReturns "replays/missionReplays/"
M.removeMissionSavedReplay(replayFile)Moves a saved replay back to auto folder
M.openMissionReplayFolder(replayFile)Opens replay file location in explorer

Replay State Object (M.state)

FieldTypeDescription
loadedFilestringCurrent replay file path
positionSecondsnumberCurrent position in seconds
totalSecondsnumberTotal duration
speednumberPlayback speed multiplier
pausedbooleanWhether paused
statestring"inactive", "recording", "playback"

Speed Presets

1/1000, 1/500, 1/200, 1/100, 1/50, 1/32, 1/16, 1/8,
1/4, 1/2, 3/4, 1.0, 1.5, 2, 4, 8

Hooks

HookPurpose
M.onInitCalled on Init event
M.onClientEndMissionCalled on ClientEndMission event
M.stateChanged(loadedFile, positionSeconds, totalSeconds, speed, paused, fpsPlay, fpsRec, statestr, framePositionSeconds)Callback when replay state changes.

Module State

VariableTypeDefault
requestedStartLevelnilnil

Usage Example

-- Start recording
local filename = core_replay.toggleRecording()
-- filename: "replays/2024-01-15_14-30-00 gridmap.rpl"

-- Stop and auto-play
core_replay.toggleRecording(true)

-- Load and play a file
core_replay.loadFile("replays/myreplay.rpl")
core_replay.togglePlay()

-- Slow motion
core_replay.setSpeed(0.25)

-- Seek to 50%
core_replay.seek(0.5)

-- Step 10 frames forward
core_replay.jumpFrames(10)

Notes

  • During playback, vehicle action maps are disabled and ReplayPlaybackActionMap is pushed.
  • Mission replays include .rplMeta.json metadata files with mission ID, attempt data, and save slot.
  • Recording filename format: YYYY-MM-DD_HH-MM-SS <mapname>.rpl.
  • The stateChanged callback is called from C++ - do not remove.
  • Career replays are organized by save slot in replays/userSavedMissionReplays/.

See Also

  • paths - Camera path playback system
  • globals - be:getFileStream(), action maps

Remote Controller

Mobile phone remote controller support. Listens for UDP connections from the BeamNG Remote Control app, creates virtual input devices, and bridges accelerometer/button data to vehicle controls.

Repository

Online mod repository client. Handles mod browsing, subscribing/unsubscribing, downloading with progress, update queuing, and synchronization with BeamNG servers.

On this page

Public FunctionsReplay State Object (M.state)Speed PresetsHooksModule StateUsage ExampleNotesSee Also