setPosATL: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
(63 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.03


|1.03|= Game version
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Sets the position of an object relative to the terrain. |= Description
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| object '''setPosATL''' pos |= Syntax
|game4= arma3
|version4= 0.50


|p1= object: [[Object]] |= Parameter 1
|arg= global


|p2= pos: [[Array]] - format [[PositionATL]] |= Parameter 2
|eff= global


| [[Nothing]] |= Return value
|gr1= Positions
____________________________________________________________________________________________


|x1= <code>player setPosATL [ [[getPosATL]] [[player]] [[select]] 0, ([[getPosATL]] [[player]] [[select]] 1) - 10,
|descr= Sets the position of an object relative to the terrain.
[[getPosATL]] [[player]] [[select]] 2]</code> |= Example 1
____________________________________________________________________________________________


| [[getPosATL]], [[getPos]], [[getPosASL]], [[setPos]], [[setPosASL]] |= See also
|s1= object [[setPosATL]] pos
 
|p1= object: [[Object]]
 
|p2= pos: [[Array]] format [[Position#PositionATL|PositionATL]]
 
|r1= [[Nothing]]
 
|x1= <sqf>player setPosATL [getPosATL player select 0, (getPosATL player select 1) - 10, getPosATL player select 2];</sqf>
 
|seealso= [[getPosATL]] [[getPos]] [[getPosASL]] [[setPos]] [[setPosASL]]
}}
 
{{Note
|user= DreadedEntity
|timestamp= 20141111203900
|text= 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 / to the terrain.
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.
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
<dl class="command_description">
|user= Hypoxic125
<!-- Note Section BEGIN -->
|timestamp= 20220930040303
<dd class="notedate">Posted on Feb 26, 2012 - 18:12 (CEST)
|text= As of '''Verson 2.10''', if you use '''setPosX''' commands on a remote unit within a vehicle, the unit will remain in the vehicle. In order to avoid this, '''remoteExec''' the command to the remote client.
<dt class="note">'''[[User:Lou Montana|Lou Montana]]'''
<dd class="note"> '''Please Note :''' this command '''demands''' [[PositionATL]] format ; one does not simply give 2D position, as this function won't do anything.
<!-- Note Section END -->
</dl>


[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
<sqf>
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
if !(isNull objectParent _unit) then {
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[_unit, [0,0,0]] remoteExec ["setPosATL", _unit];
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
};
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
</sqf>
}}

Latest revision as of 21:33, 28 September 2023

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:

Additional Information

See also:
getPosATL getPos getPosASL setPos setPosASL

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
DreadedEntity - c
Posted on Nov 11, 2014 - 20:39 (UTC)
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 / to the terrain. 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.
Hypoxic125 - c
Posted on Sep 30, 2022 - 04:03 (UTC)
As of Verson 2.10, if you use setPosX commands on a remote unit within a vehicle, the unit will remain in the vehicle. In order to avoid this, remoteExec the command to the remote client.
if !(isNull objectParent _unit) then { [_unit, [0,0,0]] remoteExec ["setPosATL", _unit]; };