API ReferenceGE Extensionsflowgraphnodesutil
Get Map Objects IDs by DynField (Flowgraph Node)
- **Node Name:** `Get Map Objects IDs by DynField`
Overview
- Node Name:
Get Map Objects IDs by DynField - Category:
repeat_instant - File:
extensions/flowgraph/nodes/util/getMapObjectsDynField.lua
Searches all map objects and returns a list of IDs for objects that contain a specific dynamic field.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
dynamicFieldName | string | Name of the dynamic field to search for |
Output Pins
| Pin | Type | Description |
|---|---|---|
objects | table | Array of object IDs containing the specified dynamic field |
Internals
Key Methods
| Method | Description |
|---|---|
init(mgr) | Empty initializer |
_executionStarted() | Resets oldPos |
findObjectsWithDynField(name) | Iterates all map objects and checks their dynamic fields |
work() | Calls findObjectsWithDynField and outputs results |
How It Works
- Iterates all entries in
map.objectsto get object IDs. - For each object ID, calls
getObjectByID(objId)to get the object reference. - Calls
object:getDynamicFields()and checks each field name against the search term. - Matching object IDs are collected into a table and output.
Note: This runs every frame (repeat_instant) and iterates all map objects, which can be expensive. Consider connecting a flow gate if performance is a concern.
Usage Example
-- Find all objects with a custom "checkpoint" dynamic field:
-- [Get Map Objects IDs by DynField] dynamicFieldName="checkpoint"
-- → objects → [For Each] → [Get Object] → [Process Checkpoint]
-- Find vehicles with a specific marker:
-- [Get Map Objects IDs by DynField] dynamicFieldName="isRaceParticipant"
-- → objects → [Get First Element] → [Focus Camera]Key Dependencies
map.objects- map object registrygetObjectByID()- engine function to resolve object referencesobject:getDynamicFields()- returns list of dynamic field names on an object
See Also
- Route Distance (Flowgraph Node) - Related reference
- Closest Road (Flowgraph Node) - Related reference
- Custom Lua (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide