API Reference GE Extensions career Career Branches Manages the career progression hierarchy: domains → branches → skills. Loads branch definitions from `/gameplay/domains/`, computes levels, XP, unlocks, and ordering.
Manages the career progression hierarchy: domains → branches → skills. Loads branch definitions from /gameplay/domains/, computes levels, XP, unlocks, and ordering.
Field Value Path extensions/career/branches.luaGlobal career_branchesType Extension
Field Type Description M.oldAttributeNamesToNewNamestable Maps legacy branch names to new path-based names (e.g. "drift" → "bmra-drift") M.newAttributeNamesToOldNamestable Reverse mapping of oldAttributeNamesToNewNames
Function Signature Description getBranches()Returns all branches in a dict by ID. Lazy-loads and caches from /gameplay/domains/ getBranchById(id)Alias for getBranchByPath(id) getBranchByPath(pathId)Looks up a branch by its path-based ID. Falls back to legacy name mapping getBranchByDomainBranchSkill(domainId, branchId, skillId)Builds a path ID from domain/branch/skill and looks up getSortedBranches()Returns branches sorted by hierarchical order getBranchLevel(id)Returns current level for a branch from player attributes getBranchLevelByPath(pathId)Same as getBranchLevel but takes a pathId getBranchXP(id)Returns current XP value for a branch getXPNeededForLevel(id, level)Returns requiredValue for a given level getBranchIcon(id)Returns icon string for a branch getLevelLabel(id, level)Returns display label for a branch level getLevelRewardMultiplier(id)Returns reward multiplier for current level of a branch getBranchSimpleInfo(id)Returns compact info: label, level, icon, progress, max calcBranchLevelFromValue(val, id)Calculates level from XP value. Returns level, curLvlProgress, neededForNext, prevThreshold, nextThreshold orderAttributeKeysByBranchOrder(list)Sorts attribute keys by branch display order orderBranchNamesKeysByBranchOrder(list)Sorts branch name keys by order expandUnlocks(skill, level, unlocks)Expands automatic unlock entries (e.g., mission counts) checkUnlocks()Re-evaluates unlock conditions for all branches extractBranchPathIdFromFilePath(filePath)Extracts a branch pathId from a file system path getOrder(key)Returns sort order for an attribute key
Hook Description onSaveCurrentSaveSlotSaves branch unlock state to branchUnlocks.json onCareerModulesActivatedLoads saved unlock data onGetUnlockFlagDefinitionsRegisters unlock flag definitions for all branch levels and certifications onPlayerAttributesChanged(registered but defined externally)
Domain (e.g. "apm")
└─ Branch (e.g. "apm-motorsport")
└─ Skill (e.g. "apm-motorsport-timeTrials")
Each branch has: isDomain, isBranch, isSkill, parentId, parentDomain, parentBranch.
oldAttributeNamesToNewNames maps old names like "drift" → "bmra-drift", "delivery" → "logistics-delivery".
-- Get branch level
local level = career_branches. getBranchLevel ( "logistics-delivery" )
-- Get XP progress
local xp = career_branches. getBranchXP ( "logistics-delivery" )
-- Calculate level from arbitrary value
local lvl, progress, needed = career_branches. calcBranchLevelFromValue ( 250 , "logistics-delivery" )
-- Get sorted branches for UI display
for _, branch in ipairs (career_branches. getSortedBranches ()) do
print (branch. name , branch. id )
end
career_modules_playerAttributes - XP values
career_modules_unlockFlags - Flag-based unlock conditions
gameplay_missions_missions - Mission data for automatic unlocks
Function Description M.getOrder(key)No description available
Export Description M.calcBranchLevelFromValueValue: calcBranchLevelFromValue M.checkUnlocksValue: checkUnlocks M.expandUnlocksValue: expandUnlocks M.extractBranchPathIdFromFilePathValue: extractBranchPathIdFromFilePath M.getBranchByDomainBranchSkillValue: getBranchByDomainBranchSkill M.getBranchByIdValue: getBranchById M.getBranchByPathValue: getBranchByPath M.getBranchIconValue: getBranchIcon M.getBranchLevelValue: getBranchLevel M.getBranchLevelByPathValue: getBranchLevelByPath M.getBranchSimpleInfoValue: getBranchSimpleInfo M.getBranchXPValue: getBranchXP M.getBranchesValue: getBranches M.getLevelLabelValue: getLevelLabel M.getLevelRewardMultiplierValue: getLevelRewardMultiplier M.getSortedBranchesValue: getSortedBranches M.getXPNeededForLevelValue: getXPNeededForLevel M.onCareerModulesActivatedValue: onCareerModulesActivated M.onGetUnlockFlagDefinitionsValue: onGetUnlockFlagDefinitions M.onPlayerAttributesChangedValue: onPlayerAttributesChanged M.onSaveCurrentSaveSlotValue: onSaveCurrentSaveSlot M.orderAttributeKeysByBranchOrderValue: orderAttributeKeysByBranchOrder M.orderBranchNamesKeysByBranchOrderValue: orderBranchNamesKeysByBranchOrder