API ReferenceGE Extensionsgameplaymissionsunlocksconditions
Mission Conditions
Reference for mission-progress-based unlock condition types used by the mission unlock system.
Reference for mission-progress-based unlock condition types used by the mission unlock system.
Condition Types
missionPassed
Requires another mission to have been passed (at least 1 default star earned).
| Field | Type | Description |
|---|---|---|
missionId | string | Target mission ID |
progressKey | string | Progress key: "default", "any", "", or specific key |
M.missionPassed = {
info = 'The user has to have passed another mission.',
editorFunction = "displayMissionCondition",
getLabel = function(self)
return F.getTargetLabel(self.missionId, self.progressKey, 'pass')
end,
conditionMet = function(self)
return F.checkAggregateWithKey(self.missionId, self.progressKey, 'passed')
end
}missionCompleted
Requires another mission to have been completed (all default + bonus stars earned).
| Field | Type | Description |
|---|---|---|
missionId | string | Target mission ID |
progressKey | string | Progress key: "default", "any", "", or specific key |
M.missionFunction | value | - |
M.missionCompleted = {
info = 'The user has to have completed another mission.',
editorFunction = "displayMissionConditionWithProgressKey",
getLabel = function(self)
return F.getTargetLabel(self.missionId, self.progressKey, 'complete')
end,
conditionMet = function(self)
return F.checkAggregateWithKey(self.missionId, self.progressKey, 'completed')
end
}Helper Functions (F)
checkAggregateWithKey
F.checkAggregateWithKey = function(id, progressKey, field)
-- Resolves progressKey:
-- "default" / nil / "" → mission.defaultProgressKey
-- "any" → checks ALL progress keys
-- other → specific key
-- Returns true if aggregate[field] is truthy for any resolved key
endgetTargetLabel
F.getTargetLabel = function(id, progressKey, verb)
-- Returns localized label based on progressKey:
-- default → "missions.missions.unlock.{verb}.default" + {name}
-- any → "missions.missions.unlock.{verb}.any" + {name}
-- other → "missions.missions.unlock.{verb}.custom" + {name, setting}
endKey Behaviors
- These are the primary conditions used in
startConditionto create mission chains/dependencies passedchecksaggregate.passed(true if bestType is "passed" or "completed")completedchecksaggregate.completed(true if bestType is "completed")- When
progressKey = "any", iterates all progress keys - useful for missions with multiple configurations - Missing missions log an error but return
false - Used by
gameplay_missions_unlocks.getMissionsForCondition()to build forward/backward dependency links
See Also
- unlocks/conditions/careerConditions - Career Branch & League Conditions - Related reference
- unlocks/conditions/genericConditions - Generic Logic Conditions - Related reference
- unlocks/conditions/vehicleConditions - Vehicle-Based Conditions - Related reference
- Gameplay Systems Guide - Guide