VE Lua Documentation

Press F to search!

getDevice

Definition


-- @/lua/vehicle/powertrain.lua:890

local function getDevice(name)
  return name and powertrainDevices[name] or nil
end

Callers

@/lua/vehicle/controller/vehicleController/shiftLogic/electricMotor.lua
  for _, v in ipairs(motorNames) do
    local motor = powertrain.getDevice(v)
    if motor then
@/lua/vehicle/controller/vehicleController/shiftLogic/manualGearbox.lua
  sharedFunctions = sharedFunctionTable
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  newDesiredGearIndex = 0
@/lua/vehicle/controller/vehicleController/shiftLogic/sequentialGearbox.lua
  sharedFunctions = sharedFunctionTable
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  newDesiredGearIndex = 0
@/lua/vehicle/controller/linearActuators/linearActuatorTrailerFeet.lua
  local actuatorName = jbeamData.linearActuatorName
  actuator = powertrain.getDevice(actuatorName)
    if motorName then
      motor = powertrain.getDevice(motorName)
    else
@/lua/vehicle/controller/hydraulics/hydraulicsCombustionEngineControl.lua
    local relevantEngineName = jbeamData.controlledEngine or "mainEngine"
    controlledEngine = powertrain.getDevice(relevantEngineName)
    if not controlledEngine then
    local relevantPumpName = jbeamData.relevantPump or "pump1"
    relevantPump = powertrain.getDevice(relevantPumpName)
    if not relevantPump then
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffLock.lua
  end
  relevantDifferential = powertrain.getDevice(diffName)
@/lua/vehicle/controller/drivingDynamics/actuators/electronicDiffLock.lua
  end
  relevantDifferential = powertrain.getDevice(diffName)
@/lua/vehicle/controller/braking/transbrake.lua
  electricsName = jbeamData.electricsName or "transbrake"
  gearbox = powertrain.getDevice(gearboxName)
  M.updateGFX = gearbox and updateGFX or nop
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/aiParams.lua
      if nc then
        local engine = powertrain.getDevice("mainEngine")
        if engine and engine.nitrousOxideInjection and not engine.nitrousOxideInjection.isArmed then
      if nc then
        local engine = powertrain.getDevice("mainEngine")
        if engine and engine.nitrousOxideInjection and engine.nitrousOxideInjection.isArmed then
@/lua/vehicle/controller/powertrainControl/activeCenterDiff.lua
  local diffName = jbeamData.centerDiffName
  centerDiff = powertrain.getDevice(diffName)
  local axleDiff1Name = jbeamData.axleDiff1Name
  axleDiff1 = powertrain.getDevice(axleDiff1Name)
  local axleDiff2Name = jbeamData.axleDiff2Name
  axleDiff2 = powertrain.getDevice(axleDiff2Name)
@/lua/vehicle/controller/vehicleController/vehicleController.lua
  deviceProperty = deviceProperty or "outputAV1"
  local device = powertrain.getDevice(deviceName)
  return (device and device[deviceProperty]) and device[deviceProperty] or 0

  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
@/lua/vehicle/powertrain.lua
  for propulsionDevice, _ in pairs(duplicatedPropulsionDevices) do
    table.insert(propulsionDevices, powertrain.getDevice(propulsionDevice))
  end
    --print("--> " .. dumps(relevantDevice))
    local device = M.getDevice(relevantDevice.device)
    if device and device.setPartCondition then
  for _, deviceData in ipairs(relevantDevices) do
    local device = M.getDevice(deviceData.device)
    if device and device.getPartCondition then
@/lua/ge/extensions/freeroam/dragRace.lua
  if nc then
    local engine = powertrain.getDevice("mainEngine")
    if engine and engine.nitrousOxideInjection and not engine.nitrousOxideInjection.isArmed then
  if nc then
    local engine = powertrain.getDevice("mainEngine")
    if engine and engine.nitrousOxideInjection and engine.nitrousOxideInjection.isArmed then
@/lua/vehicle/controller/driveModes.lua
local function setExhaustGainMufflingOffset(engineName, mufflingOffset, gainOffset)
  local engine = powertrain.getDevice(engineName)
  if not engine or not engine.setExhaustGainMufflingOffset then
local function setTurbochargerWastegateOffset(engineName, wastegateOffset)
  local engine = powertrain.getDevice(engineName)
  if not engine or not engine.turbocharger or not engine.turbocharger.setWastegateOffset then
local function setSuperchargerBypassPressure(engineName, bypassPressure)
  local engine = powertrain.getDevice(engineName)
  if not engine or not engine.supercharger or not engine.supercharger.setBypassPressure then
      if deviceName and deviceMode then
        local device = powertrain.getDevice(deviceName)
        if device and device.setMode then
@/lua/vehicle/controller/gauges/genericGauges.lua
  for k, v in pairs(mergedConfig) do
    local device = powertrain.getDevice(k)
    if device then
@/lua/vehicle/controller/braking/hydraulicPumpBrake.lua
  local relevantEngineName = jbeamData.relevantEngineName or "mainEngine"
  relevantEngine = powertrain.getDevice(relevantEngineName)
  engineRunningThresholdAV = 10
@/lua/vehicle/controller/powertrainControl/antiLag.lua
  local engineName = jbeamData.controlledEngine or "mainEngine"
  controlledEngine = powertrain.getDevice(engineName)
  if not controlledEngine then
@/lua/vehicle/controller/propAnimation/sequentialLever.lua
  local gearboxName = jbeamData.relevantGearboxName or "gearbox"
  relevantGearbox = powertrain.getDevice(gearboxName)
  if type(jbeamData.shiftSoundNode_nodes) == "table" and jbeamData.shiftSoundNode_nodes[1] and type(jbeamData.shiftSoundNode_nodes[1]) == "number" then
