Sequential Gearbox Shift Logic
Shift logic for sequential manual transmissions. Gear changes are made one step at a time (up or down) via paddle shifters or a sequential lever. Supports flat-shift (upshift without lifting throttle) and auto-blip downshifts.
Shift logic for sequential manual transmissions. Gear changes are made one step at a time (up or down) via paddle shifters or a sequential lever. Supports flat-shift (upshift without lifting throttle) and auto-blip downshifts.
State Fields
| Field | Type | Description |
|---|---|---|
gearboxHandling, timer, timerConstants, inputValues, shiftPreventionData, shiftBehavior, smoothedValues | table | shared state data. |
currentGearIndex, maxGearIndex, minGearIndex | number | gear range. |
throttle, brake, clutchRatio | number | user input state. |
shiftingAggression | number | aggression level (typically fixed at 1 for sequentials). |
isArcadeSwitched, isSportModeActive | boolean | logic status flags. |
smoothedAvgAVInput, rpm, idleRPM, maxRPM | number | speed telemetry. |
engineThrottle, engineLoad, engineTorque, flywheelTorque, gearboxTorque | number | load telemetry. |
ignition, isEngineRunning | boolean | engine state. |
oilTemp, waterTemp, checkEngine | number | thermal diagnostic state. |
energyStorages | table | fuel sources. |
Public API
| Function | Description |
|---|---|
shiftUp() | Requests a step up or down in the gear sequence. |
shiftToGearIndex(index, ignoreSequentialBounds) | Attempts to shift to a specific gear index, optionally bypassing sequential constraints. |
getGearName() | returns gear index and UI position. |
getState() | State persistence for the current gear. |
Hooks
| Hook | Description |
|---|---|
init(jbeamData, sharedFunctionTable) | Initializes ignition cut timing and sequential shift parameters. |
gearboxBehaviorChanged(behavior) | Selects appropriate update loops for automated or manual clutch usage. |
See Also
- Vehicle Controller — Parent controller
- Manual Gearbox — H-pattern manual
- DCT Gearbox — Dual-clutch transmission
- Sequential Lever Animation — Shifter prop animation
Manual Gearbox Shift Logic
Shift logic for manual (stick shift) transmissions. Manages clutch engagement, synchromesh simulation, gear grinding detection, and rev-matching. In arcade mode, provides automatic clutch assistance.
Electric Battery Component
Logic defined in `lua/vehicle/energyStorage/electricBattery.lua`. Simulates electrical energy storage for EVs and hybrids.