GE Lua Documentation

Press F to search!

getBranchByPath

Definition


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

local function getBranchByPath(pathId)
  getBranches()
  local branch = branchesByPath[pathId]
  if not branch and M.oldAttributeNamesToNewNames[pathId] then
    branch = branchesByPath[M.oldAttributeNamesToNewNames[pathId]]
    if branch then
      log('W', '', 'Using legacy branch path: ' .. pathId .. ' -> ' .. M.oldAttributeNamesToNewNames[pathId])
      log('D', '', 'Called from:\n' .. debug.tracesimple())
    end
  end
  return branch or missingBranch
end

Callers

@/lua/ge/extensions/career/modules/delivery/tutorial.lua
    vehicle = {
      unlocked = career_branches.getBranchByPath("logistics-vehicleDelivery").unlocked,
      isActive = M.isVehicleDeliveryTutorialActive(),
@/lua/ge/extensions/career/branches.lua
local function getBranchById(id)
  return M.getBranchByPath(id)
end
  end
  return getBranchByPath(pathId) or missingBranch
end
local function calcBranchLevelFromValue(val, id)
  local branch = getBranchByPath(id)
  local level = -1
local function getBranchSimpleInfo(id)
  local branch = getBranchByPath(id)
  local xp = M.getBranchXP(id)
local function getBranchLevel(id)
  local branch = getBranchByPath(id)
  if branch.id == 'missing' then return nil end
local function getBranchLevelByPath(pathId)
  local branch = getBranchByPath(pathId)
  if branch.id == 'missing' then return nil end
local function getBranchXP(id)
  local branch = getBranchByPath(id)
  if branch.id == 'missing' then return nil end
local function getXPNeededForLevel(id, level)
  local branch = getBranchByPath(id)
  if branch.id == 'missing' then return nil end
local function getBranchIcon(id)
  local branch = getBranchByPath(id)
  if branch.id == 'missing' then return nil end
local function getLevelLabel(id, level)
  local branch = getBranchByPath(id)
  if branch.id == 'missing' then return nil end
local function getLevelRewardMultiplier(id)
  local branch = getBranchByPath(id)
  if branch.id == 'missing' then return nil end
@/lua/ge/extensions/gameplay/missions/unlocks/conditions/careerConditions.lua
  editorFunction = "displayBranchLevel",
  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
@/lua/ge/extensions/career/modules/partShopping.lua
  career_branches.checkUnlocks()
  return career_branches.getBranchByPath('logistics-materials').unlocked
end
@/lua/ge/extensions/gameplay/missions/progress.lua
        for l = level + 1, levelAfter - 1 do
          local branch = career_branches.getBranchByPath(key)
          -- Check if both current and next level exist