Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add : Heart and Swim ! #67

Merged
merged 14 commits into from
Dec 22, 2015
11 changes: 11 additions & 0 deletions =BTC=co@22_Hearts_and_Minds.Altis/core/def/mission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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_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"];

Expand Down Expand Up @@ -365,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"];
Expand All @@ -375,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"];
Expand All @@ -387,8 +392,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"];
Expand All @@ -397,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"];
Expand All @@ -407,8 +416,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"];
Expand Down
4 changes: 2 additions & 2 deletions =BTC=co@22_Hearts_and_Minds.Altis/core/fnc/cache/find_pos.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
/*
Expand Down
41 changes: 31 additions & 10 deletions =BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,24 @@ _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;};
//if (_has_en == 0 && {!_has_ho}) then {_ratio_ied = 0;};
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];
};

Expand All @@ -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.6};
default {0.1};
});
if (_has_en) then
{
private ["_groups","_n","_trigger"];
Expand All @@ -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;
};
Expand Down Expand Up @@ -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;
};
};
};
Expand Down Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions =BTC=co@22_Hearts_and_Minds.Altis/core/fnc/city/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand All @@ -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;
Expand All @@ -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];
Expand All @@ -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];
Expand Down
Original file line number Diff line number Diff line change
@@ -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};

Expand All @@ -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));
Expand All @@ -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 {
Expand Down
22 changes: 18 additions & 4 deletions =BTC=co@22_Hearts_and_Minds.Altis/core/fnc/civ/traffic_create.sqf
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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];};
};
};
Expand All @@ -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_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)));
_iswater = false;
};

_veh = createVehicle [_veh_type, _Spos, [], 0, "NONE"];
_unit_type createUnit [_pos, _group, "this moveinDriver _veh;this assignAsDriver _veh;"];

Expand All @@ -49,4 +63,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;
[_group,_area,_iswater] call btc_fnc_civ_traffic_add_WP;
22 changes: 12 additions & 10 deletions =BTC=co@22_Hearts_and_Minds.Altis/core/fnc/common/final_phase.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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)};
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
_return_pos
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;

Expand Down
Loading