Page MenuHomeFeedback Tracker

getLandContactPos command
Closed, ResolvedPublic


To BIS: Please forward this to a developer with knowledge on how getPosATL works and who knows about "LandContact" vertices. (

For a while now, there have been issues with setPosATL not using the same reference point as getPosATL. What this means is that when an object is tilted, the position returned by getPosATL is offsetted from the object's reference point that setPosATL actually uses to set the position of an object. For missions trying to restore user-placed objects at their original position between restarts, this can be very problematic, because it will cause the object to constantly migrate a bit further away from its original location on every restart.

According to some experiments, as of right now, the reference point used by setPosATL is roughly equivalent to this:


if (vehicle has LandContact vertices) then
_referencePoint = average position of all LandContact vertices, returned in PositionATL format;
_referencePoint = vehicle modelToWorldATL [0,0, -((boundingCenter vehicle) select 2)]; // modelToWorldATL is not a real scripting command (yet), but you get the picture


However, the reference point used by getPosATL is roughly equivalent to this:


if (vehicle has LandContact vertices) then
_landContactWorldOffset = average position of all LandContact vertices, relative to model center in world space;

_referencePoint = (vehicle modelToWorldATL [0,0,0]) vectorAdd [0, 0, _landContactWorldOffset select 2];
_referencePoint = (vehicle modelToWorldATL [0,0,0]) vectorAdd [0, 0, -((boundingCenter vehicle) select 2)];


In order to solve the problem caused by this difference with reference points, we'd need a <b>getLandContactPos</b> command, which would return exactly the same reference position that setPosATL would use for that vehicle, in format PositionATL.


Legacy ID
Operating System
Windows 7
Feature Request
Steps To Reproduce

Attached below is a repro mission illustrating the problem this whole thing causes. Simply go to the concrete barrer and chose the "Create copy at getPosATL" action. There are 2 more concrete barriers atop the hill in different angles.

Event Timeline

AgentRev edited Steps To Reproduce. (Show Details)Aug 23 2014, 9:26 PM
AgentRev edited Additional Information. (Show Details)
AgentRev set Category to Feature Request.
AgentRev set Reproducibility to N/A.
AgentRev set Severity to None.
AgentRev set Resolution to Open.
AgentRev set Legacy ID to 404845263.May 7 2016, 7:17 PM

You might want to wait until Monday and see if this is what you are after:

Ooh, nice. Didn't see that one.

This comment was removed by SaMatra.

Turns out, getModelInfo has "Placing point" now. This ticket can be closed.

Just for reference use getPosWorld setPosWorld to save restore position

BIS_fnc_KK closed this task as Resolved.Apr 22 2023, 9:41 AM
BIS_fnc_KK updated the task description. (Show Details)
BIS_fnc_KK changed Resolution from Open to Fixed.
BIS_fnc_KK edited Additional Information. (Show Details)
BIS_fnc_KK set Operating System to Windows 7.