Lua:Drivetrain

Lua:Drivetrain

From BeamNG

Revision as of 02:28, 22 January 2015 by Nug700 (talk | contribs) (Attributes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Provides functions for accessing the drive train.

File location: lua\vehicle\drivetrain.lua

Attributes

bool _serialize.differentialMode = true
bool _serialize.manualShift = true
bool _serialize.autoClutch = true
bool _serialize.shifterMode = true
bool _serialize.activeModeIndex = true
number torque = 0
number gear = 0
number rpm = 0
number torqueTransmission = 0
table brake = 0
table throttle = 0
table wheels = {}
table wheelInfo = {}
bool engineDisabled = false
bool engineIgnition = true
number absPulse = 0
number fuelLeakRate = 0 -- L/sec
number fuel = 100
numberfuelCapacity = 100
number shifterMode = 2 -- initial value needs to fit to the two modes below
number differentialMode = 0
bool autoClutch = true
bool manualShift = false
number shifterPosition = 0
number wheelCount = 0
number avgAV = 0
number axleAngle = 0
number driveshaftAngle = 0
number clutch = 1
number activeModeIndex = 1

Member Functions

nil  (dt)
nil updateWheels (dt)
nil disableEngine ()
nil checkEngine ()
nil simpleAutoGearbox ()
nil realAutoGearbox (dt)
nil updateEngine (dt)
nil disableDriveshaft ()
bool isDriveshaftDisabled ()
nil updateCounts ()
nil updateDifferentials ()
nil beamBroke (id)
nil updateWheelSlip (p)
nil wheelSlipGFXreset ()
nil shiftUp ()
nil shiftDown ()
nil shiftToGear (val)
nil setShifterMode (v)
nil toggleShifterMode ()
nil setDifferentialMode (v)
nil toggleDifferentialMode ()
nil genDiffs ()
nil init ()
nil reset () -- for now: call init again, as it does no harm
nil refill ()
nil onDeserialized ()

Public Interface

  • updateEngine
  • updateWheels
  • updateWheelSlip
  • wheelSlipGFXreset
  • beamBroke
  • reset
  • init
  • refill
  • shiftUp
  • shiftDown
  • shiftToGear
  • toggleShifterMode
  • setShifterMode
  • onDeserialized