API ReferenceGE Extensionscareermodules
Career Tuning Module
M.dependencies = {"career_career"}
Dependencies
M.dependencies = {"career_career"}Vehicle variable tuning system for career mode. Allows adjusting suspension, wheels, transmission, alignment, and chassis parameters at garage computers. Uses a shopping cart with categorized pricing and 7% sales tax.
Public API
| Function | Signature | Description |
|---|---|---|
M.start | (inventoryId, originComputerId) | Opens tuning UI; auto-repairs broken parts first |
M.apply | (tuningValues, callback) | Applies tuning values to vehicle config and reloads |
M.getTuningData | () → table | Returns vehicle's tunable variables from vdata |
M.close | () | Exits tuning, unfreezes vehicle, removes tether |
M.applyShopping | () | Pays total, triggers save, plays buy sound |
M.cancelShopping | () | Reverts all changes to pre-tuning values |
M.removeVarFromShoppingCart | (varName) | Reverts a single variable and updates UI |
M.onComputerAddFunctions | (menuData, computerFunctions) | Registers "Tuning" on garage computers |
M.onVehicleSaveFinished | () | Closes menu after autosave |
Dependencies
career_career(required)career_modules_inventory- vehicle data, spawningcareer_modules_playerAttributes- money deductioncareer_modules_valueCalculator- broken-parts checkcareer_modules_insurance_insurance- auto-repair before tuningcareer_modules_permissions- tuning/vehicleModification permissioncareer_modules_tether- walk-away boundarycareer_modules_vehiclePerformance- invalidates certification on tune
Price Structure
Hierarchical: category → subCategory → variable. Each level can have a base price.
| Category | SubCategory | Base Price |
|---|---|---|
| Suspension | Front / Rear | $100 each |
| Wheels | Front / Rear | $100 each |
| Transmission | (default) | $500 + $100/gear |
| Wheel Alignment | Front / Rear | $100 each |
| Chassis | - | $100 |
| (default) | - | $200 |
Total = sum of category + subcategory + variable prices + 7% tax.
Blacklisted Variables
These variables are tracked but have $0 cost:
$$ffbstrength(Chassis)$tirepressure_F(Wheels/Front)$tirepressure_R(Wheels/Rear)
Shopping Cart Flow
- Player modifies variables in UI →
apply(tuningValues)called - Vehicle reloads with new vars;
changedVarsdelta computed vs.vehicleVarsBefore createShoppingCart()builds hierarchical cart with prices- Cart sent to UI via
sendShoppingCartToUI() applyShopping()→ pays total → saves → closes
Usage Example
-- Start tuning from computer
career_modules_tuning.start(inventoryId, computerId)
-- Apply specific tuning values (from UI)
career_modules_tuning.apply({["$spring_F"] = 45000, ["$spring_R"] = 40000})
-- Purchase
career_modules_tuning.applyShopping()Hooks Emitted
| Hook | When |
|---|---|
onCareerTuningStarted | Tuning session begins |
onCareerTuningApplied | Tuning values applied to vehicle |
See Also
- partShopping - Part-based customization
- tether - Boundary system for walk-away cancellation
- payment - Currency validation