API ReferenceGE Extensionsgameplaymissions
Locations Detector
Reference for `gameplay_missions_locationsDetector`, which detects missions near the player by checking clustered POI locations.
Reference for gameplay_missions_locationsDetector, which detects missions near the player by checking clustered POI locations.
Module Exports (M)
| Function | Signature | Description |
|---|---|---|
getNearbyLocations | getNearbyLocations(level, playerPosition) → table | Returns nearby missions at the player's position |
onPoiTriggered | (hook) | Forward-declared but not implemented in-file |
isEnabled | (hook) | Forward-declared but not implemented in-file |
M.getNearbyLocations | (level, playerPosition) | - |
M.isEnabled | value | - |
M.onPoiTriggered | value | - |
Internals
getNearbyLocations
Clears and repopulates a cached nearbyLocations table each call:
local nearbyLocations = { missions = {} }
local function getNearbyLocations(level, playerPosition)
table.clear(nearbyLocations.missions)
-- Calls getMissionsAtLocation internally
return nearbyLocations
endgetMissionsAtLocation
Iterates over all POI clusters from gameplay_missions_clustering and checks proximity using defaultLocationCheck:
local function defaultLocationCheck(location, level, playerPosition, mission)
return location.pos and location.radius
and playerPosition:distance(location.pos) <= location.radius
endFor each cluster within range, all contained mission elements are added to nearbyLocations.missions with:
type- cluster element typemission- mission object fromgameplay_missions_missions.getMissionById()location- the cluster itselfid- the contained ID
How It Works
-- Flow:
-- 1. Get all clusters (optionally merged by bigMap merge radius)
-- 2. For each cluster, check if playerPosition is within radius
-- 3. For matching clusters, look up each contained mission by ID
-- 4. Return { missions = { {type, mission, location, id}, ... } }
-- The accessible flag is currently hardcoded to true:
accessible = true -- keeping this for later, when we have bg activities againKey Behaviors
- Uses
gameplay_missions_clustering.getAllClusters()for cluster data - When the big map is active, uses
freeroam_bigMapMode.clusterMergeRadiusfor wider clustering - Contains commented-out legacy code for checking mission visibility and ongoing status
- The
missionsChangedflag tracks if the nearby set changed (currently alwaysfalsesince legacy path is commented out)
See Also
- missions/missionManager - Mission Lifecycle Manager - Related reference
- missions/missionScreen - Mission UI Screen & Starting Options - Related reference
- missions/missions - Mission Registry & Data Management - Related reference
- Gameplay Systems Guide - Guide