setPosATL: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma2 |Game name=
| arma2


|1.03|Game version=
|1.03


|arg= global |Multiplayer Arguments=
|arg= global


|eff= global |Multiplayer Effects=
|eff= global


|gr1= Positions |GROUP1=
|gr1= Positions


| Sets the position of an object relative to the terrain. |DESCRIPTION=
| Sets the position of an object relative to the terrain.


| object '''setPosATL''' pos |SYNTAX=
| object '''setPosATL''' pos


|p1= object: [[Object]] |PARAMETER1=
|p1= object: [[Object]]


|p2= pos: [[Array]] - format [[PositionATL]] |PARAMETER2=
|p2= pos: [[Array]] - format [[PositionATL]]


| [[Nothing]] |RETURNVALUE=
| [[Nothing]]


|x1= <code>[[player]] [[setPosATL]] [<nowiki/>[[getPosATL]] [[player]] [[select]] 0, ([[getPosATL]] [[player]] [[select]] 1) - 10, [[getPosATL]] [[player]] [[select]] 2];</code> |EXAMPLE1=
|x1= <code>[[player]] [[setPosATL]] [<nowiki/>[[getPosATL]] [[player]] [[select]] 0, ([[getPosATL]] [[player]] [[select]] 1) - 10, [[getPosATL]] [[player]] [[select]] 2];</code>


| [[getPosATL]], [[getPos]], [[getPosASL]], [[setPos]], [[setPosASL]] |SEEALSO=
| [[getPosATL]], [[getPos]], [[getPosASL]], [[setPos]], [[setPosASL]]
}}
}}



Revision as of 11:11, 18 January 2021

Hover & click on the images for description

Description

Description:
Sets the position of an object relative to the terrain.
Groups:
Positions

Syntax

Syntax:
object setPosATL pos
Parameters:
object: Object
pos: Array - format PositionATL
Return Value:
Nothing

Examples

Example 1:
player setPosATL [getPosATL player select 0, (getPosATL player select 1) - 10, getPosATL player select 2];

Additional Information

See also:
getPosATLgetPosgetPosASLsetPossetPosASL

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

Notes

Posted on Feb 26, 2012 - 18:12 (CEST)
Lou Montana
Please Note : this command demands PositionATL format ; one does not simply give 2D position, as this function won't do anything.
Posted on November 11, 2014 - 20:39 (UTC)
DreadedEntity
If you plan on creating bases through script, setPosATL and getPosATL will be your friends. Other commands like getPos or getPosASL will return the position relative to any objects that are underneath. I wrote a base building helper script and through multiple tests, I have found that getPosATL is the absolute best way to get position for objects that are over land.