setDriveOnPath: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\{\{ *codecomment *\| *\/\/ *([^ ]+) *\}\} " to "{{cc|$1}}")
m (revert + fix)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


|arma3
|game1= arma3


|1.68
|version1= 1.68


|gr1= Object Manipulation
|gr1= Object Manipulation


| 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 {{Inline code|vehicleName [[move]] [[getPos]] vehicleName}}) or [[doStop]] will stop the effect of this command.
Using any other ''move'' command (e.g {{Inline code|vehicleName [[move]] [[getPos]] vehicleName}}) or [[doStop]] will stop the effect of this command.


| vehicleName [[setDriveOnPath]] points
|s1= vehicleName [[setDriveOnPath]] points


|p1= vehicleName: [[Object]]
|p1= vehicleName: [[Object]]
Line 16: Line 16:
|p2= points: [[Array]] - list of [[Position|Positions]] to format [x,y,z] OR to format [x,y,z, speed], speed being '''in m/s'''.
|p2= points: [[Array]] - list of [[Position|Positions]] to format [x,y,z] OR to format [x,y,z, speed], speed being '''in m/s'''.


| [[Nothing]]
|r1= [[Nothing]]


|x1= <code>myVehicle [[setDriveOnPath]] [<nowiki/>[[getMarkerPos]] "wp1", [[getMarkerPos]] "wp2"];</code>
|x1= <code>myVehicle [[setDriveOnPath]] [<nowiki/>[[getMarkerPos]] "wp1", [[getMarkerPos]] "wp2"];</code>


|x2= <code>_points = [[allMapMarkers]] [[apply]] { [[getMarkerPos]] _x; }; {{cc| getting all marker positions}}{ [[_x]] [[pushBack]] 15; } forEach _points; {{cc| setting [[speed]]}}myVehicle [[setDriveOnPath]] _points;</code>
|x2= <code>_points = [[allMapMarkers]] [[apply]] { [[getMarkerPos]] _x; }; {{cc| getting all marker positions}}{ [[_x]] [[pushBack]] 15; } forEach _points; {{cc| setting [[speed]]}}
myVehicle [[setDriveOnPath]] _points;</code>


| [[move]], [[forceSpeed]], [[limitSpeed]], [[Waypoint]]
|seealso= [[move]], [[forceSpeed]], [[limitSpeed]], [[Waypoint]]
}}
}}
<dl class='command_description'>
<!-- BEGIN Note Section -->
<!-- For example:
<dd class='notedate'>Posted on Month Day, Year - Time (UTC)</dd>
<dt class='note'>'''[[User:User Name|User Name]]'''</dt>
<dd class='note'>This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] Leave it here for others to read; };</code></dd>
-->
<!-- END Note Section -->
</dl>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma3|Scripting Commands}}

Revision as of 22:52, 29 January 2021

Hover & click on the images for description

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 vehicleName move getPos vehicleName) 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:
myVehicle setDriveOnPath [getMarkerPos "wp1", getMarkerPos "wp2"];
Example 2:
_points = allMapMarkers apply { getMarkerPos _x; }; // getting all marker positions{ _x pushBack 15; } forEach _points; // setting speed myVehicle setDriveOnPath _points;

Additional Information

See also:
moveforceSpeedlimitSpeedWaypoint

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