setWaypointPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]OFP[ _]Elite *(\|.*)?\]\]" to "{{GameCategory|ofpe|Scripting Commands}}")
m (Some wiki formatting)
 
(62 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma1 |Game name=
|game1= ofpe
|version1= 1.00


|1.00|Game version=
|game2= arma1
|version2= 1.00


|gr1= Waypoints |GROUP1=
|game3= arma2
____________________________________________________________________________________________
|version3= 1.00


| Attempts to move given waypoint to a random position inside a circle with the given center and radius.
|game4= arma2oa
{{Informative | If you are looking for the command to set precise WP position, see [[setWPPos]]}}<br>
|version4= 1.50
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 ¯\_(ツ)_/¯}}|DESCRIPTION=
____________________________________________________________________________________________


| waypoint '''setWaypointPosition''' [center, radius] |SYNTAX=
|game5= tkoh
|version5= 1.00


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


| [[Nothing]] |RETURNVALUE=
|gr1= Waypoints
____________________________________________________________________________________________
 
|x1= <code>[_grp, 2] [[setWaypointPosition]] [<nowiki/>[[position]] [[player]], 0];</code> |EXAMPLE1=
|x2= Exact placement (see description): <code>_wp [[setWaypointPosition]] [<nowiki/>[[getPosASL]] [[player]], -1];</code> |EXAMPLE2=
____________________________________________________________________________________________


| [[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=
|descr= Attempts to move given waypoint to a random position inside a circle with the given center and radius.
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 a negative radius (see {{Link|#Example 2}}).


}}
|s1= waypoint [[setWaypointPosition]] [center, radius]
 
|p1= waypoint: [[Array]] - format [[Waypoint]]
 
|p2= center: [[Object]] or [[Array]] format [[Position#PositionAGL|PositionAGL]] or [[Array]] format [[Position#PositionASL|PositionASL]] if ''radius'' is negative
 
|p3= 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]]


<h3 style="display:none">Notes</h3>
|x1= <sqf>[_grp, 2] setWaypointPosition [position player, 0];</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x2= Exact placement using a negative ''radius'' and [[Position#PositionASL|PositionASL]]:
</dl>
<sqf>_wp setWaypointPosition [getPosASL player, -1];</sqf>


<h3 style="display:none">Bottom Section</h3>
|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]]
[[Category:Scripting Commands|SETWAYPOINTPOSITION]]
}}
{{GameCategory|ofpe|Scripting Commands}}
{{GameCategory|arma1|Scripting Commands}}
[[Category:Command_Group:_Waypoints|SETWAYPOINTPOSITION]]
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}


<!-- CONTINUE Notes -->
{{Note
<dl class="command_description">
|user= Killzone_Kid
<dd class="notedate">Posted on November 14, 2018 - 22:52 (UTC)</dd>
|timestamp= 20181114225200
<dt class="note">[[User:killzone_kid|killzone_kid]]</dt>
|text= If you want AI to understand height of the waypoint, for example set waypoint at the top of Military Cargo Tower, use {{Link|#Example 2}} with position in ASL format and -1 radius.
<dd class="note">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.
}}
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 18:09, 15 August 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. 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 a negative radius (see Example 2).
Groups:
Waypoints

Syntax

Syntax:
waypoint setWaypointPosition [center, radius]
Parameters:
waypoint: Array - format Waypoint
center: Object or Array format PositionAGL or Array format PositionASL if 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 using a negative radius and PositionASL:
_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
Killzone_Kid - c
Posted on Nov 14, 2018 - 22:52 (UTC)
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.