Treeherder Posted June 8, 2016 Report Share Posted June 8, 2016 (edited) 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 June 8, 2016 by Treeherder Ghost0fDawn likes this Link to comment
BioHazard Posted June 9, 2016 Report Share Posted June 9, 2016 (edited) That's pretty useful, I'm gonna bookmark this. I usually load MCC, it has an option which does the same thing. But this looks a little more lightweight and efficient, and will save me loading mods. Edited June 9, 2016 by BioHazard_ Link to comment
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