Damage System
The kartik-mechanic resource features a realistic damage system that maps vehicle impacts to specific part wear. Unlike standard GTA V damage which only affects engine and body health, this system applies mechanical wear to internal components based on the location and magnitude of the hit.
How It Works
The system listens for impact events (CEventNetworkEntityDamage) and calculates the "Damage Magnitude" based on the drop in engine and body health.
- Impact Threshold: Small bumps (controlled by
impactThresholdindamage_config.lua) are ignored to prevent excessive wear from parking taps. - Location Detection: The script analyzes the vehicle's velocity vector at the moment of impact to determine where the vehicle was hit (Front, Rear, Sides, or Bottom).
- Part Mapping: Each hit location is mapped to specific mechanical parts. For example, a front-end collision will damage the Radiator and Pistons, while a rear-end hit affects the Gearbox and Clutch.
- Class Multipliers: Different vehicle classes have varying durability. Motorcycles take more part damage per impact, while Industrial vehicles take significantly less.
Configuration
You can tune the sensitivity and mapping in shared/damage_config.lua.
Key Settings
| Setting | Description |
|---|---|
enabled | Toggle the entire part-damage-from-impact system. |
impactThreshold | Minimum health drop required to trigger part wear (Default: 15.0). |
wearMultiplier | Global scale for how much wear is applied (Default: 0.05). |
classMultipliers | Scale damage per vehicle class (e.g., 0.5 for trucks, 2.0 for bikes). |
Part Mapping Examples
| Hit Location | Primary Parts Affected |
|---|---|
| Front | Radiator, Pistons, Spark Plugs, Alternator, Oil Pan |
| Rear | Gearbox, Clutch |
| Left / Right | Suspension, Tires, Brakes |
| Bottom | Suspension, Oil Pan, Fuel Pump |