From 0681458f325c9bf0a309749985dd57db39a40d6d Mon Sep 17 00:00:00 2001 From: vbawol Date: Tue, 2 Jun 2015 13:24:24 -0500 Subject: [PATCH] Create saveBuildingPosVector.sqf --- Tools/SQF/saveBuildingPosVector.sqf | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Tools/SQF/saveBuildingPosVector.sqf diff --git a/Tools/SQF/saveBuildingPosVector.sqf b/Tools/SQF/saveBuildingPosVector.sqf new file mode 100644 index 00000000..cb21f90b --- /dev/null +++ b/Tools/SQF/saveBuildingPosVector.sqf @@ -0,0 +1,48 @@ +EPOCH_dbg_replaceBrackets = { + _return = []; + { + _string = _x; + if (_string == 93) then { + _string = 125; + }; + if (_string == 91) then { + _string = 123; + }; + _return pushBack _string; + } forEach toArray(format['%1',_this]); + _return = toString _return; + _return +}; + +EPOCH_dbg_savePropsPosWhitelist = { + + _disallowedTypes = ["ThingEffectLight","ThingEffect","ThingEffectFeather"]; + _isAllowed = { + _return = true; + { + if (_this isKindOf _x) exitWith {_return = false}; + } forEach _disallowedTypes; + _return + }; + + _br = toString [13,10]; + _types = ["Thing","Building"]; + _config_str = "propsPos[] = {" + _br; + _array = []; + { + _array append allMissionObjects _x; + } foreach _types; + if !(_array isEqualTo []) then { + + _countArray = (count _array) - 1; + { + if (_x call _isAllowed) then { + _worldSpaceNtype = [typeOf _x, getposATL _x, getDir _x]; + _config_str = _config_str + format[' { "%1", %2, %3, true }%4', typeOf _x, (getposATL _x) call EPOCH_dbg_replaceBrackets, [vectordir _x, vectorup _x] call EPOCH_dbg_replaceBrackets, if (_forEachIndex isEqualTo _countArray) then {_br} else {("," + _br)}]; + }; + } foreach _array; + }; + _config_str = _config_str + "};" + _br; + _config_str +}; +copyToClipboard call EPOCH_dbg_savePropsPosWhitelist;