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
Career BranchesCareer System CoreCareer Save System
Career Computer MenuCareer Fuel SystemInspect VehicleVehicle InventoryLinear TutorialLoaner VehiclesCareer LogLogbookMarketplaceMission WrapperCareer Painting ModuleCareer Part Inventory ModuleCareer Part Shopping ModuleCareer Payment ModuleCareer Permissions ModuleCareer Playbook Writer ModuleCareer Player Abstract ModuleCareer Player Attributes ModuleCareer Player Driving ModuleCareer Quick Travel ModuleCareer Rentals ModuleCareer Reputation ModuleCareer Spawn Points ModuleCareer Speed Traps ModuleCareer Test Drive ModuleCareer Tether ModuleCareer Tuning ModuleCareer UI Utils ModuleCareer Unlock Flags ModuleCareer Value Calculator ModuleVehicle Class GroupingVehicle Deletion ServiceVehicle PerformanceVehicle Shopping

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 Extensionscareermodules

Career Part Inventory Module

M.dependencies = {'career_career'}

Dependencies

M.dependencies = {'career_career'}

Manages the global inventory of vehicle parts across all owned vehicles. Tracks which parts are installed in which vehicle (by location = inventoryId) or loose in storage (location = 0). Handles part removal, selling, and persistence.


Public API

FunctionSignatureDescription
M.generateAndGetPartsFromVehicle(inventoryId) → tableReads JBeam tree and returns all parts for a vehicle
M.changedPartsCallback(partConditions, inventoryId)Callback after vehicle config change; tracks moved-out parts
M.initConditionsCallback(_, inventoryId)Queues part-condition init on vehicle object
M.sendUIData()Sends full part list, vehicles, and broken-state to UI
M.openMenu(originComputerId)Opens the "My Parts" UI screen
M.closeMenu()Closes menu; autosaves dirty vehicles first
M.partInventoryClosed()Marks menu as closed
M.getSlotToPartIdMap() → tableReturns {inventoryId → {slot → partId}}
M.getPartPathToPartIdMap() → tableReturns {inventoryId → {partPath → partId}}
M.getInventory() → tableReturns the raw partInventory table
M.addPartToInventory(part)Adds a part with auto-incremented ID
M.getPart(inventoryId, path) → partFinds part by vehicle + slot path
M.updatePartConditionsInInventory()Syncs part conditions from vehicle data
M.sellParts(partIds)Sells loose parts (location=0) for calculated value

Lifecycle Hooks

HookPurpose
M.onExtensionLoadedLoads part inventory from save file
M.onUpdateProcesses deferred vehicle-part additions and map updates
M.onVehicleSaveFinishedPersists partInventory.json
M.onSaveFinishedCloses menu after autosave
M.onEnterVehicleFinishedTriggers map rebuild for current vehicle
M.onVehicleAddedQueues part generation for new vehicle
M.onVehicleRemovedRemoves all parts belonging to the vehicle
M.onComputerAddFunctionsRegisters "My Parts" button on computers
M.onPartShoppingTransactionCompleteRebuilds slot/path maps

Dependencies

  • career_career - active check
  • career_modules_inventory - vehicle data, spawning, part conditions
  • career_modules_valueCalculator - part value for selling
  • career_modules_playerAttributes - money credit on sell
  • career_modules_insurance_insurance - broken-vehicle check for UI
  • career_modules_permissions - part-swapping permission status

Part Structure

part = {
  name            = "pickup_bed_long",    -- JBeam part name
  value           = 1200,                 -- base value from JBeam
  description     = { ... },             -- from jbeamIO.getAvailableParts()
  partCondition   = {integrityValue=1, odometer=500, visualValue=1},
  tags            = {},
  vehicleModel    = "pickup",
  location        = 5,                   -- inventoryId (0 = loose)
  containingSlot  = "/bed_slot/",
  partPath        = "/bed_slot/pickup_bed_long",
  mainPart        = false,               -- true for root "/"
}

Usage Example

-- Sell loose parts
local looseIds = {}
for id, part in pairs(career_modules_partInventory.getInventory()) do
  if part.location == 0 then table.insert(looseIds, id) end
end
career_modules_partInventory.sellParts(looseIds)

-- Find part by slot path
local part = career_modules_partInventory.getPart(inventoryId, "/engine_slot/")

See Also

  • partShopping - Buy/swap parts in the shop
  • valueCalculator - Part value calculation
  • painting - Primer flag on parts

Career Painting Module

M.dependencies = {"career_career"}

Career Part Shopping Module

Interactive part shop UI for buying, swapping, and removing vehicle parts at garage computers. Maintains a preview vehicle, shopping cart with 7% sales tax, and inventory-part reuse. Uses a tether sys

On this page

DependenciesPublic APILifecycle HooksDependenciesPart StructureUsage ExampleSee Also