setWaypointPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[[cC]ategory:[sS]cripting [cC]ommands\|[a-z A-Z 0-9_]+\]\]" to "")
m (Text replacement - "\{\{( *)Informative( *)\|" to "{{$1Feature$2|$2Informative$2|")
Line 8: Line 8:


| Attempts to move given waypoint to a random position inside a circle with the given center and radius.  
| Attempts to move given waypoint to a random position inside a circle with the given center and radius.  
{{Informative | If you are looking for the command to set precise WP position, see [[setWPPos]]}}<br>
{{Feature | Informative | If you are looking for the command to set precise WP position, see [[setWPPos]]}}<br>
The waypoint will be placed similar to <tt>"NONE"</tt> attribute in [[setVehiclePosition]], even if the radius is 0, which means it could still be off center. In order to force waypoint to the exact position, similar to <tt>"CAN_COLLIDE"</tt> attribute, use negative radius, like -1 for example. You will probably laugh at this, but be warned:
The waypoint will be placed similar to <tt>"NONE"</tt> attribute in [[setVehiclePosition]], even if the radius is 0, which means it could still be off center. In order to force waypoint to the exact position, similar to <tt>"CAN_COLLIDE"</tt> attribute, use negative radius, like -1 for example. You will probably laugh at this, but be warned:
{{ Warning | When using negative radius, the center position supplied must be [[PositionASL]], only then the resulting [[waypointPosition]] will be in format [[PositionAGL]] and not buried under the ground ¯\_(ツ)_/¯}}
{{ Warning | When using negative radius, the center position supplied must be [[PositionASL]], only then the resulting [[waypointPosition]] will be in format [[PositionAGL]] and not buried under the ground ¯\_(ツ)_/¯}}

Revision as of 01:12, 7 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Waypoints

Syntax

Syntax:
Syntax needed
Parameters:
waypoint: Array - format Waypoint
[center, radius]: Array
center: PositionAGL or Object (or PositionASL if the radius is negative)
radius: Number - random placement radius in meters. Set it to -1 and convert center to PositionASL for the exact center placement.
Return Value:
Return value needed

Examples

Example 1:
[_grp, 2] setWaypointPosition [position player, 0];
Example 2:
Exact placement (see description): _wp setWaypointPosition [getPosASL player, -1];

Additional Information

See also:
See also needed

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 November 14, 2018 - 22:52 (UTC)
killzone_kid
If you want AI to understand height of the waypoint, for example set waypoint at the top of Military Cargo Tower, use Example 2, with position in ASL format and -1 radius.