RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

AI Module ReferenceBackwards Compatibility Module ReferenceBdebug Module ReferenceBdebugImpl Module ReferenceBeamstate Module ReferenceBullettime Module ReferenceController Module ReferenceDamageTracker Module ReferenceDrivetrain Module ReferenceElectrics Module ReferenceElectrics Custom Value ParserEnergyStorage Module ReferenceExtensions Module ReferenceFire Module ReferenceVehicle Engine True GlobalsGuihooks Module ReferenceGUI Streams Module ReferenceHTML Texture Module ReferenceHydros Module ReferenceInput Module ReferenceJBeam-Lua Integration GuideMapmgr Module ReferenceMaterial Module ReferenceBeamNG Math & Unit Conversions Referenceobj (Vehicle C++ Object)PartCondition Module ReferenceParticlefilter Module ReferenceParticles Module ReferencePowertrain Module ReferenceVehicle Property & Module TreeProps Module ReferenceProtocols Module ReferenceRecovery Module ReferenceScriptAI Module ReferenceSensors Module ReferenceSounds Module ReferenceStreams Module ReferenceThrusters Module Reference`v` (Vehicle Data & JBeam)Wheels Module 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 Referenceve

EnergyStorage Module Reference

Module defined in `lua/vehicle/energyStorage.lua`. Central manager for all vehicle energy containers (fuel tanks, batteries, N2O tanks, pressure tanks). Handles discovery from JBeam, links containers to powertrain devices that consume energy, tracks fuel levels and leak states, and manages rupture callbacks when beams break.

Module defined in lua/vehicle/energyStorage.lua. Central manager for all vehicle energy containers (fuel tanks, batteries, N2O tanks, pressure tanks). Handles discovery from JBeam, links containers to powertrain devices that consume energy, tracks fuel levels and leak states, and manages rupture callbacks when beams break.

See Also

  • Energy Storage Folder: Specific container types (Fuel, Battery).
  • Powertrain: For devices that consume energy.

State Fields

VariableDescription
nilStorageProxy for safe missing-storage access.

Public API

FunctionSignatureDescription
beamBroke(id) (**hook**)Container rupture callback.
getPartCondition(partTypeData) (**callable**)Health aggregation for part-linked storages. See Part Condition. Returns multiple values.
getStorage(name) (**callable**)Data retrieval. Returns energyStorages[name].
getStorages() (**callable**)Full storage list. Returns energyStorages.
getStorageSafe(name) (**callable**)Safety-wrapped retrieval.
init() (**hook**)JBeam discovery and Powertrain linking.
onCouplerAttached(nodeId, obj2id, obj2nodeId, attachSpeed, attachEnergy) (**hook**)Coupling state callback.
onCouplerDetached(nodeId, obj2id, obj2nodeId, breakForce) (**hook**)Decoupling state callback.
onCouplerFound(nodeId, obj2id, obj2nodeId, nodeDist) (**hook**)Discovery callback.
onDeserialize(data) (**hook**)State restoration hook.
onSerialize() (**hook**)Persistence hook. Returns data.
reset() (**hook**)Level reset.
setPartCondition(partTypeData, odometer, integrity, visual) (**callable**)Condition restoration.
updateGFX(dt) (**hook**)Ratio calculation and per-storage updates.

Usage Example

-- Get the main fuel tank and check its level
local tank = energyStorage.getStorage("mainTank")
if tank then
  print("Fuel remaining: " .. (tank.remainingRatio * 100) .. "%")
end

-- Set fuel to half capacity
local tank = energyStorage.getStorage("mainTank")
if tank then
  tank:setRemainingRatio(0.5)
end

Electrics Custom Value Parser

Module defined in `lua/vehicle/electricsCustomValueParser.lua`. Parses and evaluates custom expression-based electrics values defined in JBeam. Allows modders to create computed electrical signals using mathematical expressions that reference other electrics values.

Extensions Module Reference

Infrastructure for managing vehicle extensions, dependency resolution, and event hooking. This module allows for modular scripts to be loaded, unloaded, and updated at runtime, providing a flexible pl

On this page

See AlsoState FieldsPublic APIUsage Example