API ReferenceGE Extensionscareermodules
Vehicle Performance
Runs the vehicle performance certification test (drag strip + skidpad). Records acceleration, braking, and lateral G data. Manages cinematic camera sequences during testing.
Runs the vehicle performance certification test (drag strip + skidpad). Records acceleration, braking, and lateral G data. Manages cinematic camera sequences during testing.
Public API
| Function | Signature | Returns | Description |
|---|---|---|---|
M.startDragTest | (inventoryId) | nil | Starts the full certification sequence (drag + skidpad) |
M.invalidateCertification | (inventoryId) | nil | Clears current certification, archives to history |
M.isTestInProgress | () | boolean | Whether a performance test is currently running |
M.cancelTest | (delay) | nil | Cancels the active test with optional delay (seconds) |
M.getAggregateScoresFromVehId | (inventoryId) | table/nil | Aggregate performance scores from certification data |
M.getVehicleClass | (inventoryId) | table/nil | Vehicle class derived from certification data |
M.addScoresToPerformanceData | (performanceData) | nil | Adds aggregate scores and class to a data table in-place |
M.openMenu | (options) | nil | Opens the performance index UI |
Hooks (Events)
| Hook | Purpose |
|---|---|
M.onDragCountdownStarted | Switches to launch camera during countdown |
M.onBeamNGTrigger | Plays camera paths at drag strip trigger points |
M.onUpdate | Updates camera zoom during test |
M.onComputerAddFunctions | Adds "Performance Index" to garage computer menu |
M.onVehicleDamaged | Cancels test if engine is catastrophically damaged |
Test Sequence
- Fade to black → spawn/enter vehicle → refuel
- Drag test: Teleport to Alder Strip, run quarter-mile with cinematic camera paths
- Record: 0-60, 1/8 mile, 1/4 mile times, braking G, top speeds
- Skidpad test: Teleport to skidpad, AI drives 10 laps recording lateral acceleration
- Cleanup: Remove vehicle, re-enable traffic, teleport player back
Measured Timers
time_60, time_330, time_1_8, time_1000, time_1_4, velAt_1_4, velAt_1_8, time_0_60, brakingG
Usage Examples
-- Start certification for inventory vehicle
career_modules_vehiclePerformance.startDragTest(inventoryId)
-- Check if test is running
if career_modules_vehiclePerformance.isTestInProgress() then
career_modules_vehiclePerformance.cancelTest(3) -- cancel after 3s delay
end
-- Get class after certification
local class = career_modules_vehiclePerformance.getVehicleClass(inventoryId)
-- class = { name = "B", ... }Notes
- Performance history is capped at 10 entries per vehicle
- Engine damage (catastrophic over-torque or lockup) auto-cancels the test
- Blocked actions during test: radial menu, big map, walking mode, reset physics, etc.