Search the Community
Showing results for tags 'grabber'.
Found 1 result
-
I wrote a little script to help with base building. This is meant for people who want to build static bases on a map with absolute position (not a composition) and just get the simple createVehicle code back. This is essentially what the broken 3D editor does except this uses Zeus so you get all the objects and stuff. Here's the script: private ["_pos","_radius","_collection","_startingInt","_c","_final"]; _pos = param [0, (position player)]; _radius = param [1, 250]; _startingInt = param [2, 0]; _collection = nearestObjects [_pos, ["All"], _radius]; if (count _collection > 0) then { _c = _startingInt; _final = ""; { private ["_obj","_class","_sim"]; _obj = _x; _class = typeOf _obj; _sim = getText (configFile >> "CfgVehicles" >> _class >> "simulation"); if !(_sim in ["soldier","invisible","curator"]) then { private ["_pos","_dir","_fuel","_damage"]; _pos = position _obj; _dir = getDir _obj; _fuel = fuel _obj; _damage = damage _obj; _br = toString [13,10]; _buildStr = format ["_vehicle_%1 = objNull; if (true) then { _this = createVehicle ['%2', %3, [], 0, 'CAN_COLLIDE']; _vehicle_%1 = _this; _this setDir %4; _this setPos %3; };", _c, _class, _pos, _dir]; _final = _final + _br + _buildStr; _c = _c + 1; }; } forEach _collection; copyToClipboard _final; hint "Copied to Clipboard"; }; There are 3 parameters: 0: ARRAY - Position at which the anchor the grabber 1: SCALAR - (Optional, defaults to 250) Radius to use when searching for objects 2: SCALAR - (Optional, defaults to 0) Starting interval number (use this if you want to add on to your base without having to rename variables from 0 to X etc.) All you need to do is put this sort of thing in your init.sqf and then place the Zeus modules on the map in order to enter Zeus (the script will not grab any module objects). player addAction ["Save Composition", { [position player, 200] execvm "zeusGrabber.sqf" }]; player addAction ["Load Composition", "myBase.sqf"]; Output will be something like this. Then to load your objects just call a script with the generated code inside it. _vehicle_0 = objNull; if (true) then { _this = createVehicle ['Land_Communication_F', [3997.9,4011.65,0], [], 0, 'CAN_COLLIDE']; _vehicle_0 = _this; _this setDir 0; _this setPos [3997.9,4011.65,0]; }; _vehicle_1 = objNull; if (true) then { _this = createVehicle ['Land_BagBunker_Large_F', [3990.86,3984.25,0], [], 0, 'CAN_COLLIDE']; _vehicle_1 = _this; _this setDir 0; _this setPos [3990.86,3984.25,0]; }; _vehicle_2 = objNull; if (true) then { _this = createVehicle ['Land_ReservoirTank_Rust_F', [4018.19,3981.11,0], [], 0, 'CAN_COLLIDE']; _vehicle_2 = _this; _this setDir 0; _this setPos [4018.19,3981.11,0]; }; _vehicle_3 = objNull; if (true) then { _this = createVehicle ['Land_IndPipe2_Small_ground2_F', [4025.75,3983,0], [], 0, 'CAN_COLLIDE']; _vehicle_3 = _this; _this setDir 0; _this setPos [4025.75,3983,0]; }; _vehicle_4 = objNull; if (true) then { _this = createVehicle ['Land_Factory_Main_F', [4011.58,4021.95,0], [], 0, 'CAN_COLLIDE']; _vehicle_4 = _this; _this setDir 0; _this setPos [4011.58,4021.95,0]; }; _vehicle_5 = objNull; if (true) then { _this = createVehicle ['Land_BagBunker_Large_F', [3978.38,3996.92,0], [], 0, 'CAN_COLLIDE']; _vehicle_5 = _this; _this setDir 0; _this setPos [3978.38,3996.92,0]; }; _vehicle_6 = objNull; if (true) then { _this = createVehicle ['Land_BagBunker_Tower_F', [4009.92,3967.57,0], [], 0, 'CAN_COLLIDE']; _vehicle_6 = _this; _this setDir 0; _this setPos [4009.92,3967.57,0]; }; _vehicle_7 = objNull; if (true) then { _this = createVehicle ['Land_Shed_Small_F', [4036.71,3988.52,0], [], 0, 'CAN_COLLIDE']; _vehicle_7 = _this; _this setDir 0; _this setPos [4036.71,3988.52,0]; };