getWPPos: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - "<h3 style="display:none">Bottom Section</h3> " to "")
mNo edit summary
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| ofp
|game1= ofp
|version1= 1.21


|1.21
|game2= ofpe
|version2= 1.00
 
|game3= arma1
|version3= 1.00
 
|game4= arma2
|version4= 1.00
 
|game5= arma2oa
|version5= 1.50
 
|game6= tkoh
|version6= 1.00
 
|game7= arma3
|version7= 0.50


|arg= global
|arg= global
Line 9: Line 26:
|gr1= Waypoints
|gr1= Waypoints


| Returns the position of a selected waypoint of a given group. Waypoints include only those which were placed in the mission editor.
|alias= [[waypointPosition]]


| '''getWPPos''' [group, index]
|descr= Returns the position of a selected waypoint of a given group. Waypoints include only those which were placed in the mission editor.


|p1= [group, index]: [[Array]]
|s1= [[getWPPos]] [groupOrUnit, index]


|p2= group: [[Group]] - the group/unit, of which you want to select a waypoint
|p1= groupOrUnit: [[Group]] or [[Object]] - the group (or unit) of which to select a waypoint


|p3= index: [[Number]] - 0 equals the starting position of the group.<br>
|p2= index: [[Number]] - 0 equals the starting position of the group.<br>
The number used in this and other waypoint commands is ''one more'' than the one displayed in the waypoint window in the editor. (i.e. if the editor labeled a WP <tt>"0:MOVE"</tt> the you would have to use <tt>getWPPos [grp,1]</tt> to access this particular WP)
The number used in this and other waypoint commands is ''one more'' than the one displayed in the waypoint window in the editor: e.g if the editor labeled a waypoint {{hl|"0:MOVE"}} then it can be accessed using <sqf inline>getWPPos [grp, 1]</sqf>


| [[Array]] - format [[Position3D]].
|r1= [[Position#Introduction|Position3D]] - the returned position equals [0,0,0] if the selected waypoint does not exist.
The returned position equals [0,0,0], if the selected waypoint doesn't exist.
 
|x1= <code>[_group1,1] [[setWPPos]] [200,600,0];<br>_pos <nowiki>=</nowiki> [[getWPPos]] [_group1,1];</code>


returns [200,600,0]
|x1= <sqf>
 
[_group1, 1] setWPPos [200,600,0];
| [[setWPPos]]
_pos = getWPPos [_group1, 1]; // returns [200, 600, 0]
</sqf>


|seealso= [[setWPPos]]
}}
}}
[[Category:Scripting Commands|GETWPPOS]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|GETWPPOS]]
[[Category:Scripting Commands OFP 1.46|GETWPPOS]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 07:55, 2 January 2026

Hover & click on the images for description

Description

Description:
Returns the position of a selected waypoint of a given group. Waypoints include only those which were placed in the mission editor.
Alias:
waypointPosition
Groups:
Waypoints

Syntax

Syntax:
getWPPos [groupOrUnit, index]
Parameters:
groupOrUnit: Group or Object - the group (or unit) of which to select a waypoint
index: Number - 0 equals the starting position of the group.
The number used in this and other waypoint commands is one more than the one displayed in the waypoint window in the editor: e.g if the editor labeled a waypoint "0:MOVE" then it can be accessed using getWPPos [grp, 1]
Return Value:
Position3D - the returned position equals [0,0,0] if the selected waypoint does not exist.

Examples

Example 1:
[_group1, 1] setWPPos [200,600,0]; _pos = getWPPos [_group1, 1]; // returns [200, 600, 0]

Additional Information

See also:
setWPPos

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note