Summary
The 4wd controller enables you to connect and disconnect a driveshaft and allows you to control a range box. The configuration needs to provide the correct powertrain device names (shaft and rangeBox) for it to work.
You can also use multiple 4wd controllers at once if desired, each one controlling a different set of devices.
File Info
|
|
Filename |
4wd.lua |
Path |
/lua/vehicle/controller/4wd.lua |
Type |
Auxiliary |
Usage type |
Multiple |
JBeam Properties
Public Functions
Description
Toggles between 2WD and 4WD
Description
Sets the 4WD mode to either “connected” or “disconnected”
Function name
toggleRange
Description
Toggles between High and Low range
Function name
setRangeMode
Description
Sets the range to either “high” or “low”
Function name
toggleDiffs
Description
Toggles between different states of the controlled differentials
Electrics
Description
Indicates if the rangeBox is in low range (1) or high range (0).
Description
Indicates if the transfer case is in 2WD (0) or 4WD (1) mode.
Simple Example
"controller": [
["fileName"],
["4wd", {"shaftName":"driveshaftF", "rangeBoxName":"rangeBox"}]
],