GE Lua Documentation

Press F to search!

metricGet

Definition


-- @/lua/ge/extensions/gameplay/statistic.lua:246

local function metricGet(name, carreer)
  local entry = nil
  if fileDataCareer and carreer then
    entry = fileDataCareer.entries[name]
  else
    entry = fileData.entries[name]
  end
  if not entry then
    return nil
  else
    return deepcopy(entry)
  end
end

Callers

@/lua/ge/extensions/gameplay/drift/statistics.lua
local function getStat(name)
  return gameplay_statistic.metricGet(name) and gameplay_statistic.metricGet(name).value or 0
end
local function getStat(name)
  return gameplay_statistic.metricGet(name) and gameplay_statistic.metricGet(name).value or 0
end
@/lua/ge/extensions/career/modules/milestones/generalMilestones/statistic.lua
      maxStep = 8,
      getValue = function() return (gameplay_statistic.metricGet("vehicle/total_odometer.length", true) or {value=0}).value end,
      getLabel = function(step, current, target) return "Long Distance Driver" end,
      maxStep = 8,
      getValue = function() return (gameplay_statistic.metricGet("general/mode/career.time", true) or {value=0}).value end,
      getLabel = function(step, current, target) return "Play the Game" end,
      maxStep = 8,
      getValue = function() return (gameplay_statistic.metricGet("vehicle/rollover", true)  or {value=0}).value end,
      getLabel = function(step, current, target) return string.format('Rollovers') end,
      maxStep = 8,
      getValue = function() return (gameplay_statistic.metricGet("vehicle/airtime.time", true) or {value=0}).value  end,
      getLabel = function(step, current, target) return string.format('Airtime') end,
@/lua/ge/extensions/gameplay/achievement.lua
  end
  local odo = gameplay_statistic.metricGet("vehicle/total_odometer.length")
  if odo and odo.value > 1e6 then