Jump to content

Recommended Posts

is there anyway I can take this

Spoiler

_vehicle_2 = objNull;
if (true) then
{
  _this = createVehicle ["Land_R_Shed_Ind02", [11982.002, 12815.203, -0.12420972], [], 0, "CAN_COLLIDE"];
  _vehicle_2 = _this;
  _this setDir 200.3562;
  _this setVehicleInit "this setvectorup [0,0,1]";
  _this setPos [11982.002, 12815.203, -0.12420972];
};

 

or

Spoiler

_vehicle_12 = objNull;
if (true) then
{
  _this = createVehicle ["Land_HouseB_Tenement", [11214.148, 18388.43, -0.00012588501], [], 0, "CAN_COLLIDE"];
  _vehicle_12 = _this;
  _this setDir 32.964344;
  _this setVehicleArmor 0.49999991;
  _this setFuel 0.51825774;
  _this setVehicleAmmo 0.50954628;
  _this setPos [11214.148, 18388.43, -0.00012588501];
};

 

 

and import into eden via the debug console?

 

Share this post


Link to post
Share on other sites

I tried running that in the debug console, and it does not create the object on the map.

Share this post


Link to post
Share on other sites

yes, i am trying to take arma 2 objects and their coordinates as I am using a2 map with CUP. I do not want to do each object 1 by 1 manually. will take forever. So looking for a faster method to take my old a2 map and convert over to a3

Share this post


Link to post
Share on other sites

setVehicleInit is not supported in Arma 3.

  • Like 1

Share this post


Link to post
Share on other sites

ok how can I take this

_this = createVehicle ["Land_R_Shed_Ind02", [11982.002, 12815.203, -0.12420972], [ ], 0, "CAN_COLLIDE"];

_this setDir 200.3562;

and translate for eden

   collect3DENHistory{
    {
        private[ "_obj" ];
        _x params[ "_type", "_pos", "_rot" ];

        _obj = create3DENEntity [ "Object", _type, _pos, true ];
        _obj set3DENAttribute [ "rotation",[ 0,0,_rot ] ];

    }forEach [
    ["Land_R_Shed_Ind02",[11982.002, 12815.203, -0.12420972],200.3562,0,0,false]
];
};

works fine, but when I have a file with a bunch of the

_this = createVehicle ["Land_R_Shed_Ind02", [11982.002, 12815.203, -0.12420972], [ ], 0, "CAN_COLLIDE"];

_this setDir 200.3562;

Am i going to have to change each 1 to that format, or can a script do this for me.

 

 

Share this post


Link to post
Share on other sites
2 hours ago, tinboye said:

I tried running that in the debug console, and it does not create the object on the map.

Barring any unsupported commands or scripting errors it should create the objects when run from the debugConsole in Eden.

All the mission scripts are available within Eden they are just not run.

 

You should be able to run all your object creation scripts from the debugConsole which will create the objects as non Eden enitites.

Then compare the difference between allmissionObjects "allVehciles" & "static" ( static for buildings ) and all3DENEntities select 0, iterate each one, get its pos and direction, delete it and recreate it as an Eden Object.

 

createShed.sqf - saved in mission directory

_this = createVehicle ["Land_R_Shed_Ind02", [11982.002, 12815.203, -0.12420972], [ ], 0, "CAN_COLLIDE"];
_this setDir 200.3562; 

From Eden debugConsole

_nul = [] spawn {
	
	_thread = execVM "createShed.sqf";
	
	waitUntil{ scriptDone _thread };
	
	_newObjects = ( allMissionObjects "allvehicles" + allMissionObjects "static" ) - (all3DENEntities select 0);
	
	{
		_pos = getPosATL _x;
		_dir = getDir _x;
		_object = typeOf _x;
		
		deleteVehicle _x;
		
		_newObj = create3DENEntity [ "Object", _object, _pos, true ];
		_newObj set3DENAttribute [ "position", _pos ];
		_newObj set3DENAttribute [ "rotation", [ 0, 0, _dir ] ];
	}forEach _newObjects;
};

Will need testing to see how reliable the position info is when converted and will need fine tuning for what attributes you want to save but should be possible to to do.

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
On 3/29/2017 at 12:15 AM, Larrow said:

_newObj set3DENAttribute [ "rotation", [ 0, 0, _dir ] ];

Whenever I use this it messes up the rotation of some of my objects. For example I have piers that are inverted to make ceilings however these appear lower than they are supposed to and they are no longer upside down. Other than that it works wonders, thanks a lot.

Share this post


Link to post
Share on other sites
6 hours ago, killzone_kid said:

If you turned them upside down you should probably include this in rotation

I have tried but with no real success, I found that the 3den attribute rotation was set with pitch, roll, and yaw. So I used the BIS_fnc_getPitchBank to try and set the other two values for rotation however I must be doing something wrong as it only makes the rotation problem worse.

 

_nul = [] spawn {
	
	_thread = execVM "mission.sqf";
	
	waitUntil{ scriptDone _thread };
	
	_newObjects = ( allMissionObjects "allvehicles" + allMissionObjects "all" ) - (all3DENEntities select 0);
	
	{
		_pos = getPosATL _x;
		_dir = getDir _x;
		_up = _x call BIS_fnc_getPitchBank;
		_object = typeOf _x;
		
		deleteVehicle _x;
		
		_newObj = create3DENEntity [ "Object", _object, _pos, true ];
		_newObj set3DENAttribute [ "position", _pos ];
		_newObj set3DENAttribute [ "rotation", [ _up, _dir ] ];
	}forEach _newObjects;
};

 

Share this post


Link to post
Share on other sites

BIS_fnc_getPitchBank returns array you want angle. Anyway just tried it in eden and everything works fine. object totated first on z then on y then on x

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×