GE Lua Documentation

Press F to search!

getVehicleDetails

Definition


-- @/lua/ge/extensions/core/vehicles.lua:906

-- returns the key of the current vehicle (of player one)
-- one could also use: playerVehicle:getJBeamFilename()
local function getVehicleDetails(id)
  local res = {}
  local vehicle = getObjectByID(id)
  if vehicle then
    res.key       = vehicle.JBeam
    res.pc_file   = vehicle.partConfig
    res.position  = vehicle:getPosition()
    res.color     = vehicle.color
  end

  local model = res.key and getModel(res.key) or {}
  local config = {}
  local default = res.pc_file == pathDefaultConfig
  if res.pc_file ~= nil then
    res.config_key = string.match(res.pc_file, "vehicles/".. res.key .."/(.*).pc")
    config = model.configs[res.config_key] or model.model
  end
  return {current = res, model = model.model, configs = config, userDefault = default}
end

Callers

@/lua/ge/extensions/core/vehicles.lua
local function getCurrentVehicleDetails()
  return getVehicleDetails(be:getPlayerVehicleID(0))
end
@/lua/ge/extensions/editor/aiTests.lua

  local details = core_vehicles.getVehicleDetails(id)
  if details.model.Name then
@/lua/ge/extensions/flowgraph/modules/vehicleModule.lua
  -- all of these values are already cached in other systems.
  local vDetails = core_vehicles.getVehicleDetails(id)
  if not vDetails or not vDetails.model then return false end
@/lua/ge/extensions/gameplay/vehiclePerformance.lua
local function getClassFromVehId(vehId)
  local vehicleDetails = core_vehicles.getVehicleDetails(vehId)
  if not vehicleDetails then return end
@/lua/ge/extensions/gameplay/drag/general.lua
  else
    if core_vehicles.getVehicleDetails(vehicleId).configs["Drag Times"] then
      dial = core_vehicles.getVehicleDetails(vehicleId).configs["Drag Times"].time_1_4 or 10
    if core_vehicles.getVehicleDetails(vehicleId).configs["Drag Times"] then
      dial = core_vehicles.getVehicleDetails(vehicleId).configs["Drag Times"].time_1_4 or 10
    end

  local details = core_vehicles.getVehicleDetails(vehicleId)
  if details then
  for id, racer in pairs(dragData.racers) do
    local currentVehicle = core_vehicles.getVehicleDetails(id)
    local vehicleConfig = currentVehicle.configs
@/lua/ge/extensions/gameplay/drag/dragBridge.lua
  local configs = core_vehicles.getConfigList()
  local vehicleDetails = core_vehicles.getVehicleDetails(vehId)
  if not vehicleDetails then
@/lua/ge/extensions/gameplay/drag/saveSystem.lua
  -- Get vehicle details to find the config file path
  local vehicleDetails = core_vehicles.getVehicleDetails(vehicleId)
  if not vehicleDetails or not vehicleDetails.current then
@/lua/ge/extensions/career/modules/painting.lua
  local id = career_modules_inventory.getMapInventoryIdToVehId()[inventoryId]
  local info = core_vehicles.getVehicleDetails(id)
  return info.model and info.model.paints or {}