This section is work in progress! Some links might lead to pages that are not yet finished, and will not work.
Summary
The vehicle controller is the main controller for any powered vehicle in beamNG. It manages the powertrain controls and interfaces with the different shiftlogic controllers for the various transmission types.
Either this controller or the dummy controller must be called on any vehicle or prop for it to work properly.
It is the main source of electrics
data for engine and transmission information.
File Info
|
|
Filename |
vehicleController.lua |
Path |
/lua/vehicle/controller/vehicleController.lua |
Type |
Main |
Usage type |
Single |
defaultOrder |
500 |
JBeam Properties
These properties are the properties specific to the vehicle controller itself.
Each shift-logic sub-controllers will also have it’s own specific properties, depending on the type of gearbox.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Used for the optimal shift point calculation.
Only applies to automatic gearboxes and arcade mode.
A higher value means the controller will upshift more quickly when decreasing throttle.
Only applies to automatic gearboxes and arcade mode.
A higher value means the controller will downshift more quickly when increasing throttle
Only applies to automatic gearboxes and arcade mode.
A higher value means the controller will downshift more quickly when increasing throttle.
Only applies to automatic gearboxes and arcade mode.
A higher value means the controller will upshift more quickly when decreasing throttle
Disable for to simulate mechanical or older electronic gearboxes.
Won’t be active if smaller than 0.
Won’t be active if smaller than 0.
Only applies to automatic gearboxes and arcade mode.
Helps stop the car from shifting up immediately when spinning the tires.
Only applies to automatic gearboxes and arcade mode.
Helps stop the car from downshifting immediately when the driven tires lock up from braking.
Mostly used with electric motors, as they aren’t used with a gearbox.
Applies to manual gearboxes when using shiftUp/shiftDown buttons, and when shifting with a DCT gearbox when chosen gear is not preselected.
Does not apply to manual gearboxes when using an H-shifter.
Only applies to automatic gearboxes and arcade mode.
Only applies to automatic gearboxes and arcade mode.
Public Functions
Description
Shifts the transmission up one gear.
Description
Shifts the transmission down one gear.
Function name
shiftToGearIndex
Description
Shifts the transmission to the selected gear.
Function name
cycleGearboxModes
Description
Switches between arcade and realistic shifting modes.
Function name
setGearboxMode
Description
Sets the gearbox mode to the defined option.
Function name
smartParkingBrake
Parameters
ivalue, filter
Description
Applies the parking brake and keeps it on if the user is actually parking the car.
Description
Activates the engine starter.
Function name
setEngineIgnition
Description
Activates engine ignition.
Description
Enables the transmission lock.
Function name
sendTorqueData
Description
Sends torque and power related data to the UI.
Function name
vehicleActivated
Description
Called upon active vehicle switch, executes code that upstes the UI.
Public Properties
Description
Throttle input
Description
Array containing a lot of engine related information for use by GUI elements
Name
fireEngineTemperature
Description
Exposes the temperature of an engine-like powertrain device to the fire simulation
Electrics
Inputs
Description
Brake input percentage.
Description
Brake input percentage.
Description
Clutch input percentage.
Description
Clutch input percentage.
Description
Indicates if the ignition is currently on. Will stay on if you stall.
Description
Throttle percentage. Affected by things like revmatching and throttle cut in the transmission shift logic.
Engine Information
Description
Indicates if the engine is disabled and can’t be turned on due to an issue.
Description
Engine load percentage,based on current torque compared to the maximum amount of torque the engine can produce.
Description
Effective throttle level. Will be 0 if the engine is disabled.
Description
Indicates if the engine is currently on.
Description
Temperature of the engine oil (used as the main engine temp on air cooled cars).
Description
Spin function for the radiator fan,which activates when the radiator fan turns on. Used for props.
Description
Engine rotation speed.
Description
Indicates if the ignition is currently on. Will stay on if you stall.
Description
Temperature of the radiator water (used as the main engine temp on water cooled cars).
Fuel Information
Description
Percentage of fuel left in the tank.
Description
Fuel tank capacity.
Description
Volume of fuel left in the tank
Description
Indicates that there is less than 10% fuel left in the tank.
Transmission Information
Description
Currently selected gear. Same as gearindex for manuals,other types will return the shifter position (PRDN) and add an S/M prefix before the gear number in manual modes.
Description
Indicates the current shifter position on automatic and DCT gearboxes.
Description
Currently selected gear index. Reverse gears are negative,neutral is 0
Description
Indicates if the gearbox is currently mid-shift
Description
The smoothed AV shiftlogic uses to determine arcade reverse switch and auto braking (among other things),exposed for the AI to use
Example Usage
"controller": [
["fileName"],
["vehicleController", {}],
],
"vehicleController": {
"calculateOptimalLoadShiftPoints": true,
"transmissionGearChangeDelay":2,
"gearboxDecisionSmoothingUp":2,
"gearboxDecisionSmoothingDown":2,
"aggressionSmoothingUp":1,
"aggressionSmoothingDown":0.5,
"aggressionHoldOffThrottleDelay":1.75,
"lowShiftDownRPM":1000,
"lowShiftUpRPM":1800,
},
Properties for a vehicle’s vehicleController are usually split between the various engine and transmission components of the vehicle.
Components which reduce the low-end torque might raise the clutchLaunch values, while components which raise the maximum rpm of the engine will raise the highShiftRPM values.