API ReferenceGE Extensionscareermodulesdelivery
Delivery Precision Parking
M.dependencies = {"util_stepHandler"}
Dependencies
M.dependencies = {"util_stepHandler"}Calculates precision parking scores for delivery drop-offs based on vehicle alignment, position, and parking spot dimensions. Awards bonus/penalty to rewards.
Module Info
| Field | Value |
|---|---|
| Path | extensions/career/modules/delivery/precisionParking.lua |
| Global | career_modules_delivery_precisionParking |
| Dependencies | util_stepHandler |
Public API
| Function | Signature | Description |
|---|---|---|
calculateVehiclePrecisionScore | (vehId, targetParkingSpot) | Calculates score from angle, side offset, forward offset. Returns precisionData table |
getPrecisionParkingBonus | (precisionData) | Converts precision score into reward multipliers (money, logistics, skill, reputation) |
calculateVehiclePrecisionParking | (taskData) | Full pipeline for vehicle delivery: calculate + apply |
calculateCargoPrecisionParking | (cargo, targetLocation) | Full pipeline for cargo delivery: calculate + apply |
getPrecisionParkingConfig | () | Returns the scoring configuration constants |
debugPrecisionParking | (vehId, targetParkingSpot) | Debug wrapper for testing |
| M.onCareerActivated | () | - |
Scoring Levels
| Level | Score Range | Money | Logistics XP | Skill XP | Reputation |
|---|---|---|---|---|---|
| Perfect | ≥ 20 | +$30 +15% | +10 +20% | +5 +15% | +5 +20% |
| Great | ≥ 15 | +$20 +10% | +5 +15% | +5 +10% | +2 +15% |
| Good | ≥ 10 | +$10 +5% | +5 +10% | +3 +5% | - |
| Bad | ≥ 5 | −5% | - | - | - |
| Horrible | < 5 | −10% | - | - | −5 −10% |
Score Calculation
Score is computed from three components (0–6 each, plus 2 base = max 20):
- Angle - Vehicle forward vs parking spot forward (0° or 180° = best)
- Side offset - Lateral distance from center (adaptive to spot/vehicle width)
- Forward offset - Longitudinal distance from center (adaptive to spot/vehicle length)
Usage Example
-- Calculate precision for player vehicle
local ps = career_modules_delivery_generator.getParkingSpotByPath(psPath)
local data = career_modules_delivery_precisionParking.calculateVehiclePrecisionScore(vehId, ps)
if data then
local bonus = career_modules_delivery_precisionParking.getPrecisionParkingBonus(data)
print(bonus.precisionLevel, bonus.moneyFlat, bonus.moneyPercent)
endSee Also
career_modules_delivery_parcelManager- Reward calculation integrationcareer_modules_delivery_vehicleTasks- Vehicle delivery reward breakdowncareer_modules_delivery_progress- Drop-off flow
Additional Exports
Functions
| Function | Description |
|---|---|
M.calculateCargoPrecisionParking(cargo, targetLocation) | Main function to calculate and apply precision parking for cargo delivery |
M.calculateVehiclePrecisionParking(taskData) | Main function to calculate and apply precision parking for vehicle delivery |
M.debugPrecisionParking(vehId, targetParkingSpot) | Debug function to test precision parking |
M.getPrecisionParkingConfig() | Get precision parking configuration (for UI/debugging) |
Values/Properties
| Export | Description |
|---|---|
M.calculateVehiclePrecisionScore | Expose calculateVehiclePrecisionScore for breakdown integration |
M.getPrecisionParkingBonus | Expose getPrecisionParkingBonus for debug module |
Delivery Parcel Modifiers
Defines cargo modifiers (timed, precious, large, fluid, etc.), generates them per-parcel, tracks modifier statistics, and checks unlock status.
Delivery Progress
Tracks delivery statistics, manages the drop-off flow (gathering data, confirming, applying rewards), and controls facility unlock/visibility.