locationPosition: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma1 |Game name=
| arma1


|1.08|Game version=
|1.08


|arg= |Multiplayer Arguments=
|arg=


|eff= |Multiplayer Effects=
|eff=


|gr1= Locations |GROUP1=
|gr1= Locations


| Returns the [[Position|position]] of a location. If the location is attached to an object, that object's position is returned. |DESCRIPTION=
| Returns the [[Position|position]] of a location. If the location is attached to an object, that object's position is returned.


| '''locationPosition''' location |SYNTAX=
| '''locationPosition''' location


|p1= location: [[Location]] |PARAMETER1=
|p1= location: [[Location]]


| [[Array]] - format [x,y,z], where z is <tt>-1 * [[getTerrainHeightASL]]</tt> at the location |RETURNVALUE=
| [[Array]] - format [x,y,z], where z is <tt>-1 * [[getTerrainHeightASL]]</tt> at the location
   
   
|x1= <code>_locationPos = [[locationPosition]] myLocation;</code> |EXAMPLE1=
|x1= <code>_locationPos = [[locationPosition]] myLocation;</code>


|x2= <code>_location = [[nearestLocation]] [<nowiki/>[[getPos]] [[player]], "nameCity"];
|x2= <code>_location = [[nearestLocation]] [<nowiki/>[[getPos]] [[player]], "nameCity"];
_locationPos = [[locationPosition]] _location;</code> |EXAMPLE2=
_locationPos = [[locationPosition]] _location;</code>


| [[setPosition]], [[createLocation]], [[nearestLocation]], [[nearestLocations]], [[position]], [[size]] |SEEALSO=
| [[setPosition]], [[createLocation]], [[nearestLocation]], [[nearestLocations]], [[position]], [[size]]


}}
}}

Revision as of 01:06, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns the position of a location. If the location is attached to an object, that object's position is returned.
Groups:
Locations

Syntax

Syntax:
locationPosition location
Parameters:
location: Location
Return Value:
Array - format [x,y,z], where z is -1 * getTerrainHeightASL at the location

Examples

Example 1:
_locationPos = locationPosition myLocation;
Example 2:
_location = nearestLocation [getPos player, "nameCity"]; _locationPos = locationPosition _location;

Additional Information

See also:
setPositioncreateLocationnearestLocationnearestLocationspositionsize

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

Bottom Section