API ReferenceGE Extensionscareermodulesmilestones
General Milestones
M.dependencies = {"career_modules_milestones_milestones"}
Dependencies
M.dependencies = {"career_modules_milestones_milestones"}Central milestone collection and management. Gathers milestone configs from subsystems via hook, manages claim/reward flow, and provides milestone data to the UI.
Public API
| Function | Signature | Description |
|---|---|---|
M.claim | (id) | Claim rewards for a milestone step, advance claimedStep |
M.getMilestone | (id) → table | Get formatted milestone data for UI (progress, rewards, label) |
M.printDebug | () | Export all milestones to CSV file |
Hook Handlers
| Hook | Purpose |
|---|---|
M.onCareerModulesActivated | Collect milestones, setup callbacks |
M.onClientStartMission | Re-collect if empty |
M.onGetMilestones | Append milestones to list, apply filter |
Milestone Config Structure
Each subsystem provides milestone configs via onGeneralMilestonesCollect:
{
id = "branch_motorsport",
filter = {branch=true, general=true},
type = "branch",
maxStep = 10,
icon = "star",
color = "orange",
minValueIsPreviousStepTarget = true, -- subtract prev target from progress bar
getValue = function() return currentXP end,
getLabel = function(step, displayValue, target) return "Motorsport:" end,
getDescription = function(step, displayValue, target) return "Reach level 5" end,
getProgressLabel = function(step, current, target) return "500/1000 xp" end,
getTarget = function(step) return requiredXP[step] end,
getRewards = milestones.majorLinear, -- function(step) → rewards table
}Claim Flow
M.claim(id)
→ Get rewards for current step via getRewards(step)
→ career_modules_playerAttributes.addAttributes(sumChange)
→ Increment claimedStep
→ Hook: onGeneralMilestoneClaimed
→ Toast notificationgetMilestone Output
{
label = "Star Collector",
description = "Collect 50 stars",
progress = {{type="progressBar", minValue=0, currValue=35, maxValue=50, done=false}},
rewards = {{attributeKey="money", rewardAmount=500}},
claimable = false,
step = 2,
maxStep = 6,
icon = "star",
color = "orange",
claimFunction = function() ... end,
claimRefreshFunction = function() ... end,
}See Also
- milestones - Save/load, reward functions, UI bridge
- branches - Branch level milestones
- missions - Mission star milestones
Repair Screen
M.dependencies = {'career_modules_valueCalculator', 'career_modules_inventory', 'career_modules_playerAttributes', 'career_modules_payment', 'career_modules_insurance_insurance'}
Milestones Core
Core milestone infrastructure: save/load, claim bridge, reward functions, notification system, and UI data formatting. Used by all milestone subsystems.