setPosATL: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
No edit summary
Line 39: Line 39:
|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.
|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.
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.
}}
{{Note
|user= Hypoxic125
|timestamp= 20220930040303
|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.
<sqf>
if !(isNull objectParent _unit) then {
[_unit, [0,0,0]] remoteExec ["setPosATL", _unit];
};
</sqf>
}}
}}

Revision as of 05:03, 30 September 2022

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]; };