Rules
Defines race rule enforcement and penalties for track limit violations.
This system can:
Detect various track limit events (cuts, out-of-circuit, position gain, stopping)
Apply penalties such as time penalties, money fines, return position requirements, or disqualification
Global Settings
All rules are configured inside Config.Rules.Data and keyed by a TrackLimits.* type.
Config.Rules.Data[TrackLimits.SOME_RULE] = { ... }
Each rule entry supports:
Enabled (bool) → turn rule on/off
Rule-specific configuration values (timers, thresholds, etc.)
Penalties → list of penalties to apply when rule triggers
Penalties are processed in order and can include multiple types at once.
Penalty Types Used Here
⚠️ Values are typically expressed in milliseconds for time-based penalties.
Track Limits Rules
1) TrackLimits.CHECKPOINT_CUT
Prevents players from leaving the circuit too close to the next checkpoint.
Penalties (Default)
✅ Optional example (commented in config): money penalty can be added instead or alongside time.
2) TrackLimits.POSITION_CUT
Triggers when a player goes out of the circuit and gains a position in the same sector (between checkpoints).
Penalties (Default)
3) TrackLimits.OUT_OF_CIRCUIT
Triggers if player stays out of the circuit for too long.
Penalties (Default)
4) TrackLimits.STOPPING_VEHICLE
Triggers if player stops the vehicle on track (or in prohibited area) for too long.
You can enable/disable each rule independently via its Enabled flag.
Penalties can be combined (e.g., time + money).
Use Penalty.RETURN_POSITION if you want competitive enforcement against gaining advantage.
Last updated