API ReferenceGE Extensionsflowgraphnodestimetrials
Race CP Reached (Flowgraph Node)
- **Node Name:** `Race CP Reached`
Overview
- Node Name:
Race CP Reached - Category:
repeat_instant - File:
extensions/flowgraph/nodes/timetrials/onRaceCheckpoint.lua
Fires an impulse when the player drives through a race checkpoint. Tracks checkpoint index and lap count.
Pin Schema
Output Pins
| Pin | Type | Description |
|---|---|---|
checked | flow | Impulse when a checkpoint is reached |
vehId | number | ID of the vehicle (hidden) |
index | number | Index of the checkpoint reached |
lap | number | Current lap number |
Legacy Pin Mapping
| Old Name | New Name |
|---|---|
vehicleID | vehId |
Behavior
init()- InitializesenterFlagandlapcounter. DisablesclearOutPinsOnStart._executionStarted()- Resets lap to 1 and clears enter flag.onRaceWaypointReached(data)- Event handler: sets vehicle ID, checkpoint index, updates lap count viadata.lapDiff, and sets the enter flag.work()- Outputs thecheckedimpulse if the flag was set, then clears it.onScenarioRestarted()- Resets state via_executionStarted().
How It Works
- Place this node in a race/time-trial flowgraph.
- When the player hits a checkpoint,
onRaceWaypointReachedfires. - The
checkedimpulse goes high for one frame. - Use
indexto identify which checkpoint,lapfor the current lap.
-- Event data structure:
-- data.vehId = vehicle ID
-- data.cur = checkpoint index
-- data.lapDiff = lap increment (0 or 1)
-- Connect: checked → [Display Checkpoint UI]
-- Use index and lap for scoreboard updatesKey Dependencies
onRaceWaypointReached- Flowgraph event from the race systemonScenarioRestarted- Flowgraph event for race restart
See Also
- Race Complete (Flowgraph Node) - Related reference
- Race Config (Flowgraph Node) - Related reference
- Race Restarted (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide