RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

cdefDebugDraw ReferencecdefGpuMesh ReferencecdefImgui ReferencecdefMath Referencecdefs ReferencecontrolSystems Referencecsvlib ReferencedelayLine Referencedequeue ReferencedevUtils ReferenceEvent Referenceextensions Referencefilters Referencegraphpath Referenceguihooks ReferenceinputFilters ReferenceinterpolatedMap Referenceintrospection ReferencejbeamWriter Referencejson-ast Referencejson ReferencejsonDebug ReferencejsonPrettyEncoderCustom Referencekdtreebox2d Referencekdtreebox3d Referencekdtreepoint3d Referencelpack ReferenceluaBinding ReferenceluaCore ReferenceluaProfiler Referencemathlib Referenceparticles Referencequadtree Referencesettings ReferencetcpServer ReferencetimeEvents Referenceutils Reference
extensions/ - BeamNG Extension Modules
tech/techCapture Reference

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 Referencecommonextensionstech

tech/techCapture Reference

Module defined in `lua/common/extensions/tech/techCapture.lua`. Records and replays tech layer communication (requests/responses) for debugging and testing co-simulation sessions.

Module defined in lua/common/extensions/tech/techCapture.lua. Records and replays tech layer communication (requests/responses) for debugging and testing co-simulation sessions.


Exports

Functions

M.onInit()

Hook: Initialize capture state.

M.enableRequestCapture(captureName, flushInterval)

Start capturing outgoing requests to a file.

  • Parameters:
    • captureName - string - Name for the capture session
    • flushInterval - number|nil - How often to flush to disk

M.disableRequestCapture()

Stop capturing requests and close the file.

M.enableResponseCapture(captureName)

Start capturing incoming responses to a file.

  • Parameters:
    • captureName - string - Name for the capture session

M.disableResponseCapture()

Stop capturing responses and close the file.

M.openRequestFile(captureName)

Open a request capture file for writing.

  • Parameters:
    • captureName - string - Capture session name
  • Returns: string - Output filename

M.recordRequest(request)

Record a single request to the capture file.

  • Parameters:
    • request - table - Request data to record
  • Returns: boolean - true on success

M.closeRequestFile()

Close the request capture file.

M.isRecordingRequests()

Check if request recording is active.

  • Returns: boolean - true if recording requests

M.openResponseFile(captureName)

Open a response capture file for writing.

  • Parameters:
    • captureName - string - Capture session name

M.recordResponse(response)

Record a single response to the capture file.

  • Parameters:
    • response - table - Response data to record

M.closeResponseFile()

Close the response capture file.

M.isRecordingResponses()

Check if response recording is active.

  • Returns: boolean - true if recording responses

M.getAllRelatedFiles(pathToFile, completeMatch, intermediateMatch)

Find all capture files related to a given file path.

  • Parameters:
    • pathToFile - string - Path like /path/to/file.<ext> or /path/to/file.<XXX>.<ext>
    • completeMatch - string - Extension for exact match files
    • intermediateMatch - string - Extension for intermediate match files
  • Returns: table - Array of matching file paths

M.getCaptureTypeFromFile(inputFilename)

Determine the capture type (request/response) from a file's header.

  • Parameters:
    • inputFilename - string - Capture file path
  • Returns: string|nil - Capture type or nil

M.filterFilesByHeader(files, captureType, captureMerged)

Filter a list of capture files by their header type.

  • Parameters:
    • files - table - Array of file paths
    • captureType - string - Type to filter for
    • captureMerged - boolean - Include merged captures
  • Returns: table - Filtered file list

M.injectMessage(payload, callback)

Inject a recorded message for replay.

  • Parameters:
    • payload - table - Message payload to inject
    • callback - function - Callback after processing
  • Returns: table, boolean - Processed request and whether to continue

M.export()

Export current capture state for serialization.

  • Returns: table - Capture state

M.import(info)

Import/restore capture state.

  • Parameters:
    • info - table - Previously exported capture state

Hooks

  • onInit

Internal Notes

  • Uses techCommunication module for message format compatibility
  • Capture files use a length-prefixed binary format matching the wire protocol
  • deletePreviousCaptureWithSameName removes old captures when starting new ones
  • buildCaptureFilename / prepareFileFromCaptureName handle file naming
  • convertBinaryDataToString handles binary payload serialization

networking/editorToolchain Reference

Module defined in `lua/common/extensions/networking/editorToolchain.lua`. TCP server extension for editor toolchain communication - receives commands from external editors/tools.

ui/imgui_api Reference

Module defined in `lua/common/extensions/ui/imgui_api.lua`. Base ImGui API module - provides the global Lua ImGui context variable that other modules populate.

On this page

ExportsFunctionsM.onInit()M.enableRequestCapture(captureName, flushInterval)M.disableRequestCapture()M.enableResponseCapture(captureName)M.disableResponseCapture()M.openRequestFile(captureName)M.recordRequest(request)M.closeRequestFile()M.isRecordingRequests()M.openResponseFile(captureName)M.recordResponse(response)M.closeResponseFile()M.isRecordingResponses()M.getAllRelatedFiles(pathToFile, completeMatch, intermediateMatch)M.getCaptureTypeFromFile(inputFilename)M.filterFilesByHeader(files, captureType, captureMerged)M.injectMessage(payload, callback)M.export()M.import(info)HooksInternal Notes