setPosASL: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (VBS2 scripting category removal)
mNo edit summary
 
(71 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= ofpe
|version1= 1.00


|1.00|= Game version
|game2= ofp
____________________________________________________________________________________________
|version2= 1.99


| Sets the object position above sea level. The pos array uses the [[PositionASL]] format. |= Description
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| object '''setPosASL''' pos |= Syntax
|game4= arma2
|version4= 1.00


|p1= object: [[Object]] |= Parameter 1
|game5= arma2oa
|version5= 1.50


|p2= pos: [[Array]] - format [[PositionASL]] |= Parameter 2
|game6= tkoh
|version6= 1.00


| [[Nothing]] |= Return value
|game7= arma3
____________________________________________________________________________________________
|version7= 0.50
 
|x1= <code>player setPosASL [ [[getPosASL]] [[player]] [[select]] 0, ([[getPosASL]] [[player]] [[select]] 1) + 10,
[[getPosASL]] [[player]] [[select]] 2]</code> |= Example 1


____________________________________________________________________________________________
|arg= global


| [[setPosASL2]] |= See also
|eff= global


}}
|gr1= Positions
 
|descr= Sets the object position above sea level. Given position must be in [[Position#PositionASL|PositionASL]] format.
 
|s1= object [[setPosASL]] pos
 
|p1= object: [[Object]]
 
|p2= pos: [[Array]] format [[Position#PositionASL|PositionASL]]
 
|r1= [[Nothing]]


Extra Example:
|x1= <sqf>player setPosASL [getPosASL player select 0, (getPosASL player select 1) + 10, getPosASL player select 2];</sqf>
<br>
this setPosASL [position this select 0, position this select 1, 9];
<br>
"this" can be any name.  "9" is the height above sea level


<h3 style="display:none">Notes</h3>
|x2= <sqf>
<dl class="command_description">
_position = getPosASL _object;
<!-- Note Section BEGIN -->
_position set [2, 10]; // 10m above sea level
_object setPosASL _position;
</sqf>


<!-- Note Section END -->
|seealso= [[ASLToATL]] [[ATLToASL]] [[getPos]] [[getPosASL]] [[getPosATL]] [[position]] [[setPos]] [[setPosASL2]] [[setPosATL]] [[getTerrainHeightASL]] [[setPosWorld]] [[setVehiclePosition]]
</dl>
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
[[Category:Scripting Commands|SETPOSASL]]
|user= Hypoxic125
[[Category:Scripting Commands OFP Elite |SETPOSASL]]
|timestamp= 20230226035906
[[Category:Scripting Commands ArmA|SETPOSASL]]
|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.
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
<sqf>
if !(isNull objectParent _unit) then {
[_unit, [0,0,0]] remoteExec ["setPosASL", _unit];
};
</sqf>
}}

Latest revision as of 04:59, 26 February 2023

Hover & click on the images for description

Description

Description:
Sets the object position above sea level. Given position must be in PositionASL format.
Groups:
Positions

Syntax

Syntax:
object setPosASL pos
Parameters:
object: Object
pos: Array format PositionASL
Return Value:
Nothing

Examples

Example 1:
Example 2:
_position = getPosASL _object; _position set [2, 10]; // 10m above sea level _object setPosASL _position;

Additional Information

See also:
ASLToATL ATLToASL getPos getPosASL getPosATL position setPos setPosASL2 setPosATL getTerrainHeightASL setPosWorld setVehiclePosition

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
Hypoxic125 - c
Posted on Feb 26, 2023 - 03:59 (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 ["setPosASL", _unit]; };