setDriveOnPath: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|x([0-9]) *= * <code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 7: | Line 7: | ||
|descr= Sets the path to follow for AI driver. Note that [[unitReady]] will return [[true]] even if AI is still driving through the points.<br> | |descr= Sets the path to follow for AI driver. Note that [[unitReady]] will return [[true]] even if AI is still driving through the points.<br> | ||
Using any other ''move'' command (e.g | Using any other ''move'' command (e.g <sqf inline>_vehicle move getPosATL _vehicle</sqf>) or [[doStop]] will stop the effect of this command. | ||
{{Feature | important | This command ''' | {{Feature|important|This command does '''not''' work on air vehicles and boats. Only land vehicles are compatible. (cars, tanks, APCs, etc.)}} | ||
{{Feature | informative | For the command to work properly, the unit must either be an [[createAgent|agent]], or in the case of normal AI, have been stopped using [[doStop]]. }} | {{Feature|informative|For the command to work properly, the unit must either be an [[createAgent|agent]], or in the case of normal AI, have been stopped using [[doStop]].}} | ||
|s1= vehicleName [[setDriveOnPath]] points | |s1= vehicleName [[setDriveOnPath]] points | ||
Line 15: | Line 15: | ||
|p1= vehicleName: [[Object]] | |p1= vehicleName: [[Object]] | ||
|p2= points: [[Array]] - list of [[Position | |p2= points: [[Array]] - list of [[Position]]s to format [x,y,z] OR to format [x,y,z, speed], speed being '''in m/s'''. | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
Line 21: | Line 21: | ||
|x1= <sqf>myVehicle setDriveOnPath [getMarkerPos "wp1", getMarkerPos "wp2"];</sqf> | |x1= <sqf>myVehicle setDriveOnPath [getMarkerPos "wp1", getMarkerPos "wp2"];</sqf> | ||
|x2= <sqf>_points = allMapMarkers apply { getMarkerPos _x; }; // getting all marker positions | |x2= <sqf> | ||
private _points = allMapMarkers apply { getMarkerPos _x; }; // getting all marker positions | |||
{ _x pushBack 15; } forEach _points; // setting speed | { _x pushBack 15; } forEach _points; // setting speed | ||
myVehicle setDriveOnPath _points;</sqf> | myVehicle setDriveOnPath _points; | ||
</sqf> | |||
|seealso= [[move]] [[forceSpeed]] [[limitSpeed]] [[Waypoint]] | |seealso= [[move]] [[forceSpeed]] [[limitSpeed]] [[Waypoint]] | ||
}} | }} | ||
{{Note | |||
|user= Leopard20 | |||
|timestamp= 20210625074200 | |||
|text= 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) | |||
}} | |||
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) | |||
Revision as of 16:43, 27 July 2022
Description
- 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. - Groups:
- Object Manipulation
Syntax
- Syntax:
- vehicleName setDriveOnPath points
- Parameters:
- vehicleName: Object
- points: Array - list of Positions to format [x,y,z] OR to format [x,y,z, speed], speed being in m/s.
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- private _points = allMapMarkers apply { getMarkerPos _x; }; // getting all marker positions { _x pushBack 15; } forEach _points; // setting speed myVehicle setDriveOnPath _points;
Additional Information
- See also:
- move forceSpeed limitSpeed Waypoint
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on Jun 25, 2021 - 07:42 (UTC)
- 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)