Jump to content

3d editor to executable spawning conversion script


Recommended Posts

I was doing some mission editing today and ended up writing a simple script the converts the object info from things you place with the 3d editor or Zeus to a text format you can execute to spawn said objects. Figured it could be useful to some of you mission editors out there and so to save you some time here it is. To use it just build your things with the 3d editor or Zeus then spawn in as a player and execute this script. The code to spawn these objects will then be copied to your clipboard. And yes, I realize there is probably a cleaner way to do this.


_objects = allMissionObjects "All";

_dist = 1000;

_string = "";

{

	if((!((str _x) find "Agent" > -1 ) && !((str _x) find "Module" > -1) && !((str _x) find "Fx" > -1)) && player distance _x < _dist) then {

		_name = str (typeOf _x);

		_pos = str (getPosASL _x);

		_dir = str (getDir _x);

		_vUP = str (vectorUp _x);

		_vDir = str (vectorDir _x);

		_string = _string + "_veh = " + _name + " createVehicle position player; _veh setPosASL" + _pos + "; _veh setDir " + _dir + "; _veh setVectorUp " + _vUP + "; _veh setVectorDir " + _vDir + "; _veh enableSimulation false; ";

	};

} forEach _objects - allUnits;

hint format["%1",_string]; 

copyToClipboard _string;

  

Edited by Treeherder
Ghost0fDawn likes this
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...