_setvectorup is not working

Silver85

Member
Hello,
im running a Epoch (1.0.3.1) server and tried a few things to get the above named command to work..without any luck. My code looks like:

Code:
if (isServer) then {
 
_vehicle_0 = objNull;
if (true) then
 
{
  _this = createVehicle ["Land_HouseV_1I4", [13307.73, 11643.808, 0.27678674], [], 0, "CAN_COLLIDE"];
  _vehicle_132 = _this;
  _this setDir 61.491592;
  _this setTargetAge "60 MIN";
  _this setvectorup [0,0,1];
  _this setPos [13307.73, 11643.808, 0.27678674];
};
 
_vehicle_134 = objNull;
if (true) then
{
  _this = createVehicle ["Land_HouseV_1I3", [13335.124, 11645.032, -0.0001373291], [], 0, "CAN_COLLIDE"];
  _vehicle_134 = _this;
  _this setDir 115.12653;
  _this setvectorup [0,0,1];
  _this setPos [13335.124, 11645.032, -0.0001373291];
}; and so on

If i edit the same code when its converted in the mission.sqm like this:

Code:
class Item375
        {
            position[]={13307.73,33.93988,11643.808};
            azimut=61.491592;
            age="60 MIN";
            id=376;
            side="EMPTY";
            vehicle="Land_HouseV_1I4";
            skill=0.2;
            init="_this setVectorUp [0,0,1];; this setpos [13307.73, 11643.808, 0.27678674];";
        };
        class Item376
        {
            position[]={13335.124,34.176643,11645.032};
            azimut=115.12653;
            id=377;
            side="EMPTY";
            vehicle="Land_HouseV_1I3";
            skill=0.2;
            init="this setpos [13335.124, 11645.032, -0.0001373291];this setVectorUp [0,0,1]";
        };

it works.!????

I like to use the sqf. version because its easier to handle and you dont need to edit the mission.sqm.
Does anybody has an idea to solve this problem?

Thank you very much!
 
Setpos will set the object level to the terrain, so setting the vector up before setpos will cause it to be level to the terrain again giving the appearance of it not working.

Simply call setpos before setvectorup.
 
Thank you Vampire but this i`ve already tryed out. I got it fixed this way:
_this = createVehicle ["Land_HouseV_1I4", [13307.73, 11643.808, 0.27678674], [], 0, "CAN_COLLIDE"];
_vehicle_132 = _this;
_this setDir 61.491592;
_this setTargetAge "60 MIN";
_this setVehicleInit "this setvectorup [0,0,1]";
_this setPos [13307.73, 11643.808, 0.27678674];

o_O Strange but it works very well now.
Thank you..
 
Back
Top