RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Locations DetectorMission ManagerMissionsMission Screen UIPOI TestProgressMission Start TriggerUnlocks

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsgameplaymissions

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.


Module Exports (M)

Core Progress

FunctionSignatureDescription
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

Star & Reward Management

FunctionSignatureDescription
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

UI Formatting

FunctionSignatureDescription
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

Save Slot Management

FunctionSignatureDescription
setSaveSlot(slotName)Changes the active progress save slot
getSaveSlot() → name, pathReturns current save slot name and path
setSavePath(path?)Overrides the save path directly

Star & Progress Queries

FunctionSignatureDescription
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

Unlock Queries

FunctionSignatureDescription
missionHasQuickTravelUnlocked(missionId) → boolAlways true outside career
missionHasUserSettingsUnlocked(missionId) → boolAlways true outside career
getLeaderboardChangeKeys(missionId) → tableMaps leaderboard keys to change detection keys

Batch Mode

FunctionSignatureDescription
startBatchMode()Disables unlock processing during batch operations
endBatchMode()Re-enables unlock processing
getBatchMode() → boolReturns current batch mode state

Testing & Debug

FunctionSignatureDescription
generateAttempt(id, addAttemptData) → tableGenerates a random attempt for a mission
generateAttempts(id, amount, dumpChange?)Generates multiple random attempts
testHelpertableUtility functions: randomBool, randomAttemptType, randomMedal, randomVehicle, randomNumber
exportAllProgressToCSV()Stub for CSV export

Hooks / Lifecycle

FunctionDescription
onExtensionLoadedLoads condition type modules from progress/conditions/

Auto-Aggregate Types

Configured per-mission in mission.autoAggregates:

TypeDescriptionKey Config
simpleHighscoreTracks best value (ascending/descending) + leaderboardattemptKey, aggregateKey, sorting
simpleMedalTracks best medal (gold > silver > bronze > wood)attemptKey, aggregateKey
simpleSumAccumulates totalsattemptKey, aggregateKey
simpleComboCounterTracks consecutive successesattemptKey, aggregateKeyCurrent/Max
successFailCounterCounts successes and failures separatelyattemptKey, aggregateKeySuccessCount/FailCount

Attempt Types & Priority

TypePriorityDescription
completed0All default + bonus stars earned
passed10At least 1 default star earned
attempted20Tried but no stars
abandoned50Player quit
failed100Explicit failure

Save Data Structure

{
  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,
}

Career Reward Flow

-- 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

Format Functions

Used in leaderboard/aggregate UI formatting:

FunctionInput → 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)

Key Behaviors

  • 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

See Also

  • missions/locationsDetector - Nearby Mission Location Detection - Related reference
  • missions/missionManager - Mission Lifecycle Manager - Related reference
  • missions/missionScreen - Mission UI Screen & Starting Options - Related reference
  • Gameplay Systems Guide - Guide

POI Test

Reference for `gameplay_missions_poiTest`, a simple test/debug extension that creates POI markers from parking spots to validate the POI interaction system.

Mission Start Trigger

Reference for `gameplay_missions_startTrigger`, which parses mission start triggers into location data and clusters nearby missions for the POI/marker system.

On this page

Module Exports (M)Core ProgressStar & Reward ManagementUI FormattingSave Slot ManagementStar & Progress QueriesUnlock QueriesBatch ModeTesting & DebugHooks / LifecycleAuto-Aggregate TypesAttempt Types & PrioritySave Data StructureCareer Reward FlowFormat FunctionsKey BehaviorsSee Also