API ReferenceGE Extensionsgameplaymissions
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.
Reference for gameplay_missions_poiTest, a simple test/debug extension that creates POI markers from parking spots to validate the POI interaction system.
Module Exports (M)
| Function | Signature | Description |
|---|---|---|
onGetRawPoiListForLevel | (levelIdentifier, elements) | Adds test POI elements from parking spot data |
onPoiDetailPromptOpening | (elemData, promptData) | Handles detail prompt for test POIs |
onExtensionLoaded | () | Clears marker interaction cache on load |
M.onExtensionLoaded | () | - |
M.onGetRawPoiListForLevel | (levelIdentifier, elements) | - |
M.onPoiDetailPromptOpening | (elemData, promptData) | - |
How It Works
-- Creates POI markers from a test parking spots file:
local function onGetRawPoiListForLevel(levelIdentifier, elements)
local sites = gameplay_sites_sitesManager.loadSites("gameplay/parkingSpotTests.sites.json")
for _, ps in ipairs(sites.parkingSpots.sorted) do
table.insert(elements, {
id = string.format("Test-PS-%d", ps.id),
pos = ps.pos, rot = ps.rot, scl = ps.scl,
radius = 3,
visibleInPlayMode = true,
interactableInPlayMode = true,
clusterType = "parkingMarker",
data = {
type = "poiTest",
id = id,
name = ps.name,
description = "To Test the Poi System",
}
})
end
end
-- When the POI prompt opens, adds a test button:
local function onPoiDetailPromptOpening(elemData, promptData)
for _, elem in ipairs(elemData) do
if elem.type == "poiTest" then
table.insert(promptData, {
label = elem.name,
buttonText = "Do the Test",
buttonFun = function() print("Test Successfull!") end
})
end
end
endKey Behaviors
- Loads parking spots from
gameplay/parkingSpotTests.sites.json - Each parking spot becomes a POI with
clusterType = "parkingMarker"and radius of 3 - The detail prompt shows the parking spot name and a simple test button
- Clears
gameplay_markerInteractioncache on extension load to refresh markers - This is a development/test extension - not part of normal gameplay
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
Mission Screen UI
Reference for `gameplay_missions_missionScreen`, which formats mission data for the UI, handles starting options (repair costs, vehicle checks), and manages the mission details screen.
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.