To BIS: Please forward this to a developer with knowledge on how getPosATL works and who knows about "LandContact" vertices. (https://community.bistudio.com/wiki/Oxygen_2_-_Manual#LandContact)
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;
}
else
{
_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];
}
else
{
_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.