@/lua/vehicle/controller/shiftLights.lua
  if jbeamData.engineName and jbeamData.maxEngineRPMOffset then
    local engine = powertrain.getDevice(jbeamData.engineName)
    if engine then
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox2.lua
  sharedFunctions = sharedFunctionTable
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  torqueConverter = powertrain.getDevice("torqueConverter")
  gearbox = powertrain.getDevice("gearbox")
  torqueConverter = powertrain.getDevice("torqueConverter")
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox.lua
  sharedFunctions = sharedFunctionTable
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  torqueConverter = powertrain.getDevice("torqueConverter")
  gearbox = powertrain.getDevice("gearbox")
  torqueConverter = powertrain.getDevice("torqueConverter")
@/lua/vehicle/controller/vehicleController/shiftLogic/dummy.lua
  sharedFunctions = sharedFunctionTable
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua
  end
  relevantDifferential = powertrain.getDevice(diffName)
@/lua/vehicle/controller/nitrousOxideInjection.lua

  engine = powertrain.getDevice(engineName)
  local hasNitrousOxideInjection = engine and engine.nitrousOxideInjection and engine.nitrousOxideInjection.isExisting
@/lua/vehicle/controller/powertrainControl/combustionEngineGovenor.lua
  local controlledEngineName = jbeamData.controlledEngineName or "mainEngine"
  controlledEngine = powertrain.getDevice(controlledEngineName)
  if not controlledEngine then
@/lua/vehicle/controller/propAnimation/hPattern.lua
  local gearboxName = jbeamData.relevantGearboxName or "gearbox"
  relevantGearbox = powertrain.getDevice(gearboxName)
  if type(jbeamData.shiftSoundNode_nodes) == "table" and jbeamData.shiftSoundNode_nodes[1] and type(jbeamData.shiftSoundNode_nodes[1]) == "number" then
@/lua/vehicle/controller/4wd.lua
local function init(jbeamData)
  shaft = powertrain.getDevice(jbeamData.shaftName)
  rangeBox = powertrain.getDevice(jbeamData.rangeBoxName)
  shaft = powertrain.getDevice(jbeamData.shaftName)
  rangeBox = powertrain.getDevice(jbeamData.rangeBoxName)
  if shaft then
@/lua/vehicle/controller/vehicleController/shiftLogic/automaticGearbox.lua
  sharedFunctions = sharedFunctionTable
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  torqueConverter = powertrain.getDevice("torqueConverter")
  gearbox = powertrain.getDevice("gearbox")
  torqueConverter = powertrain.getDevice("torqueConverter")
  newDesiredGearIndex = 0
@/lua/vehicle/controller/drivingDynamics/actuators/activeCenterDiffLock.lua
  end
  relevantDiff = powertrain.getDevice(centerDiffName)
@/lua/vehicle/controller/drivingDynamics/supervisors/components/motorTorqueControl.lua
    local throttleFactorData = throttleFactors[motorName]
    local motor = powertrain.getDevice(motorName)
    if motor then
@/lua/vehicle/controller/drivingDynamics/actuators/electronicSplitShaftLock.lua
  end
  relevantSplitShaft = powertrain.getDevice(splitShaftName)
@/lua/vehicle/controller/drivingDynamics/supervisors/tractionControl.lua
  for _, motorName in ipairs(tractionControlledMotors) do
    local motor = powertrain.getDevice(motorName)
    if motor then
@/lua/vehicle/extensions/gameplayInterfaceModules/interactPowertrain.lua

  local device = powertrain.getDevice(deviceName)
  return { result = device[deviceProperty] }
@/lua/vehicle/controller/powertrainControl/rimPullControl.lua
  local torqueConverterName = jbeamData.torqueConverterName or "torqueConverter"
  relevantTorqueConverter = powertrain.getDevice(torqueConverterName)
  if not relevantTorqueConverter then
@/lua/vehicle/drivetrain.lua
local function updateProxy()
  proxyEngine = powertrain.getDevice("mainEngine")
  proxyGearbox = powertrain.getDevice("gearbox")
  proxyEngine = powertrain.getDevice("mainEngine")
  proxyGearbox = powertrain.getDevice("gearbox")
@/lua/vehicle/controller/twoStepLaunch.lua
  electricsName = jbeamData.electricsName or "twoStep"
  engine = powertrain.getDevice(engineName)
  M.updateGFX = engine and updateGFX or nop
@/lua/ge/extensions/gameplay/drag/utils.lua
          if nc then
            local engine = powertrain.getDevice("mainEngine")
            if engine and engine.nitrousOxideInjection and not engine.nitrousOxideInjection.isArmed then
          if nc then
            local engine = powertrain.getDevice("mainEngine")
            if engine and engine.nitrousOxideInjection and engine.nitrousOxideInjection.isArmed then
          if nc then
            local engine = powertrain.getDevice("mainEngine")
            if engine and engine.nitrousOxideInjection and engine.nitrousOxideInjection.isArmed then
@/lua/vehicle/controller/vehicleController/shiftLogic/dctGearbox.lua
  sharedFunctions = sharedFunctionTable
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  engine = powertrain.getDevice("mainEngine")
  gearbox = powertrain.getDevice("gearbox")
  newDesiredGearIndex = 0
@/lua/vehicle/controller/braking/compressionBrake.lua
  local engineName = jbeamData.controlledEngine or "mainEngine"
  controlledEngine = powertrain.getDevice(engineName)
  if not controlledEngine then