Skip to main content

Planner: Vehicle Condition

Revised Plan

Database

New table
VehicleService (one-to-one with VehicleRegistration):

  • Id (int, PK)
  • VehicleRegistrationId (int, FK → VehicleRegistration)
  • ConditionValue (int) — default 0
  • MissedServices (int) — default 0
  • LastServiceDistance (double) — default 0
  • TotalCompletedServices (int) — default 0

VehicleRegistration gets only a navigation property to VehicleService. No new columns on VehicleRegistration itself.


Degradation (MultiCarInfo.cs)

Hooks into the existing TrackVehicleDistance() call:

  • Base: +1 point per 250m
  • Penalty: +1 extra point per 250m per MissedServices (additional points to the base)
  • Every time DrivenDistance - LastServiceDistance >= 2,500,000m:
    • Increment a +1 to MissedServices
    • Notify the player they've missed a service
    • If ConditionValue >= 100,000: vehicle removed, player spectated

Car Mechanic Shop (new InSim button UI)

When a player is at a car mechanic location and clicks the shop button:

  • Show a panel with:
    • Current condition 0.0% to 100.0%
    • Missed services count
    • Service cost: €5,000 * (MissedServices + 1)
    • A "Service Vehicle" button
  • On confirm:
    • Charge player
    • Reset MissedServices = 0
    • Set LastServiceDistance = DrivenDistance

Display

  • Top of screen HUD: Show condition % for the current vehicle.
  • !garage info: Show condition %, missed services, and total completed services

New Location Property
Add ServiceLocation=true to Car Mechanic to determine if a player can service the car.