VE Lua Documentation

Press F to search!

getFFBConfig

Definition


-- @/lua/vehicle/hydros.lua:578

local function getFFBConfig()
  return {
    forceCoef = M.wheelFFBForceCoef,
    softlockForce = softlockForceCoef,
    smoothing = wheelFFBSmoothing / 0.7,
    smoothing2 = (wheelFFBSmoothing2-500)/109, -- IMPORTANT: these equations exist in 3 places in hydros.lua, 2 places in options.js, and 1 place in bindings.lua
    smoothing2automatic = wheelFFBSmoothing2automatic ~= false,
    gforceCoef = M.GforceCoef,
  }
end

Callers

@/ui/ui-vue/mockdata/inputBindings.js
                "title": "ui.inputActions.vehicle.ffbForceCoefDec.title",
                "onDown": "local c = hydros.getFFBConfig(); c.forceCoef = c.forceCoef - 10; hydros.setFFBConfig(c) ui_message('Testing FFB strength at  '..dumps(c.forceCoef))",
                "order": 61,
                "title": "ui.inputActions.vehicle.ffbSmoothingDec.title",
                "onDown": "local c = hydros.getFFBConfig(); c.smoothing = c.smoothing - 10; hydros.setFFBConfig(c) ui_message('Testing FFB smoothing at '..dumps(c.smoothing))",
                "order": 63,
                "title": "ui.inputActions.vehicle.ffbSmoothingInc.title",
                "onDown": "local c = hydros.getFFBConfig(); c.smoothing = c.smoothing + 10; hydros.setFFBConfig(c) ui_message('Testing FFB smoothing at '..dumps(c.smoothing))",
                "order": 62,
                "title": "ui.inputActions.vehicle.ffbForceCoefInc.title",
                "onDown": "local c = hydros.getFFBConfig(); c.forceCoef = c.forceCoef + 10; hydros.setFFBConfig(c) ui_message('Testing FFB strength at '..dumps(c.forceCoef))",
                "order": 60,
@/lua/ge/extensions/core/input/bindings.lua
  end
  local ffbConfigString = be:getFFBConfig(FFBID)
  local state, ffbConfig = pcall(json.decode, ffbConfigString)

local function getFFBConfig(veh)
  local ffbConfig, FFBID
  for _,veh in ipairs(getAllVehicles()) do
    veh:queueLuaCommand("hydros.onFFBConfigChanged("..serialize(getFFBConfig(veh))..")")
  end