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

JBeam Stats

Generates statistics about all JBeam files in the game - part counts, section usage, line counts, and modifier counts.

Generates statistics about all JBeam files in the game - part counts, section usage, line counts, and modifier counts.


Overview

util_jbeamStats scans all .jbeam files and produces aggregate statistics including total files, parts, sections, rows per section, line counts, root parts, and modifier usage. Used by the documentation creator for the official docs.

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


Exports (M)

FunctionSignatureDescription
getStats()Returns a table of JBeam statistics.

Internals

Statistics Collected

FieldTypeDescription
totalJbeamFilesnumberTotal .jbeam files found.
partCountnumberTotal parts across all files.
sectionCounttableMap of section name → occurrence count.
sectionCountOrderedarraySorted {name, count} pairs (descending).
sectionRowCounttableMap of section name → total data rows (excludes headers).
totalLineCountnumberTotal lines across all JBeam files.
totalRootPartsnumberParts with slotType == "main".
totalModifiersCountnumberNon-array entries in table sections (modifier rows).

Counting Logic

For each JBeam file:

  1. Parse JSON content.
  2. For each part, iterate sections.
  3. Table sections with array headers: count data rows (subtract 1 for header).
  4. Non-array entries in table sections count as modifiers.
  5. Root parts are identified by slotType == "main".

How It Works

  1. Call getStats().
  2. All .jbeam files are found via FS:findFiles.
  3. Each file is decoded and analyzed.
  4. Returns a comprehensive statistics table.

Lua Examples

-- Get JBeam statistics
local stats = extensions.util_jbeamStats.getStats()
print("Total files: " .. stats.totalJbeamFiles)
print("Total parts: " .. stats.partCount)
print("Total lines: " .. stats.totalLineCount)
print("Root parts: " .. stats.totalRootParts)

-- Write to file for documentation
jsonWriteFile('jbeam_stats.json', stats, true)

-- Check most common sections
for _, entry in ipairs(stats.sectionCountOrdered) do
  print(entry[1] .. ": " .. entry[2])
end

Additional Exports

  • M.getStats - (undocumented)

Instanced Line Render Demo

Demo extension showcasing the instanced line and dot rendering API. Features an N-body gravity simulation, grid drawing, sine waves, edge tests, and traffic signal visualization.

Log Streams

Simple file I/O helper for reading and writing logged stream data in JSON, wikitable, and reStructuredText formats.

On this page

OverviewExports (M)InternalsStatistics CollectedCounting LogicHow It WorksLua ExamplesAdditional Exports