setWaypointPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *ofpe * * *\| *([0-1]\.[0-9]{2}) * \|game2" to "|game1= ofpe |version1= $1 |game2")
m (Replaced <code> with <sqf>)
(38 intermediate revisions by one other user not shown)
Line 23: Line 23:
|descr= Attempts to move given waypoint to a random position inside a circle with the given center and radius.  
|descr= Attempts to move given waypoint to a random position inside a circle with the given center and radius.  
{{Feature | 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 {{hl|"NONE"}} 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 {{hl|"CAN_COLLIDE"}} attribute, use negative radius, like -1 for example. You will probably laugh at this, but be warned:
{{ Feature | 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 ¯\_(ツ)_/¯}}
{{ Feature | Warning | When using negative radius, the center position supplied must be [[Position#PositionASL|PositionASL]], only then the resulting [[waypointPosition]] will be in format [[Position#PositionAGL|PositionAGL]] and not buried under the ground ¯\_(ツ)_/¯}}


|s1= waypoint '''setWaypointPosition''' [center, radius]
|s1= waypoint [[setWaypointPosition]] [center, radius]


|p1= waypoint: [[Array]] - format [[Waypoint]]
|p1= waypoint: [[Array]] - format [[Waypoint]]
|p2= [center, radius]: [[Array]]
|p2= [center, radius]: [[Array]]
|p3= center: [[PositionAGL]] or [[Object]] (or [[PositionASL]] if the radius is negative)
|p3= center: [[Array]] format [[Position#PositionAGL|PositionAGL]] or [[Object]] (or [[Position#PositionASL|PositionASL]] if the radius is negative)
|p4= radius: [[Number]] - random placement radius in meters. Set it to -1 and convert center to [[PositionASL]] for the exact center placement.
|p4= radius: [[Number]] - random placement radius in meters. Set it to -1 and convert center to [[Position#PositionASL|PositionASL]] for the exact center placement.


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


|x1= <code>[_grp, 2] [[setWaypointPosition]] [<nowiki/>[[position]] [[player]], 0];</code>
|x1= <sqf>[_grp, 2] setWaypointPosition [position player, 0];</sqf>
|x2= Exact placement (see description): <code>_wp [[setWaypointPosition]] [<nowiki/>[[getPosASL]] [[player]], -1];</code>
|x2= Exact placement (see description):
<sqf>_wp setWaypointPosition [getPosASL player, -1];</sqf>


|seealso= [[waypointPosition]], [[setWPPos]], [[waypoints]], [[deleteWaypoint]], [[copyWaypoints]], [[setCurrentWaypoint]], [[setWaypointBehaviour]], [[setWaypointCombatMode]], [[setWaypointCompletionRadius]], [[setWaypointDescription]], [[setWaypointFormation]], [[setWaypointHousePosition]], [[setWaypointScript]], [[setWaypointSpeed]], [[setWaypointStatements]], [[setWaypointTimeout]], [[setWaypointType]], [[setWaypointVisible]], [[waypointAttachVehicle]], [[waypointAttachedVehicle]], [[setWaypointLoiterRadius]], [[waypointLoiterRadius]], [[addWaypoint]], [[setWaypointLoiterType]], [[waypointSpeed]]
|seealso= [[waypointPosition]] [[setWPPos]] [[waypoints]] [[deleteWaypoint]] [[copyWaypoints]] [[setCurrentWaypoint]] [[setWaypointBehaviour]] [[setWaypointCombatMode]] [[setWaypointCompletionRadius]] [[setWaypointDescription]] [[setWaypointFormation]] [[setWaypointHousePosition]] [[setWaypointScript]] [[setWaypointSpeed]] [[setWaypointStatements]] [[setWaypointTimeout]] [[setWaypointType]] [[setWaypointVisible]] [[waypointAttachVehicle]] [[waypointAttachedVehicle]] [[setWaypointLoiterRadius]] [[waypointLoiterRadius]] [[addWaypoint]] [[setWaypointLoiterType]] [[waypointSpeed]]
}}
}}


{{GameCategory|ofpe|Scripting Commands}}
{{GameCategory|arma1|Scripting Commands}}


{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}


<dl class="command_description">
<dl class="command_description">

Revision as of 17:11, 14 May 2022

Hover & click on the images for description

Description

Description:
Attempts to move given waypoint to a random position inside a circle with the given center and radius.
If you are looking for the command to set precise WP position, see setWPPos

The waypoint will be placed similar to "NONE" 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 "CAN_COLLIDE" attribute, use negative radius, like -1 for example. You will probably laugh at this, but be warned:

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 ¯\_(ツ)_/¯
Groups:
Waypoints

Syntax

Syntax:
waypoint setWaypointPosition [center, radius]
Parameters:
waypoint: Array - format Waypoint
[center, radius]: Array
center: Array format 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:
Nothing

Examples

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

Additional Information

See also:
waypointPosition setWPPos waypoints deleteWaypoint copyWaypoints setCurrentWaypoint setWaypointBehaviour setWaypointCombatMode setWaypointCompletionRadius setWaypointDescription setWaypointFormation setWaypointHousePosition setWaypointScript setWaypointSpeed setWaypointStatements setWaypointTimeout setWaypointType setWaypointVisible waypointAttachVehicle waypointAttachedVehicle setWaypointLoiterRadius waypointLoiterRadius addWaypoint setWaypointLoiterType waypointSpeed

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.