Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private "_find";
- print = "hintc Format [""%1"", _this]";
- if (Format ["%1", getWorld] == "scalar bool array string 0xfcffffef") then
- {
- // OFP
- _find =
- {
- private ["_c", "_i"];
- _c = count (_this select 0);
- _i = 0;
- while "_i < _c" do
- {
- if ((_this select 1) == ((_this select 0) select _i)) then {_c=-1} else {_i=_i+1};
- };
- if (_c < 0) then {_i} else {-1}
- };
- }
- else
- {
- //CWA
- _find = "(_this select 0) find (_this select 1)";
- };
- /*
- STRUCTURE OF "_ALL" ARRAY:
- 0 - [start weather, start fog, forecast weather, forecast fog];
- 1 - array of all available groups;
- 2 - empty vehicles placed;
- 3 - all placed triggers;
- 4 - all placed markers
- */
- private ["_ALL", "_a", "_cmp", "_cmpgs", "_c", "_j", "_p", "_f", "_msnPath", "_il", "_token"];
- _ALL = [];
- _ALl resize 5;
- // Safe wrapper for "... :il ..." request
- // Need in other places, not here
- _il =
- {
- private ["_p", "_r"];
- if (_this in [_this]) then {_p=[_this]} else {_p=+_this};
- _r = ["il "];
- "_r=_r+[Format[""%1"",_x]]" forEach _p;
- call (_r call FLIB_EXEC)
- };
- // Safe wrapper for "... :class token ..." request
- _msnPath = _this;
- _token =
- {
- private ["_t", "_r"];
- if (_this in [_this]) then {_t=[_this]} else {_t=+_this};
- _r = ["class token ", """", "f:", _msnPath, """", " "];
- "_r=_r+[Format[""%1"",_x]]" forEach _t;
- //player sideChat Format ["%1", _r];
- call (_r call FLIB_EXEC)
- };
- // Get weather info as a 4-element vector:
- // [start cast, start fog, forecast weather, forecast fog]
- private ["_w", "_i"];
- _w = [];
- _ALL set [0, "впартапапва"];
- //_msnPath call print;
- // Critical error here
- _a = "c:[Mission,Intel]" call _token;
- _i = [_a select 6, "startWeather"] call _find;
- if (_i<0) then {_w set [0, 0.5]} else {_w set [0, call ((_a select 7) select _i)]};
- _i= [_a select 6, "startFog"] call _find;
- if (_i<0) then {_w set [1, 0]} else {_w set [1, call ((_a select 7) select _i)]};
- _i= [_a select 6, "forecastWeather"] call _find;
- if (_i<0) then {_w set [2, 0.5]} else {_w set [2, call ((_a select 7) select _i)]};
- _i= [_a select 6, "forecastFog"] call _find;
- if (_i<0) then {_w set [3, 0]} else {_w set [3, call ((_a select 7) select _i)]};
- _ALL set [0, +_w];
- // Get array of all groups on the map
- private ["_g","_sh","_n","_v","_o","_m"];
- _g = [];
- _a = "c:[Mission,Groups]" call _token;
- _sh = call (_a select 5);
- _N = call ((_a select 7) select 0);
- _i = -1;
- while "_i=_i+1; _i<_N" do
- {
- _M = (["c:[Mission,Groups,Item", _i, ",Vehicles"] call _token) select 7;
- _M = call (_M select 0);
- _j = -1;
- while "_j=_j+1; _j<_M" do
- {
- _a = ["c:[Mission,Groups,Item", _i, ",Vehicles,Item", _j, "] ", _sh] call _token;
- _sh = call (_a select 5);
- _p = (_a select 7) select ([_a select 6, "position[]"] call _find);
- _v = (_a select 7) select ([_a select 6, "vehicle"] call _find);
- _o = nearestObject [ [call (_p select 0),call (_p select 2)], call _v ];
- if (! isNull _o) then
- {
- _g = _g + [group _o];
- _j = _M;
- };
- };
- };
- _ALL set [1, +_g];
- // Get array of all empty vehicles on the map
- private ["_e"];
- _e = [];
- _a = "c:[Mission,Vehicles]" call _token;
- _sh = call (_a select 5);
- _N = call((_a select 7) select 0);
- _i = -1;
- while "_i=_i+1; _i<_N" do
- {
- _a = ["c:[Mission,Vehicles,Item", _i, "] ", _sh] call _token;
- _sh = call (_a select 5);
- _p = (_a select 7) select ([_a select 6, "position[]"] call _find);
- _v = (_a select 7) select ([_a select 6, "vehicle"] call _find);
- _e = _e + [nearestObject [ [call (_p select 0),call (_p select 2)], call _v] ];
- };
- _ALL set [2, +_e];
- // Get array of all mission triggers
- private ["_t"];
- _t = [];
- _a = "c:[Mission,Sensors]" call _token;
- _sh = call (_a select 5);
- _N = call ((_a select 7) select 0);
- _i = -1;
- while "_i=_i+1; _i<_N" do
- {
- _a = ["c:[Mission,Sensors,Item", _i, "] ", _sh] call _token;
- _sh = call (_a select 5);
- _p = (_a select 7) select ([_a select 6, "position[]"] call _find);
- _t = _t + [ nearestObject [[call (_p select 0),call (_p select 2)], "EmptyDetector"] ];
- };
- _ALL set [3, +_t];
- // Array of all mission markers
- _m = [];
- _a = "c:[Mission,Markers]" call _token;
- _sh = call (_a select 5);
- _N = call ((_a select 7) select 0);
- _i = -1;
- while "_i=_i+1; _i<_N" do
- {
- _a = ["c:[Mission,Markers,Item", _i, "] ", _sh] call _token;
- _sh = call (_a select 5);
- _m = _m + [ call ((_a select 7) select ([_a select 6, "name"] call _find)) ];
- };
- _ALL set [4, +_m];
- _ALL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement