From 60433398c5ad2403dce38d239398938e88dff6d6 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 28 Nov 2015 21:41:21 +0100 Subject: [PATCH 01/12] add NameMarine --- .../core/def/mission.sqf | 2 ++ .../core/fnc/city/activate.sqf | 32 +++++++++++++------ .../core/fnc/city/init.sqf | 12 +++---- .../core/fnc/civ/traffic_create.sqf | 10 +++++- .../core/fnc/mil/patrol_create.sqf | 13 ++++++-- 5 files changed, 50 insertions(+), 19 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf index 33c0a7722..da00463f8 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -125,6 +125,7 @@ btc_city_type = "Land_Ammobox_rounds_F"; //Civ btc_civ_type_units = ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F"]; btc_civ_type_veh = ["C_Hatchback_01_F","C_SUV_01_F","C_Offroad_01_F","C_Van_01_transport_F","C_Van_01_box_F"]; +btc_civ_type_boat = ["C_Rubberboat","C_Boat_Civil_01_F"," C_Boat_Civil_01_rescue_F"," C_Boat_Civil_01_police_F"]; btc_civ_max_veh = 5; btc_w_civs = ["V_Rangemaster_belt","arifle_Mk20_F","30Rnd_556x45_Stanag","hgun_ACPC2_F","9Rnd_45ACP_Mag"]; @@ -380,6 +381,7 @@ switch (true) do { btc_type_units = ["I_Soldier_F","I_Soldier_TL_F","I_Soldier_AR_F","I_engineer_F","I_Soldier_exp_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AT_F","I_Soldier_AA_F","I_Spotter_F","I_Sniper_F"]; btc_type_crewmen = "I_Soldier_F"; btc_type_vehicles = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F","I_MRAP_03_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F"]; + btc_type_boat = ["I_Boat_Armed_01_minigun_F"," I_Boat_Transport_01_F","I_SDV_01_F","I_G_Boat_Transport_01_F"]; btc_type_motorized = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F","I_Truck_02_transport_F","I_G_Offroad_01_armed_F","I_Truck_02_covered_F","I_MRAP_03_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F","I_Heli_light_03_F","I_APC_tracked_03_cannon_F"]; btc_type_mg = ["I_HMG_01_F","I_HMG_01_high_F"]; btc_type_gl = ["I_GMG_01_F","I_GMG_01_high_F"]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf index cb4b8be90..6dee25654 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf @@ -21,7 +21,14 @@ _radius = (_radius_x+_radius_y)/2; if (!_is_init) then { private ["_ratio_ied","_ratio"]; - _ratio = (switch _type do {case "Hill" : {random 1};case "NameLocal" : {random 2.5};case "NameVillage" : {random 3.5};case "NameCity" : {random 5};case "NameCityCapital" : {random 6};}); + _ratio = (switch _type do { + case "Hill" : {random 1}; + case "NameLocal" : {random 2.5}; + case "NameVillage" : {random 3.5}; + case "NameCity" : {random 5}; + case "NameCityCapital" : {random 6}; + case "NameMarine" : {0}; + }); _ratio_ied = _ratio; if (_has_en) then {_ratio_ied = _ratio_ied * 1.5;} else {_ratio_ied = _ratio_ied * 0.75;}; if (_has_ho) then {_ratio_ied = _ratio_ied * 2;}; @@ -29,9 +36,9 @@ if (!_is_init) then { diag_log format ["_ratio_ied %1 - p %2",_ratio_ied,_ratio_ied * btc_p_ied]; _ratio_ied = _ratio_ied * btc_p_ied; if (_ratio_ied > 0) then {[_city,_radius,((_ratio_ied/ 2) + (random _ratio_ied))] call btc_fnc_ied_init_area}; - + _ieds = _city getVariable ["ieds",[]]; - + _city setVariable ["initialized",true]; }; @@ -43,7 +50,14 @@ if (count _data_units > 0) then { } else { private ["_ratio"]; //spawn bad guys "NameVillage","NameCity","NameCityCapital","NameLocal" - _ratio = (switch _type do {case "Hill" : {0.6};case "NameLocal" : {0.75};case "NameVillage" : {1};case "NameCity" : {2};case "NameCityCapital" : {4}; default {0.1};}); + _ratio = (switch _type do { + case "Hill" : {0.6}; + case "NameLocal" : {0.75}; + case "NameVillage" : {1}; + case "NameCity" : {2}; + case "NameCityCapital" : {4}; + default {0.1}; + }); if (_has_en) then { private ["_groups","_n","_trigger"]; @@ -53,16 +67,16 @@ if (count _data_units > 0) then { //hint ("SPAWNING" + str(_groups) + " ---- " + str(_n)); //for "_i" from 1 to (_groups) do {[_city,_radius,(random _ratio),(random 1)] spawn btc_fnc_mil_create_group;sleep 0.5;}; for "_i" from 1 to (_groups) do {[_city,_radius,(random _ratio),(random 1)] call btc_fnc_mil_create_group;}; - + _trigger = createTrigger["EmptyDetector",getPos _city]; _trigger setTriggerArea[(_radius_x+_radius_y),(_radius_x+_radius_y),0,false]; _trigger setTriggerActivation[str(btc_enemy_side),"NOT PRESENT",false]; _trigger setTriggerStatements ["this", format ["[%1] spawn btc_fnc_city_set_clear",(_this select 0)], ""]; _city setVariable ["trigger",_trigger]; - + }; //spawn mini task (ammo cache, ieds, injured civ) - + //spawn civilians if (_type != "Hill") then { private ["_factor","_n"]; @@ -104,7 +118,7 @@ if (_has_ho && {!(_city getVariable ["ho_units_spawned",false])}) then { private ["_statics"]; _statics = btc_type_gl + btc_type_mg; [[(_pos select 0) + 7,(_pos select 1) + 7,0],_statics,45] call btc_fnc_mil_create_static; - [[(_pos select 0) - 7,(_pos select 1) - 7,0],_statics,225] call btc_fnc_mil_create_static; + [[(_pos select 0) - 7,(_pos select 1) - 7,0],_statics,225] call btc_fnc_mil_create_static; }; }; }; @@ -146,7 +160,7 @@ if (btc_civ_veh_active < btc_civ_max_veh) then { if (btc_debug_log) then {diag_log format ["btc_fnc_city_activate: (traffic) _n = %1 _av %2 _d %3 _r %4",_n,_av,_d,_r];}; }; -//Suicider +//Suicider _city = btc_city_all select (_this select 0); if !(_city getVariable ["has_suicider",false]) then { if ((time - btc_ied_suic_spawned) > btc_ied_suic_time && {random 1000 > btc_global_reputation}) then { diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/init.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/init.sqf index 4eae1cb85..c2cfddbe4 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/init.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/init.sqf @@ -3,7 +3,7 @@ private ["_locations","_cities"]; _locations = configfile >> "cfgworlds" >> worldname >> "names"; -_cities = ["NameVillage","NameCity","NameCityCapital","NameLocal","Hill"];// +_cities = ["NameVillage","NameCity","NameCityCapital","NameLocal","Hill","NameMarine"];// btc_city_all = []; for "_i" from 0 to (count _locations - 1) do { private ["_current","_type"]; @@ -17,14 +17,14 @@ for "_i" from 0 to (count _locations - 1) do { _name = getText(_current >> "name"); _radius_x = getNumber(_current >> "RadiusA"); _radius_y = getNumber(_current >> "RadiusB"); - + if (btc_city_blacklist find _name >= 0) exitWith {}; - + /* //if you want a safe area if (_position distance getMarkerPos "YOUR_MARKER_AREA" < 500) exitWith {}; */ - + _city = "Land_Ammobox_rounds_F" createVehicle _position; _city hideObjectGlobal true; _city allowDamage false; @@ -46,7 +46,7 @@ for "_i" from 0 to (count _locations - 1) do { _trigger setTriggerArea[(_radius_x+_radius_y) + btc_city_radius,(_radius_x+_radius_y) + btc_city_radius,0,false]; _trigger setTriggerActivation[str(btc_player_side),"PRESENT",true]; _trigger setTriggerStatements ["this && !btc_db_is_saving", format ["[%1] spawn btc_fnc_city_activate",_id], format ["[%1] spawn btc_fnc_city_de_activate",_id]]; - + if (btc_debug) then {//_debug private ["_marker"]; _marker = createmarker [format ["loc_%1",_id],_position]; @@ -56,7 +56,7 @@ for "_i" from 0 to (count _locations - 1) do { _marker setMarkerAlpha 0.3; //_marker setmarkertype "mil_dot"; if (_has_en) then {_marker setmarkercolor "colorRed";} else {_marker setmarkercolor "colorGreen";}; - //_marker setmarkeralpha 0.5; + //_marker setmarkeralpha 0.5; _marke = createmarker [format ["locn_%1",_id],_position]; _marke setmarkertype "mil_dot"; _marke setmarkertext format ["loc_%3 %1 %2 - [%4]",_name,_type,_id,_has_en]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index 4fbd2d2aa..deb5667c5 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -4,6 +4,8 @@ private ["_city","_area","_cities","_useful","_unit_type","_veh_type","_group"," _city = _this select 0; _area = _this select 1; +_type = _city getVariable ["type",""]; + btc_civ_veh_active = btc_civ_veh_active + 1; if (isNil "btc_traffic_id") then {btc_traffic_id = 0;}; @@ -25,7 +27,13 @@ if (count _useful == 0) then { _pos = _useful select (floor random count _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))); + +if !(_type == "NameMarine") then { + _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); + } else { + _veh_type = btc_civ_type_boat select (floor (random (count btc_civ_type_boat))); + }; + _group = createGroup civilian; _group setVariable ["no_cache",true]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf index a8685396c..d6b5e3987 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf @@ -5,6 +5,8 @@ _random = _this select 0;//0 random, 1 inf, 2 moto, 3 heli _city = _this select 1; _area = _this select 2; +_type = _city getVariable ["type",""]; + if (isNil "btc_patrol_id") then {btc_patrol_id = 0;}; btc_patrol_active = btc_patrol_active + 1; @@ -56,11 +58,16 @@ switch (true) do { _group createUnit [_unit_type, _pos, [], 0, "NONE"]; sleep 0.1; }; - _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; + _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; }; case (_random == 2) : { private ["_veh_type","_newZone","_veh","_cargo"]; - _veh_type = btc_type_motorized select (floor (random (count btc_type_motorized))); + if !(_type == "NameMarine") then { + _veh_type = btc_type_motorized select (floor (random (count btc_type_motorized))); + } else { + _veh_type = btc_type_boat select (floor (random (count btc_type_boat))); + }; + _newZone = []; if (count (_pos nearRoads 150) > 0) then {_newZone = getPos ((_pos nearRoads 150) select 0)} else {_newZone = [_pos, 0, 500, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;}; _veh = createVehicle [_veh_type, _newZone, [], 0, "NONE"]; @@ -73,7 +80,7 @@ switch (true) do { _unit_type createUnit [_pos, _group, "this moveinCargo _veh;this assignAsCargo _veh;"]; }; }; - _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; + _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; }; }; From 7c3fbd394519567ba9bf1e571bfb5f9a18846237 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sun, 6 Dec 2015 11:11:13 +0100 Subject: [PATCH 02/12] select boat or car depending on surface select boat or car before spawn depending on surface --- .../core/fnc/civ/traffic_create.sqf | 24 ++++++++++--------- .../core/fnc/common/randomize_pos.sqf | 11 ++++++--- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index deb5667c5..d9b6005e2 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -4,8 +4,6 @@ private ["_city","_area","_cities","_useful","_unit_type","_veh_type","_group"," _city = _this select 0; _area = _this select 1; -_type = _city getVariable ["type",""]; - btc_civ_veh_active = btc_civ_veh_active + 1; if (isNil "btc_traffic_id") then {btc_traffic_id = 0;}; @@ -19,7 +17,7 @@ _useful = []; if (count _useful == 0) then { while {count _useful == 0} do { private "_pos"; - _pos = [getPos _city, _area] call btc_fnc_randomize_pos; + _pos = [getPos _city, _area,true] call btc_fnc_randomize_pos; if ({_x distance _pos < 500} count playableUnits == 0) then {_useful = _useful + [_pos];}; }; }; @@ -28,13 +26,6 @@ _pos = _useful select (floor random count _useful); _unit_type = btc_civ_type_units select (floor random count btc_civ_type_units); -if !(_type == "NameMarine") then { - _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); - } else { - _veh_type = btc_civ_type_boat select (floor (random (count btc_civ_type_boat))); - }; - - _group = createGroup civilian; _group setVariable ["no_cache",true]; _group setVariable ["btc_patrol",true]; @@ -42,7 +33,18 @@ _group setVariable ["btc_traffic_id",btc_traffic_id];btc_traffic_id = btc_traffi _group setVariable ["city",_city]; _Spos = []; -if (count (_pos nearRoads 500) > 0) then {_Spos = getPos ((_pos nearRoads 500) select 0)} else {_Spos = [_pos, 0, 500, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;}; +if (count (_pos nearRoads 500) > 0) then { + _Spos = getPos ((_pos nearRoads 500) select 0) +} else { + _Spos = [_pos, 0, 500, 13, 1, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; +}; + +if !(surfaceIsWater _Spos) then { + _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); +} else { + _veh_type = btc_civ_type_boat select (floor (random (count btc_civ_type_boat))); +}; + _veh = createVehicle [_veh_type, _Spos, [], 0, "NONE"]; _unit_type createUnit [_pos, _group, "this moveinDriver _veh;this assignAsDriver _veh;"]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf index 3c55713af..ca37cc8a8 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf @@ -1,8 +1,13 @@ -private ["_pos","_random_area","_return_pos","_pos_x","_pos_y","_check_pos"]; +private ["_pos","_random_area","_return_pos","_pos_x","_pos_y","_check_pos","_allowwater"]; _pos = _this select 0; _random_area = _this select 1; +if (count _this > 1) then { + _allowwater = _this select 2; + } else { + _allowwater = false; + }; _return_pos = _pos; @@ -14,11 +19,11 @@ _pos_y = _pos_y + ((random _random_area) - (random _random_area)); _check_pos = [_pos_x, _pos_y, 0]; -if (surfaceIsWater _check_pos) then { +if ((surfaceIsWater _check_pos) && !(_allowwater)) then { _return_pos = [_check_pos, 0, _random_area, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; _pos_x = _return_pos select 0; _pos_y = _return_pos select 1; _return_pos = [_pos_x, _pos_y, 0]; } else {_return_pos = _check_pos;}; -_return_pos \ No newline at end of file +_return_pos \ No newline at end of file From a0b1269adaa335e8d2eddeb394a2522012bf94e7 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Fri, 11 Dec 2015 00:43:45 +0100 Subject: [PATCH 03/12] traffic civ with boat --- .../core/fnc/civ/traffic_add_WP.sqf | 15 +++++++++++++-- .../core/fnc/civ/traffic_create.sqf | 6 ++++-- .../core/fnc/common/randomize_pos.sqf | 8 ++++---- .../core/fnc/mil/patrol_create.sqf | 9 +-------- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf index 4f2d04626..75238410e 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf @@ -4,6 +4,7 @@ private ["_group","_city","_area","_players","_cities","_pos"]; _group = _this select 0; _city = _group getVariable ["city",objNull]; _area = _this select 1; +_isWater = _this select 2; _players = if (isMultiplayer) then {playableUnits} else {switchableUnits}; @@ -15,7 +16,17 @@ if ({_x distance _city < (_area/2) || _x distance leader _group < (_area/2)} cou }; _cities = []; -{if (_x distance _city < _area) then {_cities = _cities + [_x];};} foreach btc_city_all; +{if (_x distance _city < _area) then { + if (_isWater) then { + if ({_x getVariable ["type",""] == "NameMarine"}) then { + _cities = _cities + [_x]; + }; + } else { + if ({_x getVariable ["type",""] != "NameMarine"}) then { + _cities = _cities + [_x]; + }; + }; +};} foreach btc_city_all; _pos = []; if (count _cities == 0) then {_pos = getPos _city;} else { _pos = getPos (_cities select (floor random count _cities)); @@ -26,7 +37,7 @@ private ["_wp","_wp_1"]; while {(count (waypoints _group)) > 0} do { deleteWaypoint ((waypoints _group) select 0); }; - + if ((vehicle leader _group) isKindOf "Air" || (vehicle leader _group) isKindOf "LandVehicle") then {(vehicle leader _group) setFuel 1;}; _group setBehaviour "SAFE"; _wp = _group addWaypoint [_pos, 0]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index d9b6005e2..d79c8c7f2 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -41,8 +41,10 @@ if (count (_pos nearRoads 500) > 0) then { if !(surfaceIsWater _Spos) then { _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); + _isWater = true; } else { - _veh_type = btc_civ_type_boat select (floor (random (count btc_civ_type_boat))); + _veh_type = btc_civ_type_boat select (floor (random (count btc_civ_type_boat))); + _isWater = false; }; _veh = createVehicle [_veh_type, _Spos, [], 0, "NONE"]; @@ -59,4 +61,4 @@ _veh setVariable ["driver", leader _group]; {_x call btc_fnc_civ_unit_create;_x setVariable ["traffic",_veh];} foreach units _group; -[_group,_area] call btc_fnc_civ_traffic_add_WP; \ No newline at end of file +[_group,_area,_isWater] call btc_fnc_civ_traffic_add_WP; \ No newline at end of file diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf index ca37cc8a8..1a42f638b 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf @@ -3,11 +3,11 @@ private ["_pos","_random_area","_return_pos","_pos_x","_pos_y","_check_pos","_al _pos = _this select 0; _random_area = _this select 1; -if (count _this > 1) then { +if (count _this > 2) then { _allowwater = _this select 2; - } else { - _allowwater = false; - }; +} else { + _allowwater = false; +}; _return_pos = _pos; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf index d6b5e3987..2fd1d542e 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf @@ -5,8 +5,6 @@ _random = _this select 0;//0 random, 1 inf, 2 moto, 3 heli _city = _this select 1; _area = _this select 2; -_type = _city getVariable ["type",""]; - if (isNil "btc_patrol_id") then {btc_patrol_id = 0;}; btc_patrol_active = btc_patrol_active + 1; @@ -62,12 +60,7 @@ switch (true) do { }; case (_random == 2) : { private ["_veh_type","_newZone","_veh","_cargo"]; - if !(_type == "NameMarine") then { - _veh_type = btc_type_motorized select (floor (random (count btc_type_motorized))); - } else { - _veh_type = btc_type_boat select (floor (random (count btc_type_boat))); - }; - + _veh_type = btc_type_motorized select (floor (random (count btc_type_motorized))); _newZone = []; if (count (_pos nearRoads 150) > 0) then {_newZone = getPos ((_pos nearRoads 150) select 0)} else {_newZone = [_pos, 0, 500, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;}; _veh = createVehicle [_veh_type, _newZone, [], 0, "NONE"]; From 7c35eefd9cf9fa1bdb6a7334d4ce51a9279412f3 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 12 Dec 2015 13:29:09 +0100 Subject: [PATCH 04/12] Reset --- .../core/def/mission.sqf | 13 +++-- .../core/def/param.hpp | 16 +++++- .../core/fnc/city/activate.sqf | 32 ++++-------- .../core/fnc/civ/traffic_add_WP.sqf | 15 +----- .../core/fnc/civ/traffic_create.sqf | 20 ++----- .../core/fnc/common/randomize_pos.sqf | 11 ++-- .../core/fnc/common/road_direction.sqf | 9 ++++ .../core/fnc/common/set_damage.sqf | 48 +++++++++++++++++ .../core/fnc/compile.sqf | 4 +- .../core/fnc/eh/CuratorObjectPlaced.sqf | 4 +- .../core/fnc/eh/veh_add_respawn.sqf | 2 +- .../core/fnc/eh/veh_respawn.sqf | 4 +- .../core/fnc/fob/redeploy.sqf | 12 +++-- .../core/fnc/mil/patrol_create.sqf | 4 +- .../core/fnc/side/checkpoint.sqf | 21 +++----- .../core/fnc/side/civtreatment.sqf | 52 ++----------------- .../core/fnc/side/tower.sqf | 9 ++-- .../core/init_server.sqf | 2 +- 18 files changed, 136 insertions(+), 142 deletions(-) create mode 100644 =BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/road_direction.sqf create mode 100644 =BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/set_damage.sqf diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf index da00463f8..9650cd277 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -27,7 +27,9 @@ _p_skill = [ btc_p_debug = (paramsArray select 20); btc_p_engineer = (paramsArray select 21); _p_db = if ((paramsArray select 22) isEqualTo 0) then {false} else {true}; -ace_medical_maxReviveTime = paramsArray select 23; +ace_medical_level = paramsArray select 23; +ace_medical_enableAdvancedWounds = paramsArray select 24; +ace_medical_maxReviveTime = paramsArray select 25; //btc_acre_mod = isClass(configFile >> "cfgPatches" >> "acre_main"); //btc_tfr_mod = isClass(configFile >> "cfgPatches" >> "task_force_radio"); @@ -114,6 +116,13 @@ if (isServer) then { btc_side_list = [0,1,2,3,4,5,6]; btc_side_list_use = + btc_side_list; btc_side_jip_data = []; + btc_type_tower = ["Land_Communication_F","Land_TTowerBig_1_F","Land_TTowerBig_2_F"]; + btc_type_phone = ["Land_PortableLongRangeRadio_F","Land_MobilePhone_smart_F","Land_MobilePhone_old_F"]; + btc_type_barrel = ["Land_GarbageBarrel_01_F","Land_BarrelSand_grey_F","MetalBarrel_burning_F","Land_BarrelWater_F","Land_MetalBarrel_F","Land_MetalBarrel_empty_F"]; + btc_type_canister = ["Land_CanisterPlastic_F"]; + btc_type_pallet = ["Land_Pallets_stack_F","Land_Pallets_F","Land_Pallet_F"]; + btc_type_box = ["Box_East_Wps_F","Box_East_WpsSpecial_F","Box_East_Ammo_F"]; + //Vehs btc_vehicles = [btc_veh_1,btc_veh_2,btc_veh_3,btc_veh_4,btc_veh_5,btc_veh_6,btc_veh_7,btc_veh_8,btc_veh_9,btc_veh_10,btc_veh_11,btc_veh_12,btc_veh_13,btc_veh_14]; @@ -125,7 +134,6 @@ btc_city_type = "Land_Ammobox_rounds_F"; //Civ btc_civ_type_units = ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F"]; btc_civ_type_veh = ["C_Hatchback_01_F","C_SUV_01_F","C_Offroad_01_F","C_Van_01_transport_F","C_Van_01_box_F"]; -btc_civ_type_boat = ["C_Rubberboat","C_Boat_Civil_01_F"," C_Boat_Civil_01_rescue_F"," C_Boat_Civil_01_police_F"]; btc_civ_max_veh = 5; btc_w_civs = ["V_Rangemaster_belt","arifle_Mk20_F","30Rnd_556x45_Stanag","hgun_ACPC2_F","9Rnd_45ACP_Mag"]; @@ -381,7 +389,6 @@ switch (true) do { btc_type_units = ["I_Soldier_F","I_Soldier_TL_F","I_Soldier_AR_F","I_engineer_F","I_Soldier_exp_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AT_F","I_Soldier_AA_F","I_Spotter_F","I_Sniper_F"]; btc_type_crewmen = "I_Soldier_F"; btc_type_vehicles = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F","I_MRAP_03_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F"]; - btc_type_boat = ["I_Boat_Armed_01_minigun_F"," I_Boat_Transport_01_F","I_SDV_01_F","I_G_Boat_Transport_01_F"]; btc_type_motorized = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F","I_Truck_02_transport_F","I_G_Offroad_01_armed_F","I_Truck_02_covered_F","I_MRAP_03_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F","I_Heli_light_03_F","I_APC_tracked_03_cannon_F"]; btc_type_mg = ["I_HMG_01_F","I_HMG_01_high_F"]; btc_type_gl = ["I_GMG_01_F","I_GMG_01_high_F"]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/param.hpp b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/param.hpp index cc622ecce..ee544839b 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/param.hpp +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/param.hpp @@ -160,8 +160,22 @@ class Params { texts[]={"No","Yes"}; default = 1; }; + class btc_p_med_level { + //paramsArray[23] + title = "Medical Level"; + values[] = {1,2}; + texts[] = {"Basic","Advanced"}; + default = 1; + }; + class btc_p_adv_wounds { + //paramsArray[24] + title = "Advanced Wounds"; + values[] = {0,1}; + texts[] = {"Off","On"}; + default = 1; + }; class btc_p_rev { - //paramsArray[23] + //paramsArray[25] title = "Revive time:"; values[]={0,60,120,180,240,300,600,900,1200,999999}; texts[]={"0","60","120","180","240","300","600","900","1200","999999"}; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf index 6dee25654..cb4b8be90 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf @@ -21,14 +21,7 @@ _radius = (_radius_x+_radius_y)/2; if (!_is_init) then { private ["_ratio_ied","_ratio"]; - _ratio = (switch _type do { - case "Hill" : {random 1}; - case "NameLocal" : {random 2.5}; - case "NameVillage" : {random 3.5}; - case "NameCity" : {random 5}; - case "NameCityCapital" : {random 6}; - case "NameMarine" : {0}; - }); + _ratio = (switch _type do {case "Hill" : {random 1};case "NameLocal" : {random 2.5};case "NameVillage" : {random 3.5};case "NameCity" : {random 5};case "NameCityCapital" : {random 6};}); _ratio_ied = _ratio; if (_has_en) then {_ratio_ied = _ratio_ied * 1.5;} else {_ratio_ied = _ratio_ied * 0.75;}; if (_has_ho) then {_ratio_ied = _ratio_ied * 2;}; @@ -36,9 +29,9 @@ if (!_is_init) then { diag_log format ["_ratio_ied %1 - p %2",_ratio_ied,_ratio_ied * btc_p_ied]; _ratio_ied = _ratio_ied * btc_p_ied; if (_ratio_ied > 0) then {[_city,_radius,((_ratio_ied/ 2) + (random _ratio_ied))] call btc_fnc_ied_init_area}; - + _ieds = _city getVariable ["ieds",[]]; - + _city setVariable ["initialized",true]; }; @@ -50,14 +43,7 @@ if (count _data_units > 0) then { } else { private ["_ratio"]; //spawn bad guys "NameVillage","NameCity","NameCityCapital","NameLocal" - _ratio = (switch _type do { - case "Hill" : {0.6}; - case "NameLocal" : {0.75}; - case "NameVillage" : {1}; - case "NameCity" : {2}; - case "NameCityCapital" : {4}; - default {0.1}; - }); + _ratio = (switch _type do {case "Hill" : {0.6};case "NameLocal" : {0.75};case "NameVillage" : {1};case "NameCity" : {2};case "NameCityCapital" : {4}; default {0.1};}); if (_has_en) then { private ["_groups","_n","_trigger"]; @@ -67,16 +53,16 @@ if (count _data_units > 0) then { //hint ("SPAWNING" + str(_groups) + " ---- " + str(_n)); //for "_i" from 1 to (_groups) do {[_city,_radius,(random _ratio),(random 1)] spawn btc_fnc_mil_create_group;sleep 0.5;}; for "_i" from 1 to (_groups) do {[_city,_radius,(random _ratio),(random 1)] call btc_fnc_mil_create_group;}; - + _trigger = createTrigger["EmptyDetector",getPos _city]; _trigger setTriggerArea[(_radius_x+_radius_y),(_radius_x+_radius_y),0,false]; _trigger setTriggerActivation[str(btc_enemy_side),"NOT PRESENT",false]; _trigger setTriggerStatements ["this", format ["[%1] spawn btc_fnc_city_set_clear",(_this select 0)], ""]; _city setVariable ["trigger",_trigger]; - + }; //spawn mini task (ammo cache, ieds, injured civ) - + //spawn civilians if (_type != "Hill") then { private ["_factor","_n"]; @@ -118,7 +104,7 @@ if (_has_ho && {!(_city getVariable ["ho_units_spawned",false])}) then { private ["_statics"]; _statics = btc_type_gl + btc_type_mg; [[(_pos select 0) + 7,(_pos select 1) + 7,0],_statics,45] call btc_fnc_mil_create_static; - [[(_pos select 0) - 7,(_pos select 1) - 7,0],_statics,225] call btc_fnc_mil_create_static; + [[(_pos select 0) - 7,(_pos select 1) - 7,0],_statics,225] call btc_fnc_mil_create_static; }; }; }; @@ -160,7 +146,7 @@ if (btc_civ_veh_active < btc_civ_max_veh) then { if (btc_debug_log) then {diag_log format ["btc_fnc_city_activate: (traffic) _n = %1 _av %2 _d %3 _r %4",_n,_av,_d,_r];}; }; -//Suicider +//Suicider _city = btc_city_all select (_this select 0); if !(_city getVariable ["has_suicider",false]) then { if ((time - btc_ied_suic_spawned) > btc_ied_suic_time && {random 1000 > btc_global_reputation}) then { diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf index 75238410e..4f2d04626 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf @@ -4,7 +4,6 @@ private ["_group","_city","_area","_players","_cities","_pos"]; _group = _this select 0; _city = _group getVariable ["city",objNull]; _area = _this select 1; -_isWater = _this select 2; _players = if (isMultiplayer) then {playableUnits} else {switchableUnits}; @@ -16,17 +15,7 @@ if ({_x distance _city < (_area/2) || _x distance leader _group < (_area/2)} cou }; _cities = []; -{if (_x distance _city < _area) then { - if (_isWater) then { - if ({_x getVariable ["type",""] == "NameMarine"}) then { - _cities = _cities + [_x]; - }; - } else { - if ({_x getVariable ["type",""] != "NameMarine"}) then { - _cities = _cities + [_x]; - }; - }; -};} foreach btc_city_all; +{if (_x distance _city < _area) then {_cities = _cities + [_x];};} foreach btc_city_all; _pos = []; if (count _cities == 0) then {_pos = getPos _city;} else { _pos = getPos (_cities select (floor random count _cities)); @@ -37,7 +26,7 @@ private ["_wp","_wp_1"]; while {(count (waypoints _group)) > 0} do { deleteWaypoint ((waypoints _group) select 0); }; - + if ((vehicle leader _group) isKindOf "Air" || (vehicle leader _group) isKindOf "LandVehicle") then {(vehicle leader _group) setFuel 1;}; _group setBehaviour "SAFE"; _wp = _group addWaypoint [_pos, 0]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index d79c8c7f2..4fbd2d2aa 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -17,7 +17,7 @@ _useful = []; if (count _useful == 0) then { while {count _useful == 0} do { private "_pos"; - _pos = [getPos _city, _area,true] call btc_fnc_randomize_pos; + _pos = [getPos _city, _area] call btc_fnc_randomize_pos; if ({_x distance _pos < 500} count playableUnits == 0) then {_useful = _useful + [_pos];}; }; }; @@ -25,6 +25,7 @@ if (count _useful == 0) then { _pos = _useful select (floor random count _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))); _group = createGroup civilian; _group setVariable ["no_cache",true]; @@ -33,20 +34,7 @@ _group setVariable ["btc_traffic_id",btc_traffic_id];btc_traffic_id = btc_traffi _group setVariable ["city",_city]; _Spos = []; -if (count (_pos nearRoads 500) > 0) then { - _Spos = getPos ((_pos nearRoads 500) select 0) -} else { - _Spos = [_pos, 0, 500, 13, 1, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; -}; - -if !(surfaceIsWater _Spos) then { - _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); - _isWater = true; -} else { - _veh_type = btc_civ_type_boat select (floor (random (count btc_civ_type_boat))); - _isWater = false; -}; - +if (count (_pos nearRoads 500) > 0) then {_Spos = getPos ((_pos nearRoads 500) select 0)} else {_Spos = [_pos, 0, 500, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;}; _veh = createVehicle [_veh_type, _Spos, [], 0, "NONE"]; _unit_type createUnit [_pos, _group, "this moveinDriver _veh;this assignAsDriver _veh;"]; @@ -61,4 +49,4 @@ _veh setVariable ["driver", leader _group]; {_x call btc_fnc_civ_unit_create;_x setVariable ["traffic",_veh];} foreach units _group; -[_group,_area,_isWater] call btc_fnc_civ_traffic_add_WP; \ No newline at end of file +[_group,_area] call btc_fnc_civ_traffic_add_WP; \ No newline at end of file diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf index 1a42f638b..3c55713af 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf @@ -1,13 +1,8 @@ -private ["_pos","_random_area","_return_pos","_pos_x","_pos_y","_check_pos","_allowwater"]; +private ["_pos","_random_area","_return_pos","_pos_x","_pos_y","_check_pos"]; _pos = _this select 0; _random_area = _this select 1; -if (count _this > 2) then { - _allowwater = _this select 2; -} else { - _allowwater = false; -}; _return_pos = _pos; @@ -19,11 +14,11 @@ _pos_y = _pos_y + ((random _random_area) - (random _random_area)); _check_pos = [_pos_x, _pos_y, 0]; -if ((surfaceIsWater _check_pos) && !(_allowwater)) then { +if (surfaceIsWater _check_pos) then { _return_pos = [_check_pos, 0, _random_area, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; _pos_x = _return_pos select 0; _pos_y = _return_pos select 1; _return_pos = [_pos_x, _pos_y, 0]; } else {_return_pos = _check_pos;}; -_return_pos \ No newline at end of file +_return_pos \ No newline at end of file diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/road_direction.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/road_direction.sqf new file mode 100644 index 000000000..f1c6314f8 --- /dev/null +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/road_direction.sqf @@ -0,0 +1,9 @@ + +private ["_road","_roadConnectedTo","_connectedRoad","_direction"]; + +_road = _this select 0; +_roadConnectedTo = roadsConnectedTo _road; +_connectedRoad = _roadConnectedTo select 0; +_direction = [_road, _connectedRoad] call BIS_fnc_dirTo; + +_direction \ No newline at end of file diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/set_damage.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/set_damage.sqf new file mode 100644 index 000000000..ed5825a7e --- /dev/null +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/set_damage.sqf @@ -0,0 +1,48 @@ +/* +Author: SENSEI +Last modified: 10/3/2015 +Description: set unit in cardiac arrest +Note: needs delay if called directly after spawning unit +Return: nothing +__________________________________________________________________*/ + +private ["_unit","_unconsciousTime","_selection","_type"]; + +_unit = _this select 0; +_selection = [ + "head", + "body", + "hand_l", + "hand_r", + "leg_l", + "leg_r" +]; +_type = [ + "bullet", + "grenade", + "explosive", + "shell" +]; +if (ace_medical_level isEqualTo 1) then { + _unconsciousTime = 120 + round (random 600); + [_unit,true,_unconsciousTime,true] call ace_medical_fnc_setUnconscious; + for "_i" from 0 to 2 do { + [_unit, (_selection select (random ((count _selection) - 1))), 0.7 + (random 0.15), objNull, (_type select (random ((count _type) - 1)))] call ace_medical_fnc_handleDamage; + }; + [{ + params ["_args","_id"]; + _args params ["_unit","_time"]; + + if (diag_tickTime > _time) exitWith { + [_id] call CBA_fnc_removePerFrameHandler; + if !([_unit] call ace_common_fnc_isAwake) then { + _unit setDamage 1; + }; + }; + }, 1, [_unit,diag_tickTime + _unconsciousTime]] call CBA_fnc_addPerFrameHandler; +} else { + [_unit, 0.5] call ace_medical_fnc_adjustPainLevel; + [_unit,true,10,true] call ace_medical_fnc_setUnconscious; + [_unit] call ace_medical_fnc_setCardiacArrest; + [_unit, (_selection select (random ((count _selection) - 1))), 0, objNull, (_type select (random ((count _type) - 1))), 0, 0.2] call ace_medical_fnc_handleDamage_advanced; +}; \ No newline at end of file diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/compile.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/compile.sqf index 0161392a0..6a2d05331 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/compile.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/compile.sqf @@ -14,6 +14,8 @@ if (isServer) then { btc_fnc_randomize_pos = compile preprocessFile "core\fnc\common\randomize_pos.sqf"; btc_fnc_set_owner = compile preprocessFile "core\fnc\common\set_owner.sqf"; btc_fnc_task_patrol = compile preprocessFile "core\fnc\common\task_patrol.sqf"; + btc_fnc_set_damage = compile preprocessFile "core\fnc\common\set_damage.sqf"; + btc_fnc_road_direction = compile preprocessFile "core\fnc\common\road_direction.sqf"; //CITY btc_fnc_city_activate = compile preprocessFile "core\fnc\city\activate.sqf"; @@ -43,7 +45,6 @@ if (isServer) then { //EH //btc_fnc_eh_helo_respawn = compile preprocessFile "core\fnc\eh\helo_respawn.sqf"; - btc_fnc_eh_CuratorObjectPlaced = compile preprocessFile "core\fnc\eh\CuratorObjectPlaced"; btc_fnc_eh_veh_add_respawn = compile preprocessFile "core\fnc\eh\veh_add_respawn.sqf"; btc_fnc_eh_veh_killed = compile preprocessFile "core\fnc\eh\veh_killed.sqf"; btc_fnc_eh_veh_respawn = compile preprocessFile "core\fnc\eh\veh_respawn.sqf"; @@ -112,6 +113,7 @@ btc_fnc_db_add_veh = compile preprocessFile "core\fnc\db\add_veh.sqf"; //EH btc_fnc_eh_unit_init = compile preprocessFile "core\fnc\eh\unit_init.sqf"; +btc_fnc_eh_CuratorObjectPlaced = compile preprocessFile "core\fnc\eh\CuratorObjectPlaced.sqf"; //INT btc_fnc_int_change_var = compile preprocessFile "core\fnc\int\change_var.sqf"; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/CuratorObjectPlaced.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/CuratorObjectPlaced.sqf index 2babfcb1e..4441fc796 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/CuratorObjectPlaced.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/CuratorObjectPlaced.sqf @@ -1,7 +1,7 @@ /* curator,object */ - +/* diag_log format ["CURATOR OBJECT %1",_this]; -hint str(_this); \ No newline at end of file +hint str(_this);*/ \ No newline at end of file diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/veh_add_respawn.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/veh_add_respawn.sqf index 3aa7d9d5b..232efc906 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/veh_add_respawn.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/veh_add_respawn.sqf @@ -10,7 +10,7 @@ _pos = getPos _vehicle; _dir = getDir _vehicle; _vehicle setVariable ["data_respawn",[_type,_pos,_dir,_time,_has_marker]]; -_vehicle addEventHandler ["Killed", {_this call btc_fnc_eh_veh_respawn}]; +_vehicle addMPEventHandler ["MPKilled", {if (isServer) then {_this call btc_fnc_eh_veh_respawn};}]; /* waitUntil {sleep 10; (!Alive _vehicle)}; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/veh_respawn.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/veh_respawn.sqf index 6c7a45cb9..777b7ac06 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/veh_respawn.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/eh/veh_respawn.sqf @@ -8,9 +8,11 @@ _vehicle spawn {sleep 30;deleteVehicle _this;}; _data spawn { private ["_veh"]; - sleep (_this select 3); + _time = (_this select 3); + sleep _time; _veh = (_this select 0) createVehicle (_this select 1); _veh setDir (_this select 2); _veh setPos (_this select 1); + [_veh,_time,(_this select 4)] spawn btc_fnc_eh_veh_add_respawn; if (_this select 4) then {_veh spawn btc_fnc_veh_track_marker;}; }; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/fob/redeploy.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/fob/redeploy.sqf index 67c8c1416..30c306a4a 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/fob/redeploy.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/fob/redeploy.sqf @@ -1,6 +1,8 @@ /* mapAnimAdd [1, 0.2, [0,0]]; mapAnimCommit;*/ +private ["_fobs","_idc","_fob","_marker","_pos","_text"]; + closeDialog 0; btc_int_ask_data = nil; @@ -23,14 +25,18 @@ waitUntil {dialog}; _idc = 778; -{_index = lbAdd [ _idc, _x ];} foreach _fobs; +{lbAdd [ _idc, _x ];} foreach _fobs; lbSetCurSel [_idc, 0]; - +/* while {!btc_fob_dlg} do { if !(dialog) then {hint "Do not close the dialog with esc";createDialog "btc_fob_redeploy";{_index = lbAdd [ _idc, _x ];} foreach _fobs;lbSetCurSel [_idc, 0];}; sleep 0.1; -}; +};*/ + +waitUntil {!dialog}; + +if (!btc_fob_dlg) exitWith {forceMap false;}; _fob = lbText [_idc, lbCurSel _idc]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf index 2fd1d542e..a8685396c 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf @@ -56,7 +56,7 @@ switch (true) do { _group createUnit [_unit_type, _pos, [], 0, "NONE"]; sleep 0.1; }; - _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; + _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; }; case (_random == 2) : { private ["_veh_type","_newZone","_veh","_cargo"]; @@ -73,7 +73,7 @@ switch (true) do { _unit_type createUnit [_pos, _group, "this moveinCargo _veh;this assignAsCargo _veh;"]; }; }; - _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; + _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; }; }; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf index ff601b74f..9ee7d3e43 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf @@ -1,5 +1,5 @@ -private ["_useful","_city","_pos","_road","_roads","_boxes","_marker","_markers","_statics","_tower_type","_tower","_roadConnectedTo","_connectedRoad","_direction","_btc_type_barrel","_btc_type_canister","_btc_type_pallet","_btc_type_box","_type_barrel","_type_canister","_type_pallet","_type_box","_btc_composition_checkpoint"]; +private ["_useful","_city","_pos","_road","_roads","_boxes","_marker","_markers","_statics","_tower_type","_tower","_direction","_type_barrel","_type_canister","_type_pallet","_type_box","_btc_composition_checkpoint"]; //// Choose an occupied City \\\\ _useful = []; @@ -19,10 +19,6 @@ btc_side_jip_data = [9,_pos,_city getVariable "name"]; _city setVariable ["spawn_more",true]; -_btc_type_barrel = ["Land_GarbageBarrel_01_F","Land_BarrelSand_grey_F","MetalBarrel_burning_F","Land_BarrelWater_F","Land_MetalBarrel_F","Land_MetalBarrel_empty_F"]; -_btc_type_canister = ["Land_CanisterPlastic_F"]; -_btc_type_pallet = ["Land_Pallets_stack_F","Land_Pallets_F","Land_Pallet_F"]; -_btc_type_box = ["Box_East_Wps_F","Box_East_WpsSpecial_F","Box_East_Ammo_F"]; _statics = btc_type_gl + btc_type_mg; _boxes = []; @@ -34,9 +30,8 @@ for "_i" from 1 to (1 + round random 2) do { if (count _roads > 0) then {_road = (_roads select (floor random count _roads)); _pos = getPos _road; }; - _roadConnectedTo = roadsConnectedTo _road; - _connectedRoad = _roadConnectedTo select 0; - _direction = [_road, _connectedRoad] call BIS_fnc_dirTo; + + _direction = [_road] call btc_fnc_road_direction; //// Create marker \\\\ _marker = createmarker [format ["sm_2_%1",_pos],_pos]; @@ -47,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 = 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))); _btc_composition_checkpoint = [ [_type_barrel,10,[0.243652,-2.78906,0]], [_type_barrel,20,[-0.131836,3.12939,0]], diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf index 2cbd976e5..e4e2e59a1 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf @@ -1,5 +1,5 @@ -private ["_useful","_veh","_vehpos","_city","_pos","_r","_houses","_roads","_marker","_unit_type","_fx","_btc_civ_type_phone","_item_type","_unconsciousTime","_selection","_type"]; +private ["_useful","_veh","_vehpos","_city","_pos","_r","_houses","_roads","_marker","_unit_type","_fx","_phone_type"]; //// Choose a clear City \\\\ _useful = []; @@ -52,9 +52,8 @@ if ( _r < 1) then { _fx = "test_EmptyObjectForSmoke" createVehicle (getposATL _veh); _fx attachTo [_veh,[0,0,0]]; } else { - _btc_civ_type_phone = ["Land_PortableLongRangeRadio_F","Land_MobilePhone_smart_F","Land_MobilePhone_old_F"]; - _item_type = _btc_civ_type_phone select (floor (random (count _btc_civ_type_phone))); - _veh = createVehicle [_item_type, _vehpos, [], 0, "NONE"]; + _phone_type = btc_type_phone select (floor (random (count btc_type_phone))); + _veh = createVehicle [_phone_type, _vehpos, [], 0, "NONE"]; _veh setDir (random 360); }; @@ -70,51 +69,8 @@ _unit setPosATL _pos; _unit setUnitPos "DOWN"; {_x call btc_fnc_civ_unit_create} foreach units _group; -/* -Author: SENSEI -Last modified: 10/3/2015 -Description: set unit in cardiac arrest -Note: needs delay if called directly after spawning unit -Return: nothing -__________________________________________________________________*/ sleep 1; -_selection = [ - "head", - "body", - "hand_l", - "hand_r", - "leg_l", - "leg_r" -]; -_type = [ - "bullet", - "grenade", - "explosive", - "shell" -]; -if (ace_medical_level isEqualTo 1) then { - _unconsciousTime = 120 + round (random 600); - [_unit,true,_unconsciousTime,true] call ace_medical_fnc_setUnconscious; - for "_i" from 0 to 2 do { - [_unit, (_selection select (random ((count _selection) - 1))), 0.7 + (random 0.15), objNull, (_type select (random ((count _type) - 1)))] call ace_medical_fnc_handleDamage; - }; - [{ - params ["_args","_id"]; - _args params ["_unit","_time"]; - - if (diag_tickTime > _time) exitWith { - [_id] call CBA_fnc_removePerFrameHandler; - if !([_unit] call ace_common_fnc_isAwake) then { - _unit setDamage 1; - }; - }; - }, 1, [_unit,diag_tickTime + _unconsciousTime]] call CBA_fnc_addPerFrameHandler; -} else { - [_unit, 0.5] call ace_medical_fnc_adjustPainLevel; - [_unit,true,10,true] call ace_medical_fnc_setUnconscious; - [_unit] call ace_medical_fnc_setCardiacArrest; - [_unit, (_selection select (random ((count _selection) - 1))), 0, objNull, (_type select (random ((count _type) - 1))), 0, 0.2] call ace_medical_fnc_handleDamage_advanced; -}; +[_unit] call btc_fnc_set_damage; waitUntil {sleep 5; (btc_side_aborted || btc_side_failed || !Alive _unit || {[_unit] call ace_common_fnc_isAwake && ((_unit getVariable ["ace_medical_pain", 0]) < 0.4)})}; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf index 3a21a65b7..347a52298 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf @@ -1,5 +1,5 @@ -private ["_useful","_city","_pos","_road","_roads","_marker","_statics","_tower_type","_tower","_roadConnectedTo","_connectedRoad","_direction"]; +private ["_useful","_city","_pos","_road","_roads","_marker","_statics","_tower_type","_tower","_direction"]; _useful = []; {if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"}) then {_useful = _useful + [_x];};} foreach btc_city_all; @@ -16,9 +16,7 @@ if (count _roads > 0) then {_road = (_roads select (floor random count _roads)); _pos = getPos _road; }; -_roadConnectedTo = roadsConnectedTo _road; -_connectedRoad = _roadConnectedTo select 0; -_direction = [_road, _connectedRoad] call BIS_fnc_dirTo; +_direction = [_road] call btc_fnc_road_direction; btc_side_aborted = false; btc_side_done = false; @@ -43,8 +41,7 @@ _marker setmarkertype "hd_flag"; _marker setmarkertext "Radio Tower"; _marker setMarkerSize [0.6, 0.6]; -_btc_type_tower = ["Land_Communication_F","Land_TTowerBig_1_F","Land_TTowerBig_2_F"]; -_tower_type = _btc_type_tower select (floor (random (count _btc_type_tower))); +_tower_type = btc_type_tower select (floor (random (count btc_type_tower))); _tower = createVehicle [_tower_type, _pos, [], 0, "NONE"]; _tower setDir (_direction); diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/init_server.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/init_server.sqf index fed80a85c..23799a0c5 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/init_server.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/init_server.sqf @@ -7,7 +7,7 @@ if (btc_db_load && {profileNamespace getVariable ["btc_hm_db",false]}) then { [] execVM "core\fnc\cache\init.sqf"; - [] spawn {{waitUntil {!isNull _x};_x addEventHandler ["Killed", {_this call btc_fnc_eh_veh_killed}];} foreach btc_vehicles;}; + [] spawn {{waitUntil {!isNull _x};_x addMPEventHandler ["MPKilled", {if (isServer) then {_this call btc_fnc_eh_veh_killed};}];} foreach btc_vehicles;}; }; [btc_helo_1,30,true] spawn btc_fnc_eh_veh_add_respawn; From 4d1d24dd479aed92a29504874bfeee5fce96f1ce Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 12 Dec 2015 13:48:27 +0100 Subject: [PATCH 05/12] Add NameMarine --- .../core/fnc/city/activate.sqf | 41 ++- =BTC=co@22_Hearts_and_Minds.Altis/mission.sqm | 310 +++++++++--------- 2 files changed, 180 insertions(+), 171 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf index cb4b8be90..56cc2c518 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf @@ -21,7 +21,14 @@ _radius = (_radius_x+_radius_y)/2; if (!_is_init) then { private ["_ratio_ied","_ratio"]; - _ratio = (switch _type do {case "Hill" : {random 1};case "NameLocal" : {random 2.5};case "NameVillage" : {random 3.5};case "NameCity" : {random 5};case "NameCityCapital" : {random 6};}); + _ratio = (switch _type do { + case "Hill" : {random 1}; + case "NameLocal" : {random 2.5}; + case "NameVillage" : {random 3.5}; + case "NameCity" : {random 5}; + case "NameCityCapital" : {random 6}; + case "NameMarine" : {0}; + }); _ratio_ied = _ratio; if (_has_en) then {_ratio_ied = _ratio_ied * 1.5;} else {_ratio_ied = _ratio_ied * 0.75;}; if (_has_ho) then {_ratio_ied = _ratio_ied * 2;}; @@ -29,9 +36,9 @@ if (!_is_init) then { diag_log format ["_ratio_ied %1 - p %2",_ratio_ied,_ratio_ied * btc_p_ied]; _ratio_ied = _ratio_ied * btc_p_ied; if (_ratio_ied > 0) then {[_city,_radius,((_ratio_ied/ 2) + (random _ratio_ied))] call btc_fnc_ied_init_area}; - + _ieds = _city getVariable ["ieds",[]]; - + _city setVariable ["initialized",true]; }; @@ -43,7 +50,15 @@ if (count _data_units > 0) then { } else { private ["_ratio"]; //spawn bad guys "NameVillage","NameCity","NameCityCapital","NameLocal" - _ratio = (switch _type do {case "Hill" : {0.6};case "NameLocal" : {0.75};case "NameVillage" : {1};case "NameCity" : {2};case "NameCityCapital" : {4}; default {0.1};}); + _ratio = (switch _type do { + case "Hill" : {0.6}; + case "NameLocal" : {0.75}; + case "NameVillage" : {1}; + case "NameCity" : {2}; + case "NameCityCapital" : {4}; + case "NameMarine" : {0}; + default {0.1}; + }); if (_has_en) then { private ["_groups","_n","_trigger"]; @@ -53,20 +68,26 @@ if (count _data_units > 0) then { //hint ("SPAWNING" + str(_groups) + " ---- " + str(_n)); //for "_i" from 1 to (_groups) do {[_city,_radius,(random _ratio),(random 1)] spawn btc_fnc_mil_create_group;sleep 0.5;}; for "_i" from 1 to (_groups) do {[_city,_radius,(random _ratio),(random 1)] call btc_fnc_mil_create_group;}; - + _trigger = createTrigger["EmptyDetector",getPos _city]; _trigger setTriggerArea[(_radius_x+_radius_y),(_radius_x+_radius_y),0,false]; _trigger setTriggerActivation[str(btc_enemy_side),"NOT PRESENT",false]; _trigger setTriggerStatements ["this", format ["[%1] spawn btc_fnc_city_set_clear",(_this select 0)], ""]; _city setVariable ["trigger",_trigger]; - + }; //spawn mini task (ammo cache, ieds, injured civ) - + //spawn civilians if (_type != "Hill") then { private ["_factor","_n"]; - _factor = (switch _type do {case "NameLocal" : {0.5};case "NameVillage" : {1.5};case "NameCity" : {3};case "NameCityCapital" : {6}; default {1};}); + _factor = (switch _type do { + case "NameLocal" : {0.5}; + case "NameVillage" : {1.5}; + case "NameCity" : {3}; + case "NameCityCapital" : {6}; + default {1}; + }); _n = 3 * _factor; [_city,(_radius/3),_n] call btc_fnc_civ_populate; }; @@ -104,7 +125,7 @@ if (_has_ho && {!(_city getVariable ["ho_units_spawned",false])}) then { private ["_statics"]; _statics = btc_type_gl + btc_type_mg; [[(_pos select 0) + 7,(_pos select 1) + 7,0],_statics,45] call btc_fnc_mil_create_static; - [[(_pos select 0) - 7,(_pos select 1) - 7,0],_statics,225] call btc_fnc_mil_create_static; + [[(_pos select 0) - 7,(_pos select 1) - 7,0],_statics,225] call btc_fnc_mil_create_static; }; }; }; @@ -146,7 +167,7 @@ if (btc_civ_veh_active < btc_civ_max_veh) then { if (btc_debug_log) then {diag_log format ["btc_fnc_city_activate: (traffic) _n = %1 _av %2 _d %3 _r %4",_n,_av,_d,_r];}; }; -//Suicider +//Suicider _city = btc_city_all select (_this select 0); if !(_city getVariable ["has_suicider",false]) then { if ((time - btc_ied_suic_spawned) > btc_ied_suic_time && {random 1000 > btc_global_reputation}) then { diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/mission.sqm b/=BTC=co@22_Hearts_and_Minds.Altis/mission.sqm index 26b60eed3..2dee08a0b 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/mission.sqm +++ b/=BTC=co@22_Hearts_and_Minds.Altis/mission.sqm @@ -19,14 +19,14 @@ class Mission "RHS_US_A2_AirImport", "rhsusf_c_rg33", "ace_cargo", - "ace_medical", - "3DEN", "a3_modules_f_curator_curator", "ace_respawn", "ace_captives", "ace_repair", "A3_Modules_F_Multiplayer", - "A3_Characters_F_INDEP" + "A3_Characters_F_INDEP", + "ace_advanced_ballistics", + "ace_winddeflection" }; addOnsAuto[]= { @@ -34,13 +34,13 @@ class Mission "a3_characters_f", "A3_Characters_F_OPFOR", "ace_cargo", - "ace_medical", - "3DEN", - "a3_modules_f_curator_curator", + "A3_Modules_F_Curator_Curator", "ace_respawn", "ace_captives", "ace_repair", "A3_Characters_F_INDEP", + "ace_advanced_ballistics", + "ace_winddeflection", "rhsusf_c_hmmwv", "rhsusf_vehicles", "RHS_US_A2Port_Armor", @@ -569,146 +569,6 @@ class Mission }; }; class Item24 - { - side="LOGIC"; - class Vehicles - { - items=1; - class Item0 - { - position[]={8276.8887,58.607044,9963.0215}; - class args - { - items=13; - class Item0 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="level"; - }; - class Item1 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="medicSetting"; - }; - class Item2 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="allowLitterCreation"; - }; - class Item3 - { - value="1800"; - parentCls="ACE_moduleMedicalSettings"; - typeName="litterCleanUpDelay"; - }; - class Item4 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="enableScreams"; - }; - class Item5 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="playerDamageThreshold"; - }; - class Item6 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="AIDamageThreshold"; - }; - class Item7 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="enableUnconsciousnessAI"; - }; - class Item8 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="remoteControlledAI"; - }; - class Item9 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="preventInstaDeath"; - }; - class Item10 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="bleedingCoefficient"; - }; - class Item11 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="painCoefficient"; - }; - class Item12 - { - value="1"; - parentCls="ACE_moduleMedicalSettings"; - typeName="keepLocalSettingsSynced"; - }; - }; - id=24; - side="LOGIC"; - vehicle="ACE_moduleMedicalSettings"; - leader=1; - lock="UNLOCKED"; - skill=0.60000002; - }; - }; - }; - class Item25 - { - side="LOGIC"; - class Vehicles - { - items=1; - class Item0 - { - position[]={8284.0361,57.350582,9962.9541}; - class args - { - items=3; - class Item0 - { - value="1"; - parentCls="ACE_moduleReviveSettings"; - typeName="enableRevive"; - }; - class Item1 - { - value="120"; - parentCls="ACE_moduleReviveSettings"; - typeName="maxReviveTime"; - }; - class Item2 - { - value="-1"; - parentCls="ACE_moduleReviveSettings"; - typeName="amountOfReviveLives"; - }; - }; - id=25; - side="LOGIC"; - vehicle="ACE_moduleReviveSettings"; - leader=1; - lock="UNLOCKED"; - skill=0.60000002; - }; - }; - }; - class Item26 { side="LOGIC"; class Vehicles @@ -745,7 +605,7 @@ class Mission typeName="Forced"; }; }; - id=26; + id=24; side="LOGIC"; vehicle="ModuleCurator_F"; leader=1; @@ -756,7 +616,7 @@ class Mission }; }; }; - class Item27 + class Item25 { side="LOGIC"; class Vehicles @@ -781,7 +641,7 @@ class Mission typeName="RemoveDeadBodiesDisconnected"; }; }; - id=27; + id=25; side="LOGIC"; vehicle="ACE_ModuleRespawn"; leader=1; @@ -790,7 +650,7 @@ class Mission }; }; }; - class Item28 + class Item26 { side="LOGIC"; class Vehicles @@ -821,7 +681,7 @@ class Mission typeName="requireSurrender"; }; }; - id=28; + id=26; side="LOGIC"; vehicle="ace_captives_moduleSettings"; leader=1; @@ -830,7 +690,7 @@ class Mission }; }; }; - class Item29 + class Item27 { side="LOGIC"; class Vehicles @@ -855,7 +715,7 @@ class Mission typeName="role"; }; }; - id=29; + id=27; side="LOGIC"; vehicle="ACE_moduleAssignRepairFacility"; leader=1; @@ -866,7 +726,7 @@ class Mission }; }; }; - class Item30 + class Item28 { side="LOGIC"; class Vehicles @@ -933,7 +793,7 @@ class Mission typeName="wheelRepairRequiredItems"; }; }; - id=30; + id=28; side="LOGIC"; vehicle="ACE_moduleRepairSettings"; leader=1; @@ -942,7 +802,7 @@ class Mission }; }; }; - class Item31 + class Item29 { side="WEST"; class Vehicles @@ -952,7 +812,7 @@ class Mission { position[]={8321.8301,75.940002,10044.296}; azimut=180; - id=31; + id=29; side="WEST"; vehicle="B_Soldier_F"; leader=1; @@ -962,7 +822,7 @@ class Mission }; }; }; - class Item32 + class Item30 { side="GUER"; class Vehicles @@ -972,7 +832,7 @@ class Mission { position[]={8323.3779,75.940002,10044.296}; azimut=180; - id=32; + id=30; side="GUER"; vehicle="I_soldier_F"; leader=1; @@ -982,6 +842,134 @@ class Mission }; }; }; + class Item31 + { + side="LOGIC"; + class Vehicles + { + items=1; + class Item0 + { + position[]={8282.9766,57.551399,9962.9941}; + class args + { + items=10; + class Item0 + { + value="0"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="enabled"; + }; + class Item1 + { + value="1"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="simulateForSnipers"; + }; + class Item2 + { + value="0"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="simulateForGroupMembers"; + }; + class Item3 + { + value="0"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="simulateForEveryone"; + }; + class Item4 + { + value="0"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="disabledInFullAutoMode"; + }; + class Item5 + { + value="1"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="ammoTemperatureEnabled"; + }; + class Item6 + { + value="1"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="barrelLengthInfluenceEnabled"; + }; + class Item7 + { + value="1"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="bulletTraceEnabled"; + }; + class Item8 + { + value="0"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="simulationInterval"; + }; + class Item9 + { + value="3000"; + parentCls="ace_advanced_ballistics_ModuleSettings"; + typeName="simulationRadius"; + }; + }; + id=31; + side="LOGIC"; + vehicle="ace_advanced_ballistics_ModuleSettings"; + leader=1; + lock="UNLOCKED"; + skill=0.60000002; + }; + }; + }; + class Item32 + { + side="LOGIC"; + class Vehicles + { + items=1; + class Item0 + { + position[]={8277.0547,58.537991,9962.7119}; + class args + { + items=4; + class Item0 + { + value="1"; + parentCls="ace_winddeflection_ModuleSettings"; + typeName="enabled"; + }; + class Item1 + { + value="1"; + parentCls="ace_winddeflection_ModuleSettings"; + typeName="vehicleEnabled"; + }; + class Item2 + { + value="0.05"; + parentCls="ace_winddeflection_ModuleSettings"; + typeName="simulationInterval"; + }; + class Item3 + { + value="3000"; + parentCls="ace_winddeflection_ModuleSettings"; + typeName="simulationRadius"; + }; + }; + id=32; + side="LOGIC"; + vehicle="ace_winddeflection_ModuleSettings"; + leader=1; + lock="UNLOCKED"; + skill=0.60000002; + }; + }; + }; }; class Vehicles { @@ -1131,7 +1119,7 @@ class Mission }; class Item13 { - position[]={8209.9434,76.416351,10021.622}; + position[]={8213.5498,76.487816,10024.03}; azimut=-27.934999; id=46; side="EMPTY"; @@ -1142,7 +1130,7 @@ class Mission }; class Item14 { - position[]={8209.9336,76.380455,10022.721}; + position[]={8213.54,76.510483,10025.129}; azimut=51.220901; id=47; side="EMPTY"; From 13d327b884af28922fab80cd4ed2dec378e66dd3 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sat, 12 Dec 2015 17:10:28 +0100 Subject: [PATCH 06/12] Add traffic civ boat - FIX : btc_civ_type_boat not correctly define - Add traffic civ --- .../core/def/mission.sqf | 1 + .../core/fnc/cache/find_pos.sqf | 4 +-- .../core/fnc/civ/traffic_add_WP.sqf | 11 +++++--- .../core/fnc/civ/traffic_create.sqf | 26 ++++++++++++++++--- .../core/fnc/common/randomize_pos.sqf | 12 ++++++--- 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf index 9650cd277..fe9d30bfe 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -134,6 +134,7 @@ btc_city_type = "Land_Ammobox_rounds_F"; //Civ btc_civ_type_units = ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F"]; btc_civ_type_veh = ["C_Hatchback_01_F","C_SUV_01_F","C_Offroad_01_F","C_Van_01_transport_F","C_Van_01_box_F"]; +btc_civ_type_boat = ["C_Rubberboat","C_Boat_Civil_01_F","C_Boat_Civil_01_rescue_F","C_Boat_Civil_01_police_F"]; btc_civ_max_veh = 5; btc_w_civs = ["V_Rangemaster_belt","arifle_Mk20_F","30Rnd_556x45_Stanag","hgun_ACPC2_F","9Rnd_45ACP_Mag"]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf index bc72a592e..ecb81ab30 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf @@ -5,13 +5,13 @@ if (count btc_hideouts == 0) exitWith {}; _useful = []; _house = objNull; -{if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"}) then {_useful = _useful + [_x];};} foreach btc_city_all; +{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) then {_useful = btc_city_all;}; _id = floor random count _useful; _city = _useful select _id; -if (_city getVariable ["type",""] == "NameLocal" || _city getVariable ["type",""] == "Hill") exitWith {[] call btc_fnc_cache_find_pos;}; +if (_city getVariable ["type",""] == "NameLocal" || _city getVariable ["type",""] == "Hill" || _city getVariable ["type",""] == "NameMarine") exitWith {[] call btc_fnc_cache_find_pos;}; btc_cache_cities set [_id,0]; btc_cache_cities = btc_cache_cities - [0]; /* diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf index 4f2d04626..3b22dc3ed 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_add_WP.sqf @@ -1,9 +1,10 @@ -private ["_group","_city","_area","_players","_cities","_pos"]; +private ["_group","_city","_area","_players","_cities","_pos","_iswater"]; _group = _this select 0; _city = _group getVariable ["city",objNull]; _area = _this select 1; +_iswater = _this select 2; _players = if (isMultiplayer) then {playableUnits} else {switchableUnits}; @@ -15,7 +16,9 @@ if ({_x distance _city < (_area/2) || _x distance leader _group < (_area/2)} cou }; _cities = []; -{if (_x distance _city < _area) then {_cities = _cities + [_x];};} foreach btc_city_all; +{if (((_x distance _city < _area) && !_iswater && {_x getVariable ["type",""] != "NameMarine"}) || ((_x distance _city < _area*2) && _iswater && {_x getVariable ["type",""] == "NameMarine"})) then { + _cities = _cities + [_x]; +};} foreach btc_city_all; _pos = []; if (count _cities == 0) then {_pos = getPos _city;} else { _pos = getPos (_cities select (floor random count _cities)); @@ -26,13 +29,13 @@ private ["_wp","_wp_1"]; while {(count (waypoints _group)) > 0} do { deleteWaypoint ((waypoints _group) select 0); }; - + if ((vehicle leader _group) isKindOf "Air" || (vehicle leader _group) isKindOf "LandVehicle") then {(vehicle leader _group) setFuel 1;}; _group setBehaviour "SAFE"; _wp = _group addWaypoint [_pos, 0]; _wp setWaypointType "MOVE"; _wp setWaypointCompletionRadius 20; -_wp setWaypointStatements ["true", format ["_spawn = [group this,%1] spawn btc_fnc_civ_traffic_add_WP;",_area]]; +_wp setWaypointStatements ["true", format ["_spawn = [group this,%1,%2] spawn btc_fnc_civ_traffic_add_WP;",_area,_iswater]]; if (btc_debug) then { if (!isNil {_group getVariable "btc_traffic_id"}) then { diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index 4fbd2d2aa..ec398ec94 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -1,5 +1,5 @@ -private ["_city","_area","_cities","_useful","_unit_type","_veh_type","_group","_veh"]; +private ["_city","_area","_cities","_useful","_unit_type","_veh_type","_group","_veh","_iswater"]; _city = _this select 0; _area = _this select 1; @@ -17,7 +17,7 @@ _useful = []; if (count _useful == 0) then { while {count _useful == 0} do { private "_pos"; - _pos = [getPos _city, _area] call btc_fnc_randomize_pos; + _pos = [getPos _city, _area, true] call btc_fnc_randomize_pos; if ({_x distance _pos < 500} count playableUnits == 0) then {_useful = _useful + [_pos];}; }; }; @@ -34,7 +34,21 @@ _group setVariable ["btc_traffic_id",btc_traffic_id];btc_traffic_id = btc_traffi _group setVariable ["city",_city]; _Spos = []; -if (count (_pos nearRoads 500) > 0) then {_Spos = getPos ((_pos nearRoads 500) select 0)} else {_Spos = [_pos, 0, 500, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;}; +if (count (_pos nearRoads 100) > 0) then { + _Spos = getPos ((_pos nearRoads 500) select 0) +} else { + _Spos = [_pos, 0, 500, 13, 1, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; +}; + +if (surfaceIsWater _Spos) then { + _Spos = [_Spos select 0, _Spos select 1,0]; + _veh_type = btc_civ_type_boat select (floor (random (count btc_civ_type_boat))); + _iswater = true; +} else { + _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); + _iswater = false; +}; + _veh = createVehicle [_veh_type, _Spos, [], 0, "NONE"]; _unit_type createUnit [_pos, _group, "this moveinDriver _veh;this assignAsDriver _veh;"]; @@ -49,4 +63,8 @@ _veh setVariable ["driver", leader _group]; {_x call btc_fnc_civ_unit_create;_x setVariable ["traffic",_veh];} foreach units _group; -[_group,_area] call btc_fnc_civ_traffic_add_WP; \ No newline at end of file +if (btc_debug_log) then { + player sidechat format ["_isWater = %1",_iswater]; + diag_log format ["_isWater = %1",_iswater]; +}; +[_group,_area,_iswater] call btc_fnc_civ_traffic_add_WP; \ No newline at end of file diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf index 3c55713af..d5abad4f0 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/randomize_pos.sqf @@ -1,9 +1,15 @@ -private ["_pos","_random_area","_return_pos","_pos_x","_pos_y","_check_pos"]; +private ["_pos","_random_area","_return_pos","_pos_x","_pos_y","_check_pos","_allowwater"]; _pos = _this select 0; _random_area = _this select 1; +if (count _this > 2) then { + _allowwater = _this select 2; +} else { + _allowwater = false; +}; + _return_pos = _pos; _pos_x = _pos select 0; @@ -14,11 +20,11 @@ _pos_y = _pos_y + ((random _random_area) - (random _random_area)); _check_pos = [_pos_x, _pos_y, 0]; -if (surfaceIsWater _check_pos) then { +if ((surfaceIsWater _check_pos) && !(_allowwater)) then { _return_pos = [_check_pos, 0, _random_area, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; _pos_x = _return_pos select 0; _pos_y = _return_pos select 1; _return_pos = [_pos_x, _pos_y, 0]; } else {_return_pos = _check_pos;}; -_return_pos \ No newline at end of file +_return_pos \ No newline at end of file From 53397cd01f57f2a2c96be2fe3c80765842fa9037 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sun, 13 Dec 2015 01:20:52 +0100 Subject: [PATCH 07/12] Add enemy boat patrol - Add enemy boat patrol - for SDV select diver --- .../core/def/mission.sqf | 6 ++++ .../core/fnc/mil/patrol_addWP.sqf | 17 +++++----- .../core/fnc/mil/patrol_create.sqf | 31 +++++++++++++------ 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf index fe9d30bfe..d155f7e9d 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -366,8 +366,10 @@ switch (true) do { btc_hq = btc_hq_red; btc_enemy_side = east; btc_type_units = ["O_G_Soldier_F","O_G_Soldier_TL_F","O_G_Soldier_AR_F","O_G_engineer_F","O_G_Soldier_exp_F","O_G_Soldier_GL_F","O_G_Soldier_LAT_F"]; + btc_type_divers = ["O_diver_F","O_diver_exp_F","O_diver_TL_F"]; btc_type_crewmen = "O_G_Soldier_F"; btc_type_vehicles = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F"]; + btc_type_boats = ["I_Boat_Armed_01_minigun_F","I_Boat_Transport_01_F","I_SDV_01_F","I_G_Boat_Transport_01_F"]; btc_type_motorized = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F","I_Truck_02_transport_F","I_G_Offroad_01_armed_F","I_Truck_02_covered_F"]; btc_type_mg = ["O_HMG_01_F","O_HMG_01_high_F"]; btc_type_gl = ["O_GMG_01_F","O_GMG_01_high_F"]; @@ -388,8 +390,10 @@ switch (true) do { btc_hq = btc_hq_green; btc_enemy_side = resistance; btc_type_units = ["I_Soldier_F","I_Soldier_TL_F","I_Soldier_AR_F","I_engineer_F","I_Soldier_exp_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AT_F","I_Soldier_AA_F","I_Spotter_F","I_Sniper_F"]; + btc_type_divers = ["I_diver_F","I_diver_exp_F","I_diver_TL_F"]; btc_type_crewmen = "I_Soldier_F"; btc_type_vehicles = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F","I_MRAP_03_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F"]; + btc_type_boats = ["I_Boat_Armed_01_minigun_F","I_Boat_Transport_01_F","I_SDV_01_F","I_G_Boat_Transport_01_F"]; btc_type_motorized = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F","I_Truck_02_transport_F","I_G_Offroad_01_armed_F","I_Truck_02_covered_F","I_MRAP_03_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F","I_Heli_light_03_F","I_APC_tracked_03_cannon_F"]; btc_type_mg = ["I_HMG_01_F","I_HMG_01_high_F"]; btc_type_gl = ["I_GMG_01_F","I_GMG_01_high_F"]; @@ -408,8 +412,10 @@ switch (true) do { btc_hq = btc_hq_red; btc_enemy_side = east; btc_type_units = ["O_G_Soldier_F","O_G_Soldier_TL_F","O_G_Soldier_AR_F","O_G_engineer_F","O_G_Soldier_exp_F","O_G_Soldier_GL_F","O_G_Soldier_LAT_F"]; + btc_type_divers = ["O_diver_F","O_diver_exp_F","O_diver_TL_F"]; btc_type_crewmen = "O_G_Soldier_F"; btc_type_vehicles = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F"]; + btc_type_boats = ["I_Boat_Armed_01_minigun_F","I_Boat_Transport_01_F","I_SDV_01_F","I_G_Boat_Transport_01_F"]; btc_type_motorized = ["I_G_Offroad_01_F","I_G_Offroad_01_armed_F","I_Truck_02_transport_F","I_G_Offroad_01_armed_F","I_Truck_02_covered_F"]; btc_type_mg = ["O_HMG_01_F","O_HMG_01_high_F"]; btc_type_gl = ["O_GMG_01_F","O_GMG_01_high_F"]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf index 503d62f11..ff3ec0b29 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_addWP.sqf @@ -4,6 +4,7 @@ private ["_group","_city","_area","_players"]; _group = _this select 0; _city = _group getVariable ["city",objNull]; _area = _this select 1; +_iswater = _this select 2; _players = if (isMultiplayer) then {playableUnits} else {switchableUnits}; @@ -14,7 +15,9 @@ if ({_x distance _city < (_area/2) || _x distance leader _group < (_area/2)} cou }; _cities = []; -{if (_x distance _city < _area) then {_cities = _cities + [_x];};} foreach btc_city_all; +{if (((_x distance _city < _area) && !_iswater && {_x getVariable ["type",""] != "NameMarine"}) || ((_x distance _city < _area*2) && _iswater && {_x getVariable ["type",""] == "NameMarine"})) then { + _cities = _cities + [_x]; +};} foreach btc_city_all; _pos = []; if (count _cities == 0) then {_pos = getPos _city;} else { _pos = getPos (_cities select (floor random count _cities)); @@ -23,7 +26,7 @@ if (count _cities == 0) then {_pos = getPos _city;} else { private ["_wp","_wp_1"]; while {(count (waypoints _group)) > 0} do {deleteWaypoint ((waypoints _group) select 0);}; - + if ((vehicle leader _group) isKindOf "Air" || (vehicle leader _group) isKindOf "LandVehicle") then {(vehicle leader _group) setFuel 1;}; _group setBehaviour "SAFE"; _wp = _group addWaypoint [_pos, 0]; @@ -32,11 +35,11 @@ _wp setWaypointCompletionRadius 20; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "LIMITED"; _wp setWaypointFormation "STAG COLUMN"; - + if !((vehicle leader _group) isKindOf "Air") then { for "_i" from 0 to (2 + (floor (random 3))) do { private ["_wp", "_newPos"]; - + _newPos = [(_pos select 0) + (random 150 - random 150),(_pos select 1) + (random 150 - random 150),0]; _wp = _group addWaypoint [_newPos, 0]; @@ -47,8 +50,8 @@ if !((vehicle leader _group) isKindOf "Air") then { _wp_1 = _group addWaypoint [_pos, 0]; _wp_1 setWaypointType "MOVE"; _wp_1 setWaypointCompletionRadius 20; - _wp_1 setWaypointStatements ["true", format ["_spawn = [group this,%1] spawn btc_fnc_mil_patrol_addWP;",_area]]; -} else {_wp setWaypointStatements ["true", format ["_spawn = [group this,%1] spawn btc_fnc_mil_patrol_addWP;",_area]];}; + _wp_1 setWaypointStatements ["true", format ["_spawn = [group this,%1,%2] spawn btc_fnc_mil_patrol_addWP;",_area,_iswater]]; +} else {_wp setWaypointStatements ["true", format ["_spawn = [group this,%1,%2] spawn btc_fnc_mil_patrol_addWP;",_area,_iswater]];}; if (btc_debug) then { if (!isNil {_group getVariable "btc_patrol_id"}) then { _marker = createmarker [format ["Patrol_fant_%1", _group getVariable "btc_patrol_id"] , [(_pos select 0) + random 30,(_pos select 1) + random 30,0]]; @@ -58,7 +61,7 @@ if (btc_debug) then { format ["Patrol_fant_%1", _group getVariable "btc_patrol_id"] setMarkerSize [0.5, 0.5]; diag_log text format ["ID: %1 (%3) POS: %2",_group getVariable "btc_patrol_id",_pos,typeof vehicle leader _group]; };/* - if (!isNil {_group getVariable "btc_patrol_id"}) then + if (!isNil {_group getVariable "btc_patrol_id"}) then { _marker = createmarker [format ["Patrol_veh_%1", _group getVariable "btc_patrol_id"] , [(_pos select 0) + random 30,(_pos select 1) + random 30,0]]; format ["Patrol_veh_%1", _group getVariable "btc_patrol_id"] setmarkertype "mil_dot"; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf index a8685396c..129bbbee7 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/patrol_create.sqf @@ -1,5 +1,5 @@ -private ["_random","_city","_area","_cities","_useful","_pos","_group"]; +private ["_random","_city","_area","_cities","_useful","_pos","_group","_iswater","_crewmen","_unit_type","_needdiver"]; _random = _this select 0;//0 random, 1 inf, 2 moto, 3 heli _city = _this select 1; @@ -46,8 +46,10 @@ _group setVariable ["no_cache",true]; _group setVariable ["btc_patrol",true]; _group setVariable ["btc_patrol_id",btc_patrol_id];btc_patrol_id = btc_patrol_id + 1; +if (surfaceIsWater _pos) then {_iswater = true;} else {_iswater = false;}; + switch (true) do { - case (_random == 1) : { + case ((_random == 1) && !_iswater) : { _n_units = 4 + (round random 8); _group createUnit [(btc_type_units select 0), _pos, [], 0, "NONE"];(leader _group) setpos _pos; for "_i" from 1 to _n_units do { @@ -56,24 +58,35 @@ switch (true) do { _group createUnit [_unit_type, _pos, [], 0, "NONE"]; sleep 0.1; }; - _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; + _spawn = [_group,_area,_iswater] spawn btc_fnc_mil_patrol_addWP; }; - case (_random == 2) : { + case ((_random == 2) || _iswater) : { private ["_veh_type","_newZone","_veh","_cargo"]; - _veh_type = btc_type_motorized select (floor (random (count btc_type_motorized))); _newZone = []; - if (count (_pos nearRoads 150) > 0) then {_newZone = getPos ((_pos nearRoads 150) select 0)} else {_newZone = [_pos, 0, 500, 13, 0, 60 * (pi / 180), 0] call BIS_fnc_findSafePos;}; + if (count (_pos nearRoads 150) > 0) then { + _newZone = getPos ((_pos nearRoads 150) select 0) + } else { + _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))); + _iswater = true; + } else { + _veh_type = btc_type_motorized select (floor (random (count 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}; _veh = createVehicle [_veh_type, _newZone, [], 0, "NONE"]; - [_veh,_group,false,"",btc_type_crewmen] call BIS_fnc_spawnCrew; + [_veh,_group,false,"",_crewmen] call BIS_fnc_spawnCrew; _group selectLeader (driver _veh); _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))); + _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 createUnit [_pos, _group, "this moveinCargo _veh;this assignAsCargo _veh;"]; }; }; - _spawn = [_group,_area] spawn btc_fnc_mil_patrol_addWP; + _spawn = [_group,_area,_iswater] spawn btc_fnc_mil_patrol_addWP; }; }; From 5ab14fb6b7fb77a223145ca77e72803d43916f5f Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sun, 13 Dec 2015 15:07:30 +0100 Subject: [PATCH 08/12] Add marina are occupied now - Add marina are occupied now - occupied marina are exclude from final phase --- .../core/fnc/city/activate.sqf | 2 +- .../core/fnc/common/final_phase.sqf | 22 ++++++++++--------- .../core/fnc/common/task_patrol.sqf | 11 ++++++++-- .../core/fnc/mil/create_group.sqf | 22 ++++++++++++------- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf index 56cc2c518..724524cf8 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf @@ -56,7 +56,7 @@ if (count _data_units > 0) then { case "NameVillage" : {1}; case "NameCity" : {2}; case "NameCityCapital" : {4}; - case "NameMarine" : {0}; + case "NameMarine" : {0.6}; default {0.1}; }); if (_has_en) then diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf index ce16cafae..90ce029aa 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf @@ -8,16 +8,18 @@ btc_final_phase = true; btc_city_remaining = []; { - if (_x getVariable ["marker",""] != "") then {deleteMarker (_x getVariable ["marker",""]);}; - _radius_x = _x getVariable ["RadiusX",500]; - _radius_y = _x getVariable ["RadiusY",500]; - _marker = createmarker [format ["city_%1",position _x],position _x]; - _marker setMarkerShape "ELLIPSE"; - _marker setMarkerBrush "SolidBorder"; - _marker setMarkerSize [(_radius_x+_radius_y), (_radius_x+_radius_y)]; - _marker setMarkerAlpha 0.3; - if (_x getVariable ["occupied",false]) then {_marker setmarkercolor "colorRed";btc_city_remaining = btc_city_remaining + [_x];} else {_marker setmarkercolor "colorGreen";_marker setMarkerAlpha 0;}; - _x setVariable ["marker",_marker]; + if (_x getVariable ["type",""] != "NameMarine") then { + if (_x getVariable ["marker",""] != "") then {deleteMarker (_x getVariable ["marker",""]);}; + _radius_x = _x getVariable ["RadiusX",500]; + _radius_y = _x getVariable ["RadiusY",500]; + _marker = createmarker [format ["city_%1",position _x],position _x]; + _marker setMarkerShape "ELLIPSE"; + _marker setMarkerBrush "SolidBorder"; + _marker setMarkerSize [(_radius_x+_radius_y), (_radius_x+_radius_y)]; + _marker setMarkerAlpha 0.3; + if (_x getVariable ["occupied",false]) then {_marker setmarkercolor "colorRed";btc_city_remaining = btc_city_remaining + [_x];} else {_marker setmarkercolor "colorGreen";_marker setMarkerAlpha 0;}; + _x setVariable ["marker",_marker]; + }; } foreach btc_city_all; waitUntil {sleep 15; (count btc_city_remaining == 0)}; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/task_patrol.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/task_patrol.sqf index feee6d31b..48f41bed8 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/task_patrol.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/task_patrol.sqf @@ -1,8 +1,15 @@ + +private ["_pos","_area","_behav","_allowwater"]; + _group = _this select 0; _pos = _this select 1; _area = _this select 2; _behav = _this select 3; - +if (count _this > 3) then { + _allowwater = _this select 4; +} else { + _allowwater = false; +}; _group setBehaviour _behav; {_x setBehaviour _behav;} foreach units _group; @@ -11,7 +18,7 @@ _prevPos = _pos; for "_i" from 0 to (2 + (floor (random 3))) do { private ["_wp", "_newPos"]; - _newPos = [_prevPos, 50, _area, 1, 0, 60 * (pi / 180), 0, []] call BIS_fnc_findSafePos; + _newPos = [_prevPos, 50, _area, 1, [0,1] select _allowwater, 60 * (pi / 180), 0, []] call BIS_fnc_findSafePos; _prevPos = _newPos; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/create_group.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/create_group.sqf index 1015a84bc..c0971605c 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/create_group.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/mil/create_group.sqf @@ -1,5 +1,5 @@ -private ["_city","_area","_n","_wp","_pos","_rpos","_unit_type","_group","_in_house"]; +private ["_city","_area","_n","_wp","_pos","_rpos","_unit_type","_group","_in_house","_iswater"]; _city = _this select 0; _area = _this select 1; @@ -14,9 +14,15 @@ switch (typeName _city) do { case "OBJECT":{_pos = position _city;}; }; -_rpos = [_pos, _area] call btc_fnc_randomize_pos; +_rpos = [_pos, _area,true] call btc_fnc_randomize_pos; -_unit_type = btc_type_units select (floor random count btc_type_units); +if (surfaceIsWater _rpos) then { + _unit_type = btc_type_divers select (floor random count btc_type_divers); + _iswater = true; +} else { + _unit_type = btc_type_units select (floor random count btc_type_units); + _iswater = false; +}; _group = createGroup btc_enemy_side; _group createUnit [_unit_type, _rpos, [], 0, "NONE"]; @@ -29,13 +35,13 @@ 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 = _houses select (floor random count _houses); [_group,_house] spawn btc_fnc_house_addWP; _group setVariable ["inHouse",_house]; - } else {[_group,_rpos,_area,"SAFE"] spawn btc_fnc_task_patrol;}; + } else {[_group,_rpos,_area,"SAFE",_iswater] spawn btc_fnc_task_patrol;}; }; case (_wp > 0.3 && _wp < 0.75) : { - [_group,_rpos,(_area*2),"AWARE"] spawn btc_fnc_task_patrol; + [_group,_rpos,(_area*2),"AWARE",_iswater] spawn btc_fnc_task_patrol; }; case (_wp > 0.75) : { private ["_wpa"]; @@ -47,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); + _unit_type = [btc_type_units select (floor random count btc_type_units), btc_type_divers select (floor random count btc_type_divers) ] select _iswater; _group createUnit [_unit_type, _rpos, [], 0, "NONE"]; sleep 0.5; }; @@ -58,6 +64,6 @@ if ((position leader _group) distance [0,0,0] < 50) then {{_x setpos _rpos;} for {_x call btc_fnc_mil_unit_create;} foreach units _group; -if (btc_debug_log) then {diag_log format ["btc_fnc_mil_create_group: _this = %1 ; POS %2 UNITS N %3",_this,_rpos,count units _group];}; +if (btc_debug_log) then {diag_log format ["btc_fnc_mil_create_group: _this = %1 ; POS %2 UNITS N %3",_this,_rpos,count units _group];}; _group \ No newline at end of file From 8455c59fd0554e8c67e96ca1a97ef1bd5b08f8be Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sun, 13 Dec 2015 16:04:49 +0100 Subject: [PATCH 09/12] Add btc_type_divers and btc_type_boats in RHS/CAF --- =BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf index d155f7e9d..f560360c8 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -378,8 +378,10 @@ switch (true) do { btc_hq = btc_hq_red; btc_enemy_side = east; btc_type_units = ["CAF_AG_ME_AK47","CAF_AG_ME_T_AK74","CAF_AG_ME_T_PKM","CAF_AG_ME_T_RPK74","CAF_AG_ME_T_RPG","CAF_AG_ME_T_GL"]; + btc_type_divers = ["O_diver_F","O_diver_exp_F","O_diver_TL_F"]; btc_type_crewmen = "CAF_AG_ME_T_AK47"; btc_type_vehicles = ["CAF_AG_ME_T_Offroad_armed_01"]; + btc_type_boats = ["I_Boat_Armed_01_minigun_F","I_Boat_Transport_01_F","I_SDV_01_F","I_G_Boat_Transport_01_F"]; btc_type_motorized = ["CAF_AG_ME_T_Offroad","I_Truck_02_transport_F","CAF_AG_ME_T_Offroad_armed_01","CAF_AG_ME_T_van_01"]; btc_type_mg = ["O_HMG_01_F","O_HMG_01_high_F"]; btc_type_gl = ["O_GMG_01_F","O_GMG_01_high_F"]; @@ -402,8 +404,10 @@ switch (true) do { btc_hq = btc_hq_green; btc_enemy_side = resistance; btc_type_units = ["rhs_g_Soldier_F","rhs_g_medic_F","rhs_g_engineer_F","rhs_g_Soldier_exp_F","rhs_g_Soldier_GL_F","rhs_g_Soldier_AAT_F","rhs_g_Soldier_AR_F","rhs_g_Soldier_AAR_F","rhs_g_Soldier_M_F","rhs_g_uniform5_base","rhs_g_uniform1_base","rhs_g_uniform2_base","rhs_g_uniform3_base","rhs_g_uniform4_base","rhs_g_Soldier_F2","rhs_g_Soldier_F","rhs_g_Soldier_LAT_F","rhs_g_Soldier_lite_F","rhs_g_Soldier_AT_F","rhs_g_Soldier_TL_F","rhs_g_Soldier_SL_F"]; + btc_type_divers = ["I_diver_F","I_diver_exp_F","I_diver_TL_F"]; btc_type_crewmen = "rhs_g_Crew_F"; btc_type_vehicles = ["RHS_UAZ_chdkz","rhs_uaz_open_chdkz","rhs_btr60_chdkz","rhs_btr70_chdkz","rhs_bmd1_chdkz","rhs_bmd2_chdkz","rhs_ural_chdkz","rhs_ural_open_chdkz","rhs_ural_work_open_chdkz","rhs_ural_work_chdkz"]; + btc_type_boats = ["I_Boat_Armed_01_minigun_F","I_Boat_Transport_01_F","I_SDV_01_F","I_G_Boat_Transport_01_F"]; btc_type_motorized = ["RHS_UAZ_chdkz","rhs_uaz_open_chdkz","rhs_btr60_chdkz","rhs_btr70_chdkz","rhs_bmd1_chdkz","rhs_bmd2_chdkz","rhs_ural_chdkz","rhs_ural_open_chdkz","rhs_ural_work_open_chdkz","rhs_ural_work_chdkz"]; btc_type_mg = ["I_HMG_01_F","I_HMG_01_high_F"]; btc_type_gl = ["I_GMG_01_F","I_GMG_01_high_F"]; From df3acaa799187faa731c1b27de928fc46a2fff8f Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Sun, 13 Dec 2015 16:08:19 +0100 Subject: [PATCH 10/12] btc_civ_type_boats instead of btc_civ_type_boat --- =BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf | 2 +- .../core/fnc/civ/traffic_create.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf index fe9d30bfe..af9e43f67 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf @@ -134,7 +134,7 @@ btc_city_type = "Land_Ammobox_rounds_F"; //Civ btc_civ_type_units = ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F"]; btc_civ_type_veh = ["C_Hatchback_01_F","C_SUV_01_F","C_Offroad_01_F","C_Van_01_transport_F","C_Van_01_box_F"]; -btc_civ_type_boat = ["C_Rubberboat","C_Boat_Civil_01_F","C_Boat_Civil_01_rescue_F","C_Boat_Civil_01_police_F"]; +btc_civ_type_boats = ["C_Rubberboat","C_Boat_Civil_01_F","C_Boat_Civil_01_rescue_F","C_Boat_Civil_01_police_F"]; btc_civ_max_veh = 5; btc_w_civs = ["V_Rangemaster_belt","arifle_Mk20_F","30Rnd_556x45_Stanag","hgun_ACPC2_F","9Rnd_45ACP_Mag"]; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index ec398ec94..db759a66a 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -42,7 +42,7 @@ if (count (_pos nearRoads 100) > 0) then { if (surfaceIsWater _Spos) then { _Spos = [_Spos select 0, _Spos select 1,0]; - _veh_type = btc_civ_type_boat select (floor (random (count btc_civ_type_boat))); + _veh_type = btc_civ_type_boats select (floor (random (count btc_civ_type_boats))); _iswater = true; } else { _veh_type = btc_civ_type_veh select (floor (random (count btc_civ_type_veh))); From fe2003ee93b7cca1f36fb34516d14f3952dc1861 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Tue, 15 Dec 2015 21:07:57 +0100 Subject: [PATCH 11/12] Clean debug --- .../core/fnc/civ/traffic_create.sqf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf index db759a66a..87d02ebd7 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf @@ -63,8 +63,4 @@ _veh setVariable ["driver", leader _group]; {_x call btc_fnc_civ_unit_create;_x setVariable ["traffic",_veh];} foreach units _group; -if (btc_debug_log) then { - player sidechat format ["_isWater = %1",_iswater]; - diag_log format ["_isWater = %1",_iswater]; -}; [_group,_area,_iswater] call btc_fnc_civ_traffic_add_WP; \ No newline at end of file From d7f49493ff6d5c2446e12284d09bc7136dd00adc Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Fri, 18 Dec 2015 15:17:09 +0100 Subject: [PATCH 12/12] Check for side if is a bay --- .../core/fnc/side/checkpoint.sqf | 2 +- .../core/fnc/side/civtreatment.sqf | 2 +- .../core/fnc/side/get_city.sqf | 2 +- .../core/fnc/side/mines.sqf | 2 +- .../core/fnc/side/supply.sqf | 6 +++--- .../core/fnc/side/tower.sqf | 2 +- .../core/fnc/side/vehicle.sqf | 11 +++++++---- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf index 9ee7d3e43..d3fb1c3e5 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/checkpoint.sqf @@ -3,7 +3,7 @@ private ["_useful","_city","_pos","_road","_roads","_boxes","_marker","_markers" //// Choose an occupied City \\\\ _useful = []; -{if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"}) then {_useful = _useful + [_x];};} foreach btc_city_all; +{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); _pos = getPos _city; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf index e4e2e59a1..49d4983c4 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/civtreatment.sqf @@ -3,7 +3,7 @@ private ["_useful","_veh","_vehpos","_city","_pos","_r","_houses","_roads","_mar //// Choose a clear City \\\\ _useful = []; -{if (!(_x getVariable ["occupied",false]) && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"}) then {_useful = _useful + [_x];};} foreach btc_city_all; +{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); _pos = getPos _city; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf index 5076b89e1..0413cfee3 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/get_city.sqf @@ -2,7 +2,7 @@ private ["_useful","_city","_pos"]; _useful = []; -{if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"}) then {_useful = _useful + [_x];};} foreach btc_city_all; +{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;}; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf index 66079e774..05923e6db 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/mines.sqf @@ -2,7 +2,7 @@ private ["_useful","_city","_pos","_area","_marker","_mines"]; _useful = []; -{if (_x getVariable ["type",""] != "NameLocal" && {_x getVariable ["type",""] != "Hill"}) then {_useful = _useful + [_x];};} foreach btc_city_all; +{if (_x getVariable ["type",""] != "NameLocal" && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; if (count _useful == 0) then {_useful = + btc_city_all;}; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf index dfe6f3f3d..3aa0eaafc 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/supply.sqf @@ -2,7 +2,7 @@ private ["_useful","_city","_pos","_area","_marker"]; _useful = []; -{if (_x getVariable ["type",""] != "NameLocal" && {_x getVariable ["type",""] != "Hill"}) then {_useful = _useful + [_x];};} foreach btc_city_all; +{if (_x getVariable ["type",""] != "NameLocal" && {_x getVariable ["type",""] != "Hill"} && (_x getVariable ["type",""] != "NameMarine")) then {_useful = _useful + [_x];};} foreach btc_city_all; if (count _useful == 0) then {_useful = + btc_city_all;}; @@ -49,9 +49,9 @@ if (count (nearestObjects [_pos, [btc_supplies_mat], 30]) > 0) then { _pos spawn { private "_obj"; _obj = (nearestObjects [_this, [btc_supplies_mat], 30]) select 0; - + waitUntil {sleep 5; ({_x distance _this < 300} count playableUnits == 0)}; - + deleteVehicle _obj; }; }; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf index 347a52298..720611d43 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/tower.sqf @@ -2,7 +2,7 @@ private ["_useful","_city","_pos","_road","_roads","_marker","_statics","_tower_type","_tower","_direction"]; _useful = []; -{if (_x getVariable ["occupied",false] && {_x getVariable ["type",""] != "NameLocal"} && {_x getVariable ["type",""] != "Hill"}) then {_useful = _useful + [_x];};} foreach btc_city_all; +{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;}; diff --git a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf index 739a107ef..b7e80fb58 100644 --- a/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf +++ b/=BTC=co@22_Hearts_and_Minds.Altis/core/fnc/side/vehicle.sqf @@ -1,7 +1,10 @@ -private ["_city","_pos","_roads","_marker","_veh_type","_veh"]; +private ["_city","_pos","_roads","_marker","_veh_type","_veh","_useful"]; -_city = btc_city_all select (floor random count btc_city_all); +_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); _pos = [getPos _city, 100] call btc_fnc_randomize_pos; @@ -53,9 +56,9 @@ if (btc_side_aborted || btc_side_failed || !Alive _veh) exitWith { [5,"btc_fnc_task_set_done",true] spawn BIS_fnc_MP; _veh spawn { - + waitUntil {sleep 5; ({_x distance _this < 300} count playableUnits == 0)}; - + deleteVehicle _this; };