How to get PRECISE building locations in add-on sqf scripts...?

meshguru99

New Member
I can get very precise building locations over a flat surface or over water, but any time I try to build something complex over uneven terrain the automatic terrain following routines mess up my building component juxtapositions.

I'm trying to use pier segments to build a 3D structure. Basically I'm using pier segments as if they were giant Legos. The prototype comes together perfectly on NWAF, but as soon as I put it anywhere else, I get whole sections moving.

This is one sample segment:

_bldObj = objNull;
if (true) then
{
_bldObj = createVehicle ["land_nav_pier_c", [ 15315.0 , 16740.0, 0.0], [], 0, "CAN_COLLIDE"];
_bldObj setDir 180.0;
_bldObj setPos [ 15315.0 , 16740.0, 0.0];
_bldObj setPosASL [getposASL _bldObj select 0, getposASL _bldObj select 1, _fThisHeight];
_bldObj setVectorUp [0, 0, 1];
};

The "createVehicle" call isn't precise. It locates the building "approximately". Thus, the setPos is necessary to refine the building position. The setPosASL moves the building with respect to sea level... and finally the setVectorUp fixes the orientation that's set according to the terrain by the setPosASL. The setVectorUp call, however, causes a shift in x or y as it fixes the vertical vector of the building segment's transform. I don't suppose there's any way to get to the transform matrix directly, is there? Or a sequence that doesn't cause the displacement vector to change as the orientation matrix is modified? Hmmm, it just occurred to me I haven't tried this:


_bldObj = objNull;
if (true) then
{
_bldObj = createVehicle ["land_nav_pier_c", [ 15315.0 , 16740.0, 0.0], [], 0, "CAN_COLLIDE"];
_bldObj setDir 180.0;
_bldObj setPosASL [ 15315.0 , 16740.0, _fThisHeight];
_bldObj setVectorUp [0, 0, 1];
};
I guess I need to check to see if that makes a difference. Somehow I doubt it will, but it's worth trying.
Anyone else solve this problem any other way?
- ep
 
did this fix your problem?
i'm even stugling to have perfectly vertical structures over water.
What is it exactly that you need to flatten them out?
 
Back
Top