Vehicle Selector – Vehicle Specifications
Builds the detailed specifications panel for a selected vehicle config.
Builds the detailed specifications panel for a selected vehicle config.
Overview
ui_vehicleSelector_vehicleSpecifications assembles the specifications, icon tags, paint data, and metadata for the vehicle details panel. Handles unit conversions (metric/imperial) for all performance values based on user settings.
Extension path: lua/ge/extensions/ui/vehicleSelector/vehicleSpecifications.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
getDetails | (itemDetails) → table | Returns full details for a vehicle config. |
addIconTags | (modelDetails, configDetails) → tag[] | Returns drivetrain/transmission/induction/fuel icon tags. |
makeSpec | (modelDetails, configDetails, key, list) | Adds a spec entry to a list. |
specificationSetup | table | Specification group definitions. |
valueToUnit | table | Unit formatting functions. |
CONVERSIONS | table | Unit conversion constants. |
Internals
Specification Groups
- Performance - Power, Torque, Weight, Top Speed, 0-60/0-100, braking, weight/power (metric/imperial variants)
- Other - Type, Config Type, Transmission, Drivetrain, Propulsion, etc.
- Dev Info (when enabled) - model/config keys, file paths, mod info, region
Unit Conversions (CONVERSIONS)
| Constant | Value | Conversion |
|---|---|---|
MPS_TO_KMH | 3.6 | m/s → km/h |
MPS_TO_MPH | 2.237 | m/s → mph |
PS_TO_BHP | 0.986 | PS → bhp |
PS_TO_KW | 0.735 | PS → kW |
NM_TO_LBFT | 0.738 | Nm → lb-ft |
KG_TO_LB | 2.205 | kg → lb |
M_TO_FT | 3.281 | m → ft |
valueToUnit Functions
Format values by unit type: seconds, g, torque, power, speed, weight, weightPower, distanceMinor, money, years, value. Torque and power include peak RPM when available.
Icon Tags
addIconTags returns icons for:
- Drivetrain: AWD/RWD/FWD/4WD or NxN format
- Transmission: Manual/Automatic/Sequential/CVT/DCT
- Induction: NA/Turbo/SC (with optional N2O)
- Fuel: Battery/Gasoline/Diesel
Paint Data
getDetails collects:
multiPaintSetups- multi-paint configurations valid for the configfactoryPaints- all model paints sorted by name
Tags
Source tags: BeamNG Official, Custom, Automation, Mod (with goToMod link), Auxiliary, Missing JBeam.
How It Works
getDetails({model, config})loads model and config data fromcore_vehicles.- Builds specification groups based on metric/imperial settings.
- Adds icon tags, paint data, general specs, and source tags.
- Special handling for
settings/default.pc(legacy config). - Returns a complete details object for the UI panel.
Lua Examples
local specs = require('/lua/ge/extensions/ui/vehicleSelector/vehicleSpecifications')
-- Get full details
local details = specs.getDetails({model = "pickup", config = "base"})
print(details.headerTitle) -- "D-Series Base"
-- Format a power value
local formatted = specs.valueToUnit.power(320) -- "320 PS" or "316 hp"
-- Get icon tags
local tags = specs.addIconTags(modelDetails, configDetails)
-- → {{icon = "RWD", label = "Drivetrain: Rear Wheel Drive"}, ...}Additional Exports
The following exports are available but not yet documented in detail:
M.CONVERSIONSM.addIconTagsM.getDetailsM.makeSpecM.specificationSetupM.valueToUnit