GE Lua Documentation

Press F to search!

setConfig

Definition


-- @/lua/ge/extensions/core/vehicle/partmgmt.lua:640

local function mergeConfig(inData, respawn)
  --dump{"mergeConfig> ", inData, respawn}
  local veh = getPlayerVehicle(0)
  local playerVehicle = vehManager.getPlayerVehicleData()
  if not veh or not playerVehicle then
    log('E', 'partmgmt', 'no active vehicle')
    return
  end

  if respawn == nil then respawn = true end -- respawn is required all the time except when loading the vehicle

  if not inData or type(inData) ~= 'table' then
    log('W', "partmgmt.mergeConfig", "invalid argument [" .. type(inData) .. '] = '..dumps(inData))
    return
  end

  tableMerge(playerVehicle.config, inData)

  if respawn then
    --dump{"RESPAWN: ", playerVehicle.config}
    veh:respawn(serialize(playerVehicle.config))
  else
    local paintCount = tableSize(inData.paints)
    for i = 1, paintCount do
      vehManager.liveUpdateVehicleColors(veh:getId(), veh, i, inData.paints[i])
    end
    veh:setField('partConfig', '', serialize(playerVehicle.config))
  end
end

Callers

@/lua/vehicle/controller/drivingDynamics/actuators/activeCenterDiffLock.lua
  if newP or newI or newD then
    lockCoefPID:setConfig(controlParameters.clutchPIDkP, controlParameters.clutchPIDkI, controlParameters.clutchPIDkD, 0, 1, nil, nil, 0)
  end

local function setConfig(configTable)
  controlParameters = configTable
@/lua/ge/extensions/scenario/busdriver.lua
    -- applying new config to vehicle
    extensions.core_vehicle_partmgmt.setConfig(vehicleConfig)
  end
@/lua/ge/extensions/tech/impactgen/crashOutput.lua
  be:enterVehicle(0, ego)
  core_vehicle_partmgmt.setConfig(config)
  be:enterVehicle(0, ego)
  core_vehicle_partmgmt.setConfig(config)
  be:enterVehicle(0, ego)
  core_vehicle_partmgmt.setConfig(config)
  be:enterVehicle(0, veh)
  core_vehicle_partmgmt.setConfig(config)
@/lua/vehicle/controller/drivingDynamics/actuators/electronicSplitShaftLock.lua
  if newP or newI or newD then
    clutchRatioPID:setConfig(controlParameters.clutchPIDkP, controlParameters.clutchPIDkI, controlParameters.clutchPIDkD, 0, 1, nil, nil, 0)
  end

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua
  if newP or newI or newD then
    biasPID:setConfig(controlParameters.brakingPIDkP, controlParameters.brakingPIDkI, controlParameters.brakingPIDkD, -1, 1)
  end

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/supervisors/yawControl.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/supervisors/components/awdControl.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/supervisors/tractionControl.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/common/controlSystems.lua

function PIDParallel:setConfig(kP, kI, kD, minOutput, maxOutput, integralInCoef, integralOutCoef, minIntegral, maxIntegral, errorDeadzone)
  self.kP = kP or self.kP

function PIDStandard:setConfig(kP, tI, tD, minOutput, maxOutput, integralInCoef, integralOutCoef, minIntegral, maxIntegral, errorDeadzone)
  self.kP = kP or self.kP
@/lua/vehicle/controller/drivingDynamics/supervisors/components/motorTorqueControl.lua
      wheelGroupControlData[k].minimumThrottleLimit = v.minimumThrottleLimit
      wheelGroupControlData[k].tractionControlPID:setConfig(v.kP, v.kI, v.kD, 0, 1, v.integralInCoef, v.integralOutCoef, 0)
    end

local function setConfig(configTable)
  controlParameters = configTable
@/lua/ge/extensions/editor/perfProfiler.lua
          extensions.load('test_util_camPosDataToBucket')
          test_util_camPosDataToBucket.setConfig({sampleKey = currentDataKey})
          test_util_camPosDataToBucket.processSamples(file.samples)
          extensions.load('test_util_camPosDataToBucket')
          test_util_camPosDataToBucket.setConfig({sampleKey = currentDataKey})
          test_util_camPosDataToBucket.processSamples(file.samples)
@/lua/ge/extensions/tech/techCore.lua
  veh.autoEnterVehicle = "false"  -- without this, respawn() changes focus to the vehicle
  core_vehicle_partmgmt.setConfig(cfg)
  -- the following code requires autoEnterVehicle=false to have effect because otherwise veh:respawn()
  -- the following code requires autoEnterVehicle=false to have effect because otherwise veh:respawn()
  -- in setConfig() causes enterVehicle() AFTER the following code was executed (see function spawnCCallback)
  if cur ~= nil then
@/lua/vehicle/controller/drivingDynamics/supervisors/components/aeroControl.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/actuators/adaptiveTorsionBars.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/supervisors/yawProviders/STMEstimate.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/supervisors/components/diffControl.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/CMU.lua
          --dump(configTable)
          receiver.setConfig(configTable)
          sendConfigData()

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/supervisors/components/brakeControl.lua
      if wheelControlData[k].tractionControlBrakingPID then
        wheelControlData[k].tractionControlBrakingPID:setConfig(v.kP, v.kI, v.kD, 0, 1, v.integralInCoef, v.integralOutCoef, 0)
      end
    local avSettings = controlParameters.yawControl.PIDSettings.yawAV
    yawControlAVBrakingPID:setConfig(avSettings.kP, avSettings.kI, avSettings.kD, 0, 1, avSettings.integralInCoef, avSettings.integralOutCoef, 0)
  end
    local slipAngleSettings = controlParameters.yawControl.PIDSettings.slipAngle
    yawControlSlipAngleBrakingPID:setConfig(slipAngleSettings.kP, slipAngleSettings.kI, slipAngleSettings.kD, 0, 1, slipAngleSettings.integralInCoef, slipAngleSettings.integralOutCoef, 0)
  end
    absWheelData[k].absTime = 1 / v.absFrequency
    absWheelData[k].absBrakingPID:setConfig(v.kP, v.kI, v.kD, 0, 1, v.integralInCoef, v.integralOutCoef, 0)
    absWheelData[k].minSteeringCoef = v.minSteeringCoef

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/actuators/adaptiveDampers.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/controller/drivingDynamics/supervisors/slipProviders/virtualSpeedSlip.lua

local function setConfig(configTable)
  controlParameters = configTable
@/lua/ge/extensions/editor/util/vehicleSelectUtil.lua
    self:setModel(data.model)
    self:setConfig(data.config)
    if data.customConfigPath or data.customConfigActive then

function C:setConfig(config) -- directly sets the config data, by key (self.model needs to exist)
  if not config or not self.model then return end
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffLock.lua
  if newP or newI or newD then
    lockingPID:setConfig(controlParameters.lockingPIDkP, controlParameters.lockingPIDkI, controlParameters.lockingPIDkD, 0, 1)
  end

local function setConfig(configTable)
  controlParameters = configTable
@/lua/vehicle/extensions/debug/advancedExternalDebug.lua
          --dump(configTable)
          receiver.setConfig(configTable)
          sendConfigData()
@/lua/vehicle/controller/drivingDynamics/actuators/electronicDiffLock.lua
  if newP or newI or newD then
    brakingPID:setConfig(controlParameters.brakingPIDkP, controlParameters.brakingPIDkI, controlParameters.brakingPIDkD, -1, 1)
  end

local function setConfig(configTable)
  controlParameters = configTable