Arma 3 Scripting

Command in Object Manipulation

setDriveOnPath

Also available as Markdown and JSON, or read the original wiki page.

Description

Sets the path to follow for AI driver. Note that unitReady will return true even if AI is still driving through the points.

Using any other move command (e.g _vehicle move getPosATL _vehicle) or doStop will stop the effect of this command.

Important

This command does not work if the vehicle doesn't have an AI steering component defined in its config, or if the component is disabled. Thus, it never works on air vehicles and boats which don't use steering components. Only land vehicles may be compatible. (cars, tanks, APCs, etc.)

Note

For the command to work properly, the unit must either be an agent, or in the case of normal AI, have been stopped using doStop.

Syntax

vehicleName setDriveOnPath points

Parameters:

Returns: Nothing

Examples

Example 1

myVehicle setDriveOnPath [getMarkerPos "wp1", getMarkerPos "wp2"];

Example 2

private _points = allMapMarkers apply { getMarkerPos _x; }; // getting all marker positions
{ _x pushBack 15; } forEach _points; // setting speed
myVehicle setDriveOnPath _points;

See also

move · forceSpeed · limitSpeed · Waypoint · useAISteeringComponent

Community notes

Leopard20

To use this command, the AI must not have a formLeader. The easiest way to achieve this is to use doStop to stop the AI (warning! it'll break the AI waypoints)