diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf index ecb81ab30..841fce63b 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf @@ -29,6 +29,6 @@ if (count _houses == 0) then { [] call btc_fnc_cache_find_pos; } else { //private ["_isAct","_cache"]; - _house = _houses select (floor random count _houses); + _house = selectRandom _houses; _house spawn btc_fnc_cache_spawn; }; \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/addWP.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/addWP.sqf index 938f0e724..82a5fedab 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/addWP.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/addWP.sqf @@ -16,7 +16,7 @@ _wp setWaypointBehaviour "SAFE"; _houses = [_pos,_radius] call btc_fnc_getHouses; if (count _houses > 0) then { private ["_house","_n_pos"]; - _house = _houses select (floor random count _houses); + _house = selectRandom _houses; _n_pos = 0; while {format ["%1", _house buildingPos _n_pos] != "[0,0,0]" } do { @@ -41,7 +41,7 @@ for "_i" from 1 to 4 do { if (count _houses > 0) then { private ["_house","_n_pos"]; - _house = _houses select (floor random count _houses); + _house = selectRandom _houses; _n_pos = 0; while {format ["%1", _house buildingPos _n_pos] != "[0,0,0]" } do { diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/create.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/create.sqf index fb5b15931..522ca8deb 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/create.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/create.sqf @@ -15,7 +15,7 @@ switch (typeName _city) do _rpos = [_pos, _area] call btc_fnc_randomize_pos; -_unit_type = btc_civ_type_units select (floor random count btc_civ_type_units); +_unit_type = selectRandom btc_civ_type_units; _group = createGroup civilian; _group createUnit [_unit_type, _rpos, [], 0, "NONE"]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/populate.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/populate.sqf index 629ea83ba..e67d5c3c8 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/populate.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/populate.sqf @@ -36,10 +36,10 @@ for "_i" from 0 to _n do { private ["_house","_unit_type"]; if (count _houses == 0) exitWith {}; - _house = _houses select (floor random count _houses); - - _unit_type = btc_civ_type_units select (floor random count btc_civ_type_units); - + _house = selectRandom _houses; + + _unit_type = selectRandom btc_civ_type_units; + _group = createGroup civilian; _group createUnit [_unit_type, getPos _house, [], 0, "NONE"]; _group spawn btc_fnc_civ_addWP; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf index 4ffeb11f1..77814900e 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf @@ -20,7 +20,7 @@ _cities = []; };} foreach btc_city_all; _pos = []; if (count _cities == 0) then {_pos = getPos _city;} else { - _pos = getPos (_cities select (floor random count _cities)); + _pos = getPos (selectRandom _cities); }; private ["_wp","_wp_1"]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index 5ca19e6e0..36cf66406 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -21,10 +21,10 @@ if (count _useful == 0) then { }; }; -_pos = _useful select (floor random count _useful); +_pos = selectRandom _useful; -_unit_type = btc_civ_type_units select (floor random count btc_civ_type_units); -_veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); +_unit_type = selectRandom btc_civ_type_units; +_veh_type = selectRandom btc_civ_type_veh; _group = createGroup civilian; _group setVariable ["no_cache",true]; @@ -41,10 +41,10 @@ if (count (_pos nearRoads 100) > 0) then { if (surfaceIsWater _Spos) then { _Spos = [_Spos select 0, _Spos select 1,0]; - _veh_type = btc_civ_type_boats select (floor (random (count btc_civ_type_boats))); + _veh_type = selectRandom btc_civ_type_boats; _iswater = true; } else { - _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); + _veh_type = selectRandom btc_civ_type_veh; _iswater = false; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/init_area.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/init_area.sqf index 7801b4592..83ef824ea 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/init_area.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/init_area.sqf @@ -15,17 +15,17 @@ for "_i" from 1 to _n do { private ["_sel_pos","_type_ied","_dir"]; _sel_pos = _pos; _sel_pos = [_pos, _area] call btc_fnc_randomize_pos; - _sel_pos = [_sel_pos, 30, 150, 1, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; + _sel_pos = [_sel_pos, 30, 150, 1, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; + + _type_ied = selectRandom btc_type_ieds; - _type_ied = btc_type_ieds select (floor random count btc_type_ieds); - _dir = (random 360); if (random 1 > 0.3) then { private ["_roads","_obj"]; _roads = _sel_pos nearRoads _area; if (count _roads > 0) then { - _obj = _roads select (floor random count _roads); + _obj = selectRandom _roads; if (random 1 > 0.5) then {_sel_pos = _obj modelToWorld [3.5,0,0];} else {_sel_pos = _obj modelToWorld [-3.5,0,0];}; }; } else { @@ -62,17 +62,17 @@ for "_i" from 1 to _n do { private ["_sel_pos","_type_ied","_dir"]; _sel_pos = _pos; _sel_pos = [_pos, _area] call btc_fnc_randomize_pos; - _sel_pos = [_sel_pos, 30, 150, 1, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; + _sel_pos = [_sel_pos, 30, 150, 1, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; + + _type_ied = selectRandom btc_type_ieds; - _type_ied = btc_type_ieds select (floor random count btc_type_ieds); - _dir = (random 360); if (random 1 > 0.3) then { private ["_roads","_obj","_ied_pos"]; _roads = _sel_pos nearRoads _area; if (count _roads > 0) then { - _obj = _roads select (floor random count _roads); + _obj = selectRandom _roads; if (random 1 > 0.5) then {_sel_pos = _obj modelToWorld [3,0,0];} else {_sel_pos = _obj modelToWorld [-3,0,0];}; }; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/suicider_create.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/suicider_create.sqf index 1126b97bc..6ed65500f 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/suicider_create.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/ied/suicider_create.sqf @@ -17,7 +17,7 @@ switch (typeName _city) do _rpos = [_pos, _area] call btc_fnc_randomize_pos; -_unit_type = btc_civ_type_units select (floor random count btc_civ_type_units); +_unit_type = selectRandom btc_civ_type_units; _group = createGroup civilian; _group createUnit [_unit_type, _rpos, [], 0, "NONE"]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/hideout.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/hideout.sqf index 0c3cfb5d0..65646d0b9 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/hideout.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/hideout.sqf @@ -8,7 +8,7 @@ private ["_ho","_pos","_marker","_array"]; _ho = btc_hq getVariable ["info_hideout",objNull]; if (isNull _ho) then { - _ho = btc_hideouts select (floor random count btc_hideouts); + _ho = selectRandom btc_hideouts; btc_hq setVariable ["info_hideout",_ho]; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/hideout_asked.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/hideout_asked.sqf index 58700fc8d..a46cddb3d 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/hideout_asked.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/hideout_asked.sqf @@ -12,7 +12,7 @@ switch _is_real do { [[1,[],player],"btc_fnc_int_ask_var",false] spawn BIS_fnc_MP; waitUntil {!(isNil "btc_int_ask_data")}; - + if (!isNull btc_int_ask_data) then { private ["_hideout","_dist","_dir","_card"]; _hideout = btc_int_ask_data; @@ -26,7 +26,7 @@ switch _is_real do { if ((random 1) > 0.5) then { private ["_array","_dist","_dir"]; _array = ["N","E","W","S","NW","NE","SE","SW"]; - _dir = _array select (floor (random (count _array))); + _dir = selectRandom _array; _dist = 300 + (random 2000); _text = format ["%1: I saw a lot of militia activity towards %2, %3 meter from here. Probably there is an hideout!", _name,_dir,round _dist]; } else { diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/troops.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/troops.sqf index 829fce7e6..cbae05c47 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/troops.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/info/troops.sqf @@ -1,4 +1,4 @@ - +selectRandom private ["_name","_is_real","_text"]; _name = _this select 0; @@ -26,7 +26,7 @@ switch _is_real do if ((random 1) > 0.5) then { private ["_array","_dist","_dir"]; _array = ["N","E","W","S","NW","NE","SE","SW"]; - _dir = _array select (floor (random (count _array))); + _dir = selectRandom _array; _dist = (500 + (random 1000)); _text = format ["%1: I saw some militia movement %2, %3 meter from here", _name,_dir,round _dist]; } else { diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/addWP.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/addWP.sqf index e2590f7b2..fd3b5bb68 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/addWP.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/addWP.sqf @@ -25,7 +25,7 @@ switch (true) do { _houses = [_city,_area] call btc_fnc_getHouses; if (count _houses > 0) then { _in_house = true; - _house = _houses select (floor random count _houses); + _house = selectRandom _houses; [_group,_house] spawn btc_fnc_house_addWP; _group setVariable ["inHouse",_house]; } else {[_group,_rpos,_area,"SAFE"] call btc_fnc_task_patrol;}; @@ -43,4 +43,4 @@ switch (true) do { }; }; -true \ No newline at end of file +true \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_rinf.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_rinf.sqf index ddab78f52..2b68e051c 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_rinf.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/check_rinf.sqf @@ -17,8 +17,7 @@ if (count _this > 0) then {_city = _this;} else { ) ) then {_useful = _useful + [_x];}; } foreach btc_city_all; - _id = floor random count _useful; - _city = _useful select _id; + _city = selectRandom _useful; }; _pos = [getPos _city, 300] call btc_fnc_randomize_pos; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_group.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_group.sqf index c0971605c..15b20c546 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_group.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_group.sqf @@ -17,10 +17,10 @@ switch (typeName _city) do { _rpos = [_pos, _area,true] call btc_fnc_randomize_pos; if (surfaceIsWater _rpos) then { - _unit_type = btc_type_divers select (floor random count btc_type_divers); + _unit_type = selectRandom btc_type_divers; _iswater = true; } else { - _unit_type = btc_type_units select (floor random count btc_type_units); + _unit_type = selectRandom btc_type_units; _iswater = false; }; @@ -35,7 +35,7 @@ switch (true) do { _houses = [_rpos,50] call btc_fnc_getHouses; if (count _houses > 0) then { _in_house = true; - _house = _houses select (floor random count _houses); + _house = selectRandom _houses; [_group,_house] spawn btc_fnc_house_addWP; _group setVariable ["inHouse",_house]; } else {[_group,_rpos,_area,"SAFE",_iswater] spawn btc_fnc_task_patrol;}; @@ -53,7 +53,7 @@ switch (true) do { }; if (!_in_house) then { for "_i" from 0 to _n do { - _unit_type = [btc_type_units select (floor random count btc_type_units), btc_type_divers select (floor random count btc_type_divers) ] select _iswater; + _unit_type = [selectRandom btc_type_units, selectRandom btc_type_divers ] select _iswater; _group createUnit [_unit_type, _rpos, [], 0, "NONE"]; sleep 0.5; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_hideout.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_hideout.sqf index cdb57d176..6c857c89c 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_hideout.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_hideout.sqf @@ -19,8 +19,7 @@ if (count _this > 0) then {_city = _this;} else { ) ) then {_useful = _useful + [_x];}; } foreach btc_city_all; - _id = floor random count _useful; - _city = _useful select _id; + _city = selectRandom _useful; }; _radius = (((_city getVariable ["RadiusX",0]) + (_city getVariable ["RadiusY",0]))/2) - 100; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_static.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_static.sqf index cfddd0d39..47aba7eb2 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_static.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/create_static.sqf @@ -4,14 +4,14 @@ private ["_pos","_type","_dir","_static","_group","_unit_type","_gunner"]; _pos = _this select 0; _type = _this select 1; _dir = 0; if (count _this > 2) then {_dir = _this select 2;}; -if (typeName _type == "ARRAY") then {_type = _type select (floor random count _type);}; +if (typeName _type == "ARRAY") then {_type = selectRandom _type;}; _static = _type createVehicle _pos; _static setDir _dir; _static setpos _pos; _group = createGroup btc_enemy_side; -_unit_type = btc_type_units select (floor (random (count btc_type_units))); +_unit_type = selectRandom btc_type_units; _gunner = _group createUnit [_unit_type, _pos, [], 0, "NONE"]; _gunner moveInGunner _static; _gunner setBehaviour "COMBAT"; @@ -19,4 +19,4 @@ _gunner setCombatMode "RED"; _gunner call btc_fnc_mil_unit_create; -if (btc_debug_log) then {diag_log format ["btc_fnc_mil_create_static: _this = %1 ; POS %2 _type %3",_this,_pos,_type];}; \ No newline at end of file +if (btc_debug_log) then {diag_log format ["btc_fnc_mil_create_static: _this = %1 ; POS %2 _type %3",_this,_pos,_type];}; \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf index f10372c06..0914ec6be 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf @@ -19,7 +19,7 @@ _cities = []; };} foreach btc_city_all; _pos = []; if (count _cities == 0) then {_pos = getPos _city;} else { - _pos = getPos (_cities select (floor random count _cities)); + _pos = getPos (selectRandom _cities); }; private ["_wp","_wp_1"]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf index 230a1ab0d..24b2c24b4 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf @@ -36,7 +36,7 @@ if (count _useful == 0) then { if (count _useful == 0) exitWith {true}; -_pos = _useful select (floor random count _useful); +_pos = selectRandom _useful; _group = createGroup btc_enemy_side; _group setVariable ["city",_city]; @@ -54,7 +54,7 @@ switch (true) do { _group createUnit [(btc_type_units select 0), _pos, [], 0, "NONE"];(leader _group) setpos _pos; for "_i" from 1 to _n_units do { private ["_unit_type"]; - _unit_type = btc_type_units select (floor random count btc_type_units); + _unit_type = selectRandom btc_type_units; _group createUnit [_unit_type, _pos, [], 0, "NONE"]; sleep 1; }; @@ -69,10 +69,10 @@ switch (true) do { _newZone = [_pos, 0, 500, 13, 1, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; }; if (surfaceIsWater _newZone) then { - _veh_type = btc_type_boats select (floor (random (count btc_type_boats))); + _veh_type = selectRandom btc_type_boats; _iswater = true; } else { - _veh_type = btc_type_motorized select (floor (random (count btc_type_motorized))); + _veh_type = selectRandom btc_type_motorized; _iswater = false; }; if (_veh_type == "I_SDV_01_F" || _veh_type == "O_SDV_01_F" || _veh_type == "B_SDV_01_F") then {_needdiver = true; _crewmen = btc_type_divers select 0} else {_needdiver = false; _crewmen = btc_type_crewmen}; @@ -82,7 +82,7 @@ switch (true) do { _cargo = (_veh emptyPositions "cargo") - 1; if (_cargo > 0) then { for "_i" from 0 to _cargo do { - _unit_type = [btc_type_units select (round (random ((count btc_type_units) - 1))), btc_type_divers select (round (random ((count btc_type_divers) - 1)))] select _needdiver ; + _unit_type = [selectRandom btc_type_units, selectRandom btc_type_divers] select _needdiver ; _unit_type createUnit [_pos, _group, "this moveinCargo _veh;this assignAsCargo _veh;"]; }; }; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/send.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/send.sqf index bc24dd70d..515ae0a60 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/send.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/mil/send.sqf @@ -25,7 +25,7 @@ switch (_this select 2) do { _group = createGroup btc_enemy_side; _group setVariable ["no_cache",true]; _veh_type = (_this select 3); - if (_veh_type == "") then {_veh_type = btc_type_motorized select (floor random count btc_type_motorized)}; + if (_veh_type == "") then {_veh_type = selectRandom btc_type_motorized}; _return_pos = [_pos, 0, 500, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; _veh = createVehicle [_veh_type, _return_pos, [], 0, "NONE"]; _gunner = _veh emptyPositions "gunner"; @@ -36,12 +36,12 @@ switch (_this select 2) do { if (_commander > 0) then {btc_type_crewmen createUnit [_pos, _group, "this moveinCommander _veh;this assignAsCommander _veh;"];}; for "_i" from 0 to _cargo do { private "_unit_type"; - _unit_type = btc_type_units select (floor random count btc_type_units); + _unit_type = selectRandom btc_type_units; _unit_type createUnit [_pos, _group, "this moveinCargo _veh;this assignAsCargo _veh;"]; }; - + _group selectLeader (driver _veh); - + _wp = _group addWaypoint [_dest, 60]; _wp setWaypointType "MOVE"; _wp setWaypointCombatMode "RED"; @@ -52,7 +52,7 @@ switch (_this select 2) do { _wp_3 = _group addWaypoint [_dest, 60]; _wp_3 setWaypointType "SENTRY"; _wp setWaypointStatements ["true","(group this) spawn btc_fnc_data_add_group;"]; - + {_x call btc_fnc_mil_unit_create} foreach units _group; }; }; \ No newline at end of file diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/rep/call_militia.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/rep/call_militia.sqf index bd95d2c25..77666e74a 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/rep/call_militia.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/rep/call_militia.sqf @@ -23,7 +23,7 @@ if (count _start_pos == 0) then }; if (btc_debug_log) then {diag_log format ["fnc_rep_call_militia = _start_pos : %1 (CITIES)",_start_pos];}; -if (count _start_pos == 0) then +if (count _start_pos == 0) then { private ["_random"]; _random = random 8; @@ -36,7 +36,7 @@ if (count _start_pos == 0) then case (_random > 4 && _random <= 5) : {_start_pos = [(_pos select 0) - 1000,(_pos select 1) + 0,0];};//W case (_random > 5 && _random <= 6) : {_start_pos = [(_pos select 0) - 750,(_pos select 1) - 750,0];};//SW case (_random > 6 && _random <= 7) : {_start_pos = [(_pos select 0) - 750,(_pos select 1) + 750,0];};//NW - case (_random > 7) : {_start_pos = [(_pos select 0) + 0,(_pos select 1) - 1000,0];};//S + case (_random > 7) : {_start_pos = [(_pos select 0) + 0,(_pos select 1) - 1000,0];};//S }; }; @@ -55,7 +55,7 @@ if ((random 1) > _ratio) then private ["_veh_type","_veh","_gunner","_commander","_cargo","_wp"]; _group = createGroup btc_enemy_side; _group setVariable ["no_cache",true]; - _veh_type = btc_type_motorized select (floor random count btc_type_motorized); + _veh_type = selectRandom btc_type_motorized; _veh = createVehicle [_veh_type, _start_pos, [], 0, "NONE"]; _gunner = _veh emptyPositions "gunner"; _commander = _veh emptyPositions "commander"; @@ -65,12 +65,12 @@ if ((random 1) > _ratio) then if (_commander > 0) then {btc_type_crewmen createUnit [_start_pos, _group, "this moveinCommander _veh;this assignAsCommander _veh;"];}; for "_i" from 0 to _cargo do { - _unit_type = btc_type_units select (round (random ((count btc_type_units) - 1))); + _unit_type = selectRandom btc_type_units; _unit_type createUnit [_start_pos, _group, "this moveinCargo _veh;this assignAsCargo _veh;"]; }; - + _group selectLeader (driver _veh); - + _wp = _group addWaypoint [_pos, 60]; _wp setWaypointType "MOVE"; _wp setWaypointCombatMode "RED"; @@ -85,13 +85,13 @@ if ((random 1) > _ratio) then { diag_log format ["fnc_rep_call_militia = MOT %1/%2 POS %3",_group,_veh_type,_pos]; }; -} +} else { //INF _group = [_start_pos,50,(8 + random 6),1] call btc_fnc_mil_create_group; _group setVariable ["no_cache",true]; - while {(count (waypoints _group)) > 0} do { deleteWaypoint ((waypoints _group) select 0); }; + while {(count (waypoints _group)) > 0} do { deleteWaypoint ((waypoints _group) select 0); }; _wp = _group addWaypoint [_pos, 60]; _wp setWaypointType "MOVE"; _wp setWaypointCombatMode "RED"; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf index d3fb1c3e5..c5bdb78db 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf @@ -5,7 +5,7 @@ private ["_useful","_city","_pos","_road","_roads","_boxes","_marker","_markers" _useful = []; {if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; -_city = _useful select (floor random count _useful); +_city = selectRandom _useful; _pos = getPos _city; btc_side_aborted = false; @@ -27,9 +27,9 @@ for "_i" from 1 to (1 + round random 2) do { //// Choose a road \\\\ _pos = [getPos _city, 300] call btc_fnc_randomize_pos; _roads = _pos nearRoads 300; - if (count _roads > 0) then {_road = (_roads select (floor random count _roads)); + if (count _roads > 0) then {_road = selectRandom _roads; _pos = getPos _road; - }; + }; _direction = [_road] call btc_fnc_road_direction; @@ -42,11 +42,11 @@ for "_i" from 1 to (1 + round random 2) do { _markers = _markers + [_marker]; //// Randomise composition \\\\ - _type_barrel = btc_type_barrel select (floor (random (count btc_type_barrel))); - _type_barrel_canister1 = (btc_type_barrel + btc_type_canister) select (floor (random (count (btc_type_barrel +btc_type_canister)))); - _type_barrel_canister2 = (btc_type_barrel + btc_type_canister) select (floor (random (count (btc_type_barrel +btc_type_canister)))); - _type_pallet = btc_type_pallet select (floor (random (count btc_type_pallet))); - _type_box = btc_type_box select (floor (random (count btc_type_box))); + _type_barrel = selectRandom btc_type_barrel; + _type_barrel_canister1 = selectRandom(btc_type_barrel +btc_type_canister); + _type_barrel_canister2 = selectRandom(btc_type_barrel +btc_type_canister); + _type_pallet = selectRandom btc_type_pallet; + _type_box = selectRandom btc_type_box; _btc_composition_checkpoint = [ [_type_barrel,10,[0.243652,-2.78906,0]], [_type_barrel,20,[-0.131836,3.12939,0]], diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf index f572d1686..066c90b9b 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf @@ -5,18 +5,18 @@ private ["_useful","_veh","_vehpos","_city","_pos","_r","_houses","_roads","_mar _useful = []; {if (!(_x getVariable ["occupied",false]) && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; -_city = _useful select (floor random count _useful); +_city = selectRandom _useful; _pos = getPos _city; //// Choose spawn in house or on road \\\\ _r = random 2; if ( _r < 1) then { _roads = _pos nearRoads 200; - if (count _roads > 0) then {_pos = getPos (_roads select (floor random count _roads));}; + if (count _roads > 0) then {_pos = getPos (selectRandom _roads);}; _vehpos = [_pos, 10] call btc_fnc_randomize_pos; } else { _houses = [[(_pos select 0),(_pos select 1),0],200] call btc_fnc_getHouses; - _pos = getPos (_houses select (floor random count _houses)); + _pos = getPos (selectRandom _houses); _vehpos = [(_pos select 0),(_pos select 1),(_pos select 2) + 0.1]; }; @@ -37,7 +37,7 @@ _marker setMarkerSize [0.6, 0.6]; //// Create civ on _pos \\\\ if ( _r < 1) then { - _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); + _veh_type = selectRandom btc_civ_type_veh; _veh = createVehicle [_veh_type, _vehpos, [], 0, "NONE"]; _veh setDir (random 360); _veh setDamage 0.7; @@ -52,13 +52,13 @@ if ( _r < 1) then { _fx = "test_EmptyObjectForSmoke" createVehicle (getposATL _veh); _fx attachTo [_veh,[0,0,0]]; } else { - _phone_type = btc_type_phone select (floor (random (count btc_type_phone))); + _phone_type = selectRandom btc_type_phone; _veh = createVehicle [_phone_type, _vehpos, [], 0, "NONE"]; _veh setDir (random 360); _fx = objNull; }; -_unit_type = btc_civ_type_units select (floor random count btc_civ_type_units); +_unit_type = selectRandom btc_civ_type_units; _group = createGroup civilian; _group setVariable ["no_cache",true]; _group setVariable ["btc_patrol",true]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/create.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/create.sqf index 4fc4ed65d..2f7f6c4ee 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/create.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/create.sqf @@ -3,7 +3,7 @@ if (btc_side_assigned) exitWith {}; if (count btc_side_list_use == 0) then {btc_side_list_use = + btc_side_list;}; -_side = btc_side_list_use select (floor random count btc_side_list_use); +_side = selectRandom btc_side_list_use; btc_side_list_use = btc_side_list_use - [_side]; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf index 0413cfee3..750b4a52c 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf @@ -6,7 +6,7 @@ _useful = []; if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; -_city = _useful select (floor random count _useful); +_city = selectRandom _useful; _pos = getPos _city; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf index 05923e6db..b1b752631 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf @@ -6,7 +6,7 @@ _useful = []; if (count _useful == 0) then {_useful = + btc_city_all;}; -_city = _useful select (floor random count _useful); +_city = selectRandom _useful; //_pos = [getPos _city, 100] call btc_fnc_randomize_pos; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf index 3aa0eaafc..22c47bd19 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf @@ -6,7 +6,7 @@ _useful = []; if (count _useful == 0) then {_useful = + btc_city_all;}; -_city = _useful select (floor random count _useful); +_city = selectRandom _useful; _pos = [getPos _city, 100] call btc_fnc_randomize_pos; diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf index 720611d43..07e550afd 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf @@ -6,13 +6,13 @@ _useful = []; if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; -_city = _useful select (floor random count _useful); +_city = selectRandom _useful; _pos = [getPos _city, 100] call btc_fnc_randomize_pos; _roads = _pos nearRoads 100; -if (count _roads > 0) then {_road = (_roads select (floor random count _roads)); +if (count _roads > 0) then {_road = selectRandom _roads; _pos = getPos _road; }; @@ -41,7 +41,7 @@ _marker setmarkertype "hd_flag"; _marker setmarkertext "Radio Tower"; _marker setMarkerSize [0.6, 0.6]; -_tower_type = btc_type_tower select (floor (random (count btc_type_tower))); +_tower_type = selectRandom btc_type_tower; _tower = createVehicle [_tower_type, _pos, [], 0, "NONE"]; _tower setDir (_direction); diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf index b7e80fb58..dc58761e7 100644 --- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf +++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf @@ -4,13 +4,13 @@ private ["_city","_pos","_roads","_marker","_veh_type","_veh","_useful"]; _useful = []; {if (_x getVariable ["type",""] == "NameMarine") then {_useful = _useful + [_x];};} foreach btc_city_all; if (count _useful == 0) exitWith {[] spawn btc_fnc_side_create;}; -_city = _useful select (floor random count _useful); +_city = selectRandom _useful; _pos = [getPos _city, 100] call btc_fnc_randomize_pos; _roads = _pos nearRoads 300; -if (count _roads > 0) then {_pos = getPos (_roads select (floor random count _roads));}; +if (count _roads > 0) then {_pos = getPos (selectRandom _roads);}; btc_side_aborted = false; btc_side_done = false; @@ -33,7 +33,7 @@ _marker setmarkertype "hd_flag"; _marker setmarkertext "Vehicle needs assistance"; _marker setMarkerSize [0.6, 0.6]; -_veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); +_veh_type = selectRandom btc_civ_type_veh; _veh = createVehicle [_veh_type, _pos, [], 0, "NONE"]; _veh setDir (random 360);