API ReferenceGE Extensionscareermodulesbranches
Career Leagues
Manages league definitions - groups of missions tied to skills. Handles league unlock conditions, star counting, sorting, and mission-to-league assignment.
Manages league definitions - groups of missions tied to skills. Handles league unlock conditions, star counting, sorting, and mission-to-league assignment.
Module Info
| Field | Value |
|---|---|
| Path | extensions/career/modules/branches/leagues.lua |
| Global | career_modules_branches_leagues |
| Type | Career Module |
Public API
| Function | Signature | Description |
|---|---|---|
getLeagueById | (id) | Returns a league by its ID |
isLeagueUnlocked | (id) | Checks if a league's unlock conditions are met (cached) |
clearLeagueUnlockCache | () | Clears cached unlock status for all leagues |
getSimpleUnlockedStatus | () | Returns {leagueId = bool} for all leagues |
formatLeague | (l) | Deep-copies a league, adds star counts and icons |
getLeaguesForProgressBranchPage | (branchId, ignoreSubSkills) | Returns formatted leagues for a branch page, sorted |
getLeaguesForUnlockChange | (before, after) | Returns leagues that became unlocked between snapshots |
getLeaguesForMission | (missionId) | Returns all leagues containing a mission |
getNoLeague | (skill, missions, driftSpots) | Deprecated stub |
getStarsForSkills | (skillIds) | Returns total and unlocked star counts across skills |
getStarsForSkill | (skillId) | Returns total and unlocked star counts for one skill |
addLeagueSortOrder | () | Assigns _order to all leagues by skill and file position |
startConditionIncludesLeague | (cond, leagueId) | Recursively checks if a start condition includes a league |
getStartConditionLeagueId | (cond, map) | Recursively extracts league IDs from a start condition |
Hooks
| Hook | Description |
|---|---|
onCareerModulesActivated | Loads league JSON files from /gameplay/*.leagues.json |
onMissionsLoadedFromFiles | Validates mission-to-league mappings, patches start conditions |
Unlock Condition Types
| Type | Fields | Description |
|---|---|---|
leagueStars | leagueId, stars | Requires N stars from another league |
branchLevel | skillId, level | Requires a branch to reach level N |
skillStars | skillId, stars | Requires N stars across a skill |
branchStars | branchId, stars | Requires N stars across a branch's skills |
inDevelopment | - | Always locked (placeholder) |
Usage Example
-- Check if a league is unlocked
if career_modules_branches_leagues.isLeagueUnlocked("drift_league_1") then
print("Unlocked!")
end
-- Get star progress for a skill
local total, unlocked = career_modules_branches_leagues.getStarsForSkill("bmra-drift")See Also
career_branches- Branch/skill hierarchygameplay_missions_missions- Mission datagameplay_missions_progress- Star counts
Additional Exports
Functions
| Function | Description |
|---|---|
M.clearLeagueUnlockCache() | No description available |
M.getLeagueById(id) | career utility |
M.getSimpleUnlockedStatus() | No description available |
M.getStarsForSkill(skillId) | No description available |
M.onAfterDriftSpotsLoaded(spotsById) | [[ |
Values/Properties
| Export | Description |
|---|---|
M.addLeagueSortOrder | Value: addLeagueSortOrder |
M.formatLeague | Value: formatLeague |
M.getLeaguesForMission | Value: getLeaguesForMission |
M.getLeaguesForProgressBranchPage | Value: getLeaguesForProgressBranchPage |
M.getLeaguesForUnlockChange | Value: getLeaguesForUnlockChange |
M.getNoLeague | Value: getNoLeague |
M.getStarsForSkills | Value: getStarsForSkills |
M.getStartConditionLeagueId | Value: getStartConditionLeagueId |
M.isLeagueUnlocked | Value: isLeagueUnlocked |
M.onCareerModulesActivated | Value: onCareerModulesActivated |
M.onMissionsLoadedFromFiles | Value: onMissionsLoadedFromFiles |
M.startConditionIncludesLeague | Value: startConditionIncludesLeague |
Career Branches Landing Page
Builds UI data for the career progress landing page - domain selection, branch skill cards, mission lists, facility data, and breadcrumb navigation.
Delivery Cargo Cards
Builds card UI data for the cargo screen - grouping, sorting, filtering of cargo items by type, destination, container, and task.