Page MenuHomeFeedback Tracker

New getPos relative command syntax ignores Z value
New, WishlistPublic

Description

In Arma 3 v1.55.133361, a new syntax for getPos command has been recently introduced:
_return = _originalPosition getPos [_distance, _heading]

OBS:
The returned Z value (_return select 2) is always 0.

EXP:
The return Z value should be equal to the Z value of _originalPosition.

Details

Legacy ID
2056731655
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. In mission editor, place player as soldier anywhere on land.
  2. Preview mission.
  3. Pause mission. In debug console watch fields, compare the returned value of:

(getPosASL player) getPos [20, 0]

and

[(getPosASL player), 20, 0] call BIS_fnc_relPos

Additional Information

Event Timeline

ceeeb edited Steps To Reproduce. (Show Details)Jan 24 2016, 6:59 AM
ceeeb edited Additional Information. (Show Details)
ceeeb set Category to Scripting.
ceeeb set Reproducibility to Always.
ceeeb set Severity to None.
ceeeb set Resolution to Open.
ceeeb set Legacy ID to 2056731655.May 8 2016, 1:33 PM
Bohemia added a subscriber: ceeeb.Jan 24 2016, 6:59 AM

This is a design decision, the z will always be z of the ground for convenience. From BIKI page:

"Return Value:
Array - format [x,y,z], where z is land surface in format PositionAGL"

Same with getRelPos. When over water it will return negative z. Makes it easier to calculate an offset if needed.

One other reason is that BIS_fnc_relPos z is treated as AGL even if you supply different format, and as a result the new position may not be exactly horizontally away from origin anyway.

Hmmm, I guess I can see why that is generally the most useful return, as ground level is most useful most of the time.

I can use other methods to achieve a true horz offset.