API ReferenceGE Extensionsgameplaymarkers
Zone Marker
Reference for the zone marker class that checks if a driven vehicle is inside a 2D polygon zone for POI interactions.
Reference for the zone marker class that checks if a driven vehicle is inside a 2D polygon zone for POI interactions.
Module Exports
| Export | Description |
|---|---|
create(...) | Creates a new zoneMarker instance (class C) |
cluster(pois, allClusters) | Creates one cluster per POI (zone markers are NOT grouped/merged) |
Class C - Instance Methods
| Method | Signature | Description |
|---|---|---|
init | C:init() | No-op |
setup | C:setup(cluster) | Stores zone polygons, visibility pos/radius |
update | C:update(data) | No-op |
setHidden | C:setHidden(value) | No-op |
createObjects | C:createObjects() | No-op |
hide / show | C:hide() / C:show() | No-op |
instantFade | C:instantFade(visible) | No-op |
clearObjects | C:clearObjects() | No-op |
interactInPlayMode | C:interactInPlayMode(interactData, interactableElements) | Checks if vehicle is inside any zone polygon and adds elements |
Internals
- Zone Check: Only active when not walking. Uses a quick radius pre-check (
vehPos2d:distance(self.pos2d) <= self.radius+2), then tests 4 bounding box corner points against each zone polygon viacontainsPoint2D() - No Clustering: Unlike
walkingMarker, each POI creates its own cluster - zones are independent - No Visual Elements: This marker type has no icons, renderers, or screen objects - it only provides interaction detection
How It Works
-- Interaction check (vehicle only, not walking):
function C:interactInPlayMode(interactData, interactableElements)
if interactData.isWalking then return end
-- Quick distance pre-check
if interactData.vehPos2d:distance(self.pos2d) <= self.radius+2 then
for _, z in ipairs(self.zones) do
-- Check if all 4 bbox corners are inside the polygon
if z:containsPoint2D(interactData.bbPoints[1])
and z:containsPoint2D(interactData.bbPoints[4])
and z:containsPoint2D(interactData.bbPoints[5])
and z:containsPoint2D(interactData.bbPoints[8]) then
-- Vehicle is inside zone - add all cluster elements
for _, elem in ipairs(self.cluster.elemData) do
table.insert(interactableElements, elem)
end
end
end
end
end
-- Clustering creates one cluster per POI:
local function cluster(pois, allClusters)
for _, poi in ipairs(pois) do
table.insert(allClusters, {
id = 'zoneMarker#'..poi.id,
zones = poi.markerInfo.zoneMarker.zones,
visibilityPos = poi.markerInfo.zoneMarker.pos,
visibilityRadius = poi.markerInfo.zoneMarker.radius,
elemData = {poi.data},
create = create,
})
end
endKey Differences from walkingMarker
| Feature | walkingMarker | zoneMarker |
|---|---|---|
| Input mode | Walking only | Vehicle only |
| Detection | OBB-OBB overlap | 2D polygon containment |
| Visual feedback | Icons, screens | None |
| Clustering | Merged by shared objects | One per POI |
See Also
- Big Map Marker - Related reference
- Crawl Marker - Related reference
- Drift Line Marker - Related reference
- Gameplay Systems Guide - Guide
Walking Marker
Reference for the walking marker class used by the POI/marker system to display interactive door icons when the player is on foot near buildings.
Locations Detector
Reference for `gameplay_missions_locationsDetector`, which detects missions near the player by checking clustered POI locations.