GE Lua Documentation

Press F to search!

getBranchLevelByPath

Definition


-- @/lua/ge/extensions/career/branches.lua:338

local function getBranchLevelByPath(pathId)
  local branch = getBranchByPath(pathId)
  if branch.id == 'missing' then return nil end
  local attValue = career_modules_playerAttributes and career_modules_playerAttributes.getAttributeValue(branch.attributeKey) or 0
  return calcBranchLevelFromValue(attValue, pathId)
end

Callers

@/lua/ge/extensions/gameplay/missions/unlocks/conditions/careerConditions.lua
  getLabel = function(self) return {txt = "missions.missions.unlock.attributeLevel.atLeast", context = {branchName = career_career and career_branches.getBranchByPath(self.branchId).name or self.branchId, level = self.level}} end,
  conditionMet = function(self) return ((not career_career) or (not career_career.isActive()) or (not career_branches)) or career_branches.getBranchLevelByPath(self.branchId) >= self.level end
}