setDriveOnPath: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "<!-- Appropriate categories go here -->" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
|arma3 | |arma3 | ||
|1.68 | |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> | | 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 | | vehicleName [[setDriveOnPath]] points | ||
|p1= vehicleName: [[Object]] | |p1= vehicleName: [[Object]] | ||
|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]] | | [[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; }; {{codecomment|// getting all marker positions}} | |x2= <code>_points = [[allMapMarkers]] [[apply]] { [[getMarkerPos]] _x; }; {{codecomment|// getting all marker positions}} | ||
{ [[_x]] [[pushBack]] 15; } forEach _points; {{codecomment|// setting [[speed]]}} | { [[_x]] [[pushBack]] 15; } forEach _points; {{codecomment|// setting [[speed]]}} | ||
myVehicle [[setDriveOnPath]] _points;</code> | myVehicle [[setDriveOnPath]] _points;</code> | ||
| [[move]], [[forceSpeed]], [[limitSpeed]], [[Waypoint]] | | [[move]], [[forceSpeed]], [[limitSpeed]], [[Waypoint]] | ||
}} | }} | ||
Revision as of 11:12, 18 January 2021
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.gvehicleName 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