RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Rally Audio ManagerRally Camera Path PlayerRally ClientRally Cut CaptureRally EnumsRally Extension HelperRally GeometryRally ManagerRecce ManagerRecce AppRecce SettingsRally Settings ManagerSnap-to-RoadTraffic Exclusion ZonesRally UtilityRally Vehicle CaptureRally Vehicle Tracker

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 Extensionsgameplayrally

Rally Cut Capture

Captures vehicle position/rotation snapshots ("cuts") during recce recording sessions. Each cut is written as a JSON line to a file for later processing by the transcription pipeline.

Captures vehicle position/rotation snapshots ("cuts") during recce recording sessions. Each cut is written as a JSON line to a file for later processing by the transcription pipeline.


Constructor

local CutCapture = require('/lua/ge/extensions/gameplay/rally/cutCapture')
local cc = CutCapture(vehicle, missionDir)

Public API

MethodSignatureReturnsDescription
init(vehicle, missionDir)nilInitializes capture with vehicle and output file paths
capture()numberCaptures current vehicle state and writes to file; returns cut ID
truncateCapturesFile()nilClears the cuts output file
truncateTranscriptsFile()nilClears the transcripts output file
writeCut(cutCapture)nilAppends a JSON-encoded cut to the file

Internals

FieldTypeDescription
vehicleobjectBeamNG vehicle object reference
fnamestringPath to cuts JSON-lines file
fname_transcriptsstringPath to transcripts file
cut_idnumberAuto-incrementing cut counter

Cut Data Structure

Each captured cut contains:

FieldTypeDescription
idnumberSequential cut ID
tsnumberTimestamp from rallyUtil.getTime()
postableVehicle position {x, y, z}
quattableVehicle rotation quaternion {x, y, z, w}
steeringnumber/nilCurrent steering input value (from vehicle bridge)

How It Works

  1. On init, registers a value change notification for the steering key via core_vehicleBridge
  2. capture() reads the vehicle's position, direction quaternion, and cached steering value
  3. The cut is JSON-encoded and appended as a line to the cuts file
  4. Cut IDs auto-increment for sequential ordering
  5. Steering data is retrieved from core_vehicleBridge.getCachedVehicleData

Usage Examples

-- Initialize for a recce session
local cc = CutCapture(playerVehicle, missionDir)
cc:truncateCapturesFile()

-- Capture on user input (e.g., button press)
local cutId = cc:capture()
log('I', '', 'Captured cut #' .. cutId)

Notes

  • Files use JSON-lines format (one JSON object per line) for easy streaming
  • The vehicle position is centered over the top center of the windshield
  • Output path is determined by rallyUtil.missionReccePath(missionDir, 'cuts.json')
  • Steering is optional and will be nil if the vehicle bridge hasn't cached the value

See Also

  • Rally Audio Manager - Related reference
  • Rally Camera Path Player - Related reference
  • Rally Client - Related reference
  • Gameplay Systems Guide - Guide

Rally Client

HTTP client for communicating with a local rally companion server. Sends recording cut commands and retrieves transcription results via REST API on `localhost:27872`.

Rally Enums

Defines enumeration constants for the rally system: pacenote audio modes, trigger types, and slow corner release types.

On this page

ConstructorPublic APIInternalsCut Data StructureHow It WorksUsage ExamplesNotesSee Also