API ReferenceGE Extensionsflowgraphnodesvehicleai
AI Chase
- **Node Name:** `AI Chase`
Overview
- Node Name:
AI Chase - Category:
once_p_duration - File:
extensions/flowgraph/nodes/vehicle/ai/chase.lua
Sets a vehicle's AI to chase another vehicle with intentional contact enabled. The AI will actively try to ram the target.
Pin Schema
Input Pins
| Pin | Type | Default | Description |
|---|---|---|---|
aiVehId | number | - | Vehicle ID to apply AI chase mode (uses player vehicle if empty) |
targetId | number | - | Vehicle ID of the target to chase (defaults to player vehicle) |
Internals
Key Methods
| Method | Description |
|---|---|
workOnce() | Sets AI mode to "chase" and assigns the target vehicle |
Commands Sent
ai.setMode("chase")
ai.setTargetObjectID(targetId)How It Works
- Resolves the AI vehicle by
aiVehIdor defaults to the player vehicle. - Resolves the target by
targetIdor defaults to player vehicle ID viabe:getPlayerVehicleID(0). - Queues two Lua commands: set mode to "chase" and set target object ID.
- Executes once (
workOnce), then the AI continues chasing autonomously.
Usage Example
-- Make vehicle 5 chase the player:
-- aiVehId = 5
-- targetId = (empty, defaults to player)
-- Make vehicle 5 chase vehicle 3:
-- aiVehId = 5
-- targetId = 3Key Dependencies
ai.setMode("chase")- enables chase AI mode (intentional contact)ai.setTargetObjectID()- sets chase target vehicle
See Also
- AI Parameters (Flowgraph Node) - Related reference
- AI Arrive (Flowgraph Node) - Related reference
- AI Directly To (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide