API ReferenceGE Extensionscareermodules
Career Painting Module
M.dependencies = {"career_career"}
Dependencies
M.dependencies = {"career_career"}Vehicle paint shop system for career mode. Allows players to repaint vehicles at garage computers with tiered paint classes (gloss, metallic, matte, chrome, custom) and optional clearcoat.
Public API
| Function | Signature | Description |
|---|---|---|
M.start | (inventoryId, originComputerId) | Opens painting UI for a vehicle; auto-repairs broken parts first |
M.apply | () | Pays for and applies the chosen paint, saves vehicle |
M.close | (closeMenuAfterSaving) | Exits painting mode, restores walking/camera state |
M.getPaintData | () → table | Returns current colors, price table, and color-class data |
M.setPaints | (paints, paintOptions, partName) | Previews paint on the vehicle (up to 3 paint slots) |
M.getFactoryPaint | () → table | Returns model's original factory paints |
M.getPrimerColor | () → table | Returns a flat grey primer paint definition |
M.onComputerAddFunctions | (menuData, computerFunctions) | Registers "Painting" button on garage computers |
M.onUIOpened | () | Enters vehicle, sets orbit camera, freezes vehicle |
M.onVehicleSaveFinished | () | Closes menu after autosave completes |
Dependencies
career_career(required)career_modules_inventory- vehicle data and spawningcareer_modules_payment- payment validation and executioncareer_modules_valueCalculator- broken-parts check before paintingcareer_modules_insurance_insurance- auto-repair before paintingcareer_modules_partInventory- clear primered flag on painted partscareer_modules_permissions- check painting/vehicleModification permission
Key Data Structures
Price Table
prices.basePrices = {
factory = {money = {amount = 600}},
gloss = {money = {amount = 1500}},
metallic = {money = {amount = 2500}},
chrome = {money = {amount = 3400}},
custom = {money = {amount = 4000}},
-- ...
}
prices.clearcoatBase -- 500
prices.clearcoatPolishFactor -- 1000 × polish levelColor Class Data
colorClassData.metallic = {metallic = 1, roughness = 0.5}
colorClassData.chrome = {metallic = 1, roughness = 0}Usage Example
-- Start painting from a computer
career_modules_painting.start(inventoryId, computerId)
-- Preview a paint set
career_modules_painting.setPaints(newPaints, paintOptions)
-- Apply and pay
career_modules_painting.apply()Hooks Emitted
| Hook | When |
|---|---|
onCareerPaintingStarted | Painting session begins |
onVehiclePaintingUiOpened | Camera/vehicle ready for UI |
See Also
- payment - Currency check and deduction
- partInventory - Part primer state
- permissions - Tag-based permission checks