API Reference GE Extensions gameplay missions Progress Reference for `gameplay_missions_progress`, the system that tracks mission attempts, aggregates progress, manages leaderboards, computes star rewards, and formats progress data for the UI.
Reference for gameplay_missions_progress, the system that tracks mission attempts, aggregates progress, manages leaderboards, computes star rewards, and formats progress data for the UI.
Function Signature Description aggregateAttempt(id, attempt, progressKey) → tableAggregates an attempt into mission progress; returns unlock/reward changes newAttempt(type, data) → tableCreates an attempt: {type, date, humanDate, data} saveMissionSaveData(id, dirtyDate)Persists mission save data to JSON loadMissionSaveData(mission) → table, boolLoads save data from file or creates clean defaults ensureProgressExistsForKey(mission, progressKey)Creates empty progress for a key if missing
Function Signature Description reduceCareerRewardsForDefaultStars(mission)Reduces money rewards to 10% after first unlock; removes vouchers setDynamicStarRewards(mission, userSettings)Calls mission's getDynamicStarReward for each star addCareerRewardInfo(starRewards, mission, attempt) → tableFormats career rewards with progress bars and animations
Function Signature Description formatSaveDataForUi(id, progressKey, ...) → tableFormats progress/leaderboards/stars for mission screen formatSaveDataForBigmap(id) → tableSimplified star summary for big map formatAttemptSimple(attempt, mission) → tableFormats a single attempt for display tryBuildContext(label, data) → tableBuilds translation context from mission data
Function Signature Description setSaveSlot(slotName)Changes the active progress save slot getSaveSlot() → name, pathReturns current save slot name and path setSavePath(path?)Overrides the save path directly
Function Signature Description formatStars(mission) → tableFormats unlocked star data for UI formatAggregatesForMissionTypeWithProgKey- Formats aggregate data across missions of same type getProgressAggregateCache- Returns cached aggregate data getUnlockedStarCountsForMissionById(id) → total, default, bonusReturns unlocked star counts startConditionMet- Checks if a mission's start condition is met
Function Signature Description missionHasQuickTravelUnlocked(missionId) → boolAlways true outside career missionHasUserSettingsUnlocked(missionId) → boolAlways true outside career getLeaderboardChangeKeys(missionId) → tableMaps leaderboard keys to change detection keys
Function Signature Description startBatchMode()Disables unlock processing during batch operations endBatchMode()Re-enables unlock processing getBatchMode() → boolReturns current batch mode state
Function Signature Description generateAttempt(id, addAttemptData) → tableGenerates a random attempt for a mission generateAttempts(id, amount, dumpChange?)Generates multiple random attempts testHelpertable Utility functions: randomBool, randomAttemptType, randomMedal, randomVehicle, randomNumber exportAllProgressToCSV()Stub for CSV export
Function Description onExtensionLoadedLoads condition type modules from progress/conditions/
Configured per-mission in mission.autoAggregates:
Type Description Key Config simpleHighscoreTracks best value (ascending/descending) + leaderboard attemptKey, aggregateKey, sortingsimpleMedalTracks best medal (gold > silver > bronze > wood) attemptKey, aggregateKeysimpleSumAccumulates totals attemptKey, aggregateKeysimpleComboCounterTracks consecutive successes attemptKey, aggregateKeyCurrent/MaxsuccessFailCounterCounts successes and failures separately attemptKey, aggregateKeySuccessCount/FailCount
Type Priority Description completed0 All default + bonus stars earned passed10 At least 1 default star earned attempted20 Tried but no stars abandoned50 Player quit failed100 Explicit failure
{
version = 20 , -- current version
progress = {
default = {
aggregate = { bestType, passed, completed, attemptCount, dnfCount, ... },
attempts = { { type , date, data, unlockedStars, ... }, ... },
leaderboards = { recent = {attemptIdx, ... }, ... }
}
},
unlockedStars = { starKey = count, ... },
quickTravelUnlocked = bool,
userSettingsUnlocked = bool,
}
-- During aggregateAttempt:
-- 1. Sanitize attempt (remove inactive stars, auto-calculate type)
-- 2. Aggregate generic progress (bestType, attemptCount, recent leaderboard)
-- 3. Set dynamic star rewards
-- 4. For each unlocked star: accumulate rewards, apply branch multiplier to money
-- 5. Add career reward info (progress bars, level-up animations)
-- 6. Apply rewards via career_modules_playerAttributes.addAttributes()
-- 7. Reduce future rewards (10% money, 0 vouchers after first unlock)
-- 8. Update mission unlocks, check for newly unlocked missions/leagues
Used in leaderboard/aggregate UI formatting:
Function Input → Output distancemeters → localized distance string detailledTimeseconds → M:SS:mmm rallyTimeFormatterseconds → H:MM:SS.T (adaptive) rallyPenaltyFormatterseconds → +Ns timespantimestamp → timespan object starsunlockedStars → DDBb style star string M.addCareerRewardInfo(starRewards, mission, attempt)M.aggregateAttempt(id, attempt, progressKey)M.endBatchMode()M.ensureProgressExistsForKey(missionInstance, progressKey)M.exportAllProgressToCSV()M.formatAggregatesForMissionTypeWithProgKeyvalue M.formatAttemptSimple(attempt, mission)M.formatSaveDataForBigmap(id)M.formatSaveDataForUi(id, onlyKey, includeMostRecentAttempt, fillAttempts)M.formatStars(mission)M.generateAttempt(id, addAttemptData)M.generateAttempts(id, amount, dumpChange)M.getBatchMode()M.getLeaderboardChangeKeys(missionId)M.getProgressAggregateCachevalue M.getSaveSlot()M.getSaveSlotVersionvalue M.getUnlockedStarCountsForMissionById(id)M.loadMissionSaveData(mission)M.missionHasQuickTravelUnlocked(missionId)M.missionHasUserSettingsUnlocked(missionId)M.newAttempt(type, data)M.onExtensionLoaded()M.reduceCareerRewardsForDefaultStars(mission)M.saveMissionSaveData(id, dirtyDate)M.setDynamicStarRewards(mission, userSettings)M.setSavePath(path)M.setSaveSlot(slotName)M.setSaveSlotVersionvalue M.startBatchMode()M.startConditionMetvalue M.testHelpervalue M.tryBuildContext(label, data)
Save path: settings/cloud/missionProgress/{slot}/{missionId}.json
Version upgrades iterate attempts through mission:updateAttempt() and re-aggregate
Batch mode suppresses unlock calculations during save data loading
Leaderboard default size: 5 entries
Money branch multiplier applied from career_branches.getLevelRewardMultiplier()
Progress bar animations handle multi-level-up scenarios with segmented animations