Anhor Posted June 8, 2017 Report Share Posted June 8, 2017 Can someone explain me the technical difference between this two methods? Method 1: Spoiler if (isServer) then { _vehicle_0 = objNull; if (true) then { _this = createVehicle ["MAP_asf3_0_2000", [11454.295, 12230.232, 0], [], 0, "CAN_COLLIDE"]; _vehicle_0 = _this; _this setDir 24; _this setPos [11454.295, 12230.232, 0]; }; }; Method 2: Spoiler if (isServer) then{ _bldObj = objNull; if (true) then { _bldObj = createVehicle ["MAP_asf3_0_2000", [11454.295, 12230.232, 0], [], 0, "CAN_COLLIDE"]; _bldObj = _bldObj; _bldObj setDir 24; _bldObj setPosATL [11454.295, 12230.232, 0]; }; }; Both do the same ........ but what is the difference? Link to comment Share on other sites More sharing options...
0 Airwaves Man Posted June 8, 2017 Report Share Posted June 8, 2017 @Anhor Both are not exact the same. The second one uses setPosATL thats a better way to place things over water. Anhor 1 Link to comment Share on other sites More sharing options...
0 Anhor Posted June 8, 2017 Author Report Share Posted June 8, 2017 But technical they the same? I use allways the second method. BTW, a small tipp: To place things over water use: setPosASL ATL = above terrain level ASL = above sea level Airwaves Man 1 Link to comment Share on other sites More sharing options...
0 juandayz Posted June 8, 2017 Report Share Posted June 8, 2017 Just now, Anhor said: But technical they the same? I use allways the second method. BTW, a small tipp: To place things over water use: setPosASL ATL = above terrain level ASL = above sea level i think ATL & ASL are godd if u need pickup one of the 3 coords select 0 , select 1... Xobject = createVehicle "MAP_asf3_0_2000"; _pos = getposATL player; _dir = getdir player; _pos = [(_pos select 0)+2*sin(_dir),(_pos select 1)+2*cos(_dir), (_pos select 2)]; _Xobject setDir _dir; _Xobject setposATL _pos; this set object pos just in front of the player Link to comment Share on other sites More sharing options...
0 Anhor Posted June 8, 2017 Author Report Share Posted June 8, 2017 What I wanna know exactly was is there a "better" one about server performance? Link to comment Share on other sites More sharing options...
0 Airwaves Man Posted June 8, 2017 Report Share Posted June 8, 2017 I think non of them will have a better performance impact. You have to cut the code to get better performance like in @ebayShopper [SQF] Compact Editor Ouput. juandayz 1 Link to comment Share on other sites More sharing options...
Question
Anhor
Can someone explain me the technical difference between this two methods?
Method 1:
if (isServer) then {
_vehicle_0 = objNull;
if (true) then
{
_this = createVehicle ["MAP_asf3_0_2000", [11454.295, 12230.232, 0], [], 0, "CAN_COLLIDE"];
_vehicle_0 = _this;
_this setDir 24;
_this setPos [11454.295, 12230.232, 0];
};
};
Method 2:
if (isServer) then{
_bldObj = objNull;
if (true) then
{
_bldObj = createVehicle ["MAP_asf3_0_2000", [11454.295, 12230.232, 0], [], 0, "CAN_COLLIDE"];
_bldObj = _bldObj;
_bldObj setDir 24;
_bldObj setPosATL [11454.295, 12230.232, 0];
};
};
Both do the same ........ but what is the difference?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now