Pardon me if I'm missing something obvious here, but I can't seem to work it out (have searched, etc.). I'm attempting to build (in a script), a bridge between an island and mainland, for use in a mission by human players . I took a starting co-ordinate from a manually-placed bridge piece, and have positioned the bridge pieces by script thereafter (the script, listed below, is a little hacky, just for the sake of this example). The bridge heads due north, so directions are not the problem, and I'm setting heights with setPosASL, to ensure they're equal (at least, I presume it achieves that... the Biki seems to imply it).
However, the pieces of the bridge that go over land that is above sea level are offset in all three dimensions, and I can't really figure out the best way to get around it. The first piece, as you can see on the left side of the screenshot, is created at the exact location I specified, but the next piece seems to not follow on directly from it (though all subsequent pieces are fine, until meeting land above sea level on the other side).
Any help would be greatly appreciated (as would an easier/better way to create a bridge and import the actual objects into the mission, so it need not be scripted... without me having to manually copy down co-ordinates for each piece).
Mock-up script:
_bridgeName = "AAST070";
_bridgeStartX = 9298.54;
_bridgeStartY = 3616.73;
_bridgeSectorLength = 20;
_bridgeHeight = -26;
_bridgeVectorDir = [0,0,0];
_bridgeVectorUp = [0,0,0];
_bridgeSectors = 55;
hint "Preparing to build bridge...";
sleep 2;
// Create objects
for "_x" from 0 to _bridgeSectors step 1 do {
_tmpY = _bridgeStartY + (_x*_bridgeSectorLength);
_tmp = _bridgeName createVehicle [_bridgeStartX,_tmpY,_bridgeHeight];
_tmp setPosASL [_bridgeStartX, _tmpY, _bridgeHeight];
_tmp setVectorDir _bridgeVectorDir;
_tmp setVectorUp _bridgeVectorUp;
_tmp setDir 0;
hint format["Sector %1 of %2 done.", _x, _bridgeSectors];
sleep .5;
};
sleep 5;
hint "Done."
Screenshot attached.