Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master_daily' into …
Browse files Browse the repository at this point in the history
…master_stable

# Conflicts:
#	=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf
#	=BTC=co@30_Hearts_and_Minds.Altis/core/doc.sqf
#	README.md
  • Loading branch information
Vdauphin committed Aug 15, 2017
2 parents 334680f + 1ef0f0c commit de9c746
Show file tree
Hide file tree
Showing 119 changed files with 1,358 additions and 1,368 deletions.
413 changes: 159 additions & 254 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf

Large diffs are not rendered by default.

130 changes: 69 additions & 61 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/doc.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
player createDiarySubject ["Documentation","Documentation"];

player createDiaryRecord ["Documentation", ["Headless", "
<img image='\a3\ui_f\data\map\vehicleicons\iconvirtual_ca.paa' width='20' height='20'/> This mission automatically use one Headless client when available.
player createDiaryRecord ["Documentation", ["Headless & Data base", "
<img image='\a3\ui_f\data\map\vehicleicons\iconvirtual_ca.paa' width='20' height='20'/> This mission automatically use one Headless client when available.<br/><br/>
<img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\download_ca.paa' width='20' height='20'/> This mission has a data base system. Enemy units, towns, hideouts, cache, objects created by players or Zeus, vehicles, players markers (not lines) on global channel are saved. All admin can save mission progress at any time with his self interaction key.
"]
];

Expand Down Expand Up @@ -114,7 +115,8 @@ When you destroy an hideout or an ammo cache, all the markers related to it will
player createDiaryRecord ["Documentation", ["Reputation", "
<img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\talk_ca.paa' width='20' height='20'/> Reputation can be ask to civilian<br/>
Bad actions cause bad effetcs.<br/>
<img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\meet_ca.paa' width='20' height='20'/> Helping the local population, fighting the Oplitas, disarming IED will rise your reputation; killing civilians, firing near civilians for no reason, losing vehicles, respawns will decrease your repution. At the beginning you have a very low reputation level, so civilians won't help you revealing important information about Oplitas, they will likely lie instead.
<img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\meet_ca.paa' width='20' height='20'/> Helping the local population, fighting the Oplitas, disarming IED will rise your reputation; killing civilians, mutilate alive/dead civilian, firing near civilians for no reason, damaging/destroying buildings, losing vehicles, respawns will decrease your repution. At the beginning you have a very low reputation level, so civilians won't help you revealing important information about Oplitas, they will likely lie instead.<br/>
Abort a side mission does not affect reputation.
"]
];

Expand Down Expand Up @@ -147,6 +149,6 @@ player createDiaryRecord ["Documentation", ["Interaction", "

player createDiaryRecord ["Documentation", [
"Version",
format ["<img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\download_ca.paa' width='20' height='20'/> Version %1 <img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\download_ca.paa' width='20' height='20'/>",(str(btc_version) + ".7")]
format ["<img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\download_ca.paa' width='20' height='20'/> Version %1 <img image='\A3\ui_f\data\igui\cfg\simpleTasks\types\download_ca.paa' width='20' height='20'/>",(str(btc_version) + ".0")]
]
];
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (isNil {_cache getVariable "btc_hd_cache"} && {_explosive} && {_damage > 0.6}
btc_cache_markers = [];

//Notification
[[0],"btc_fnc_show_hint"] spawn BIS_fnc_MP;
[0] remoteExec ["btc_fnc_show_hint", 0];

[] spawn {[] call btc_fnc_cache_find_pos;};
} else {0};
24 changes: 22 additions & 2 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _city setVariable ["active",true];
if (count _ieds > 0) then {
private _ieds_data = _ieds apply {_x call btc_fnc_ied_create};
_city = btc_city_all select (_this select 0);
[_city,_ieds_data] spawn btc_fnc_ied_check;
[_city,_ieds_data] call btc_fnc_ied_check;
};

if (count _data_units > 0) then {
Expand Down Expand Up @@ -105,14 +105,28 @@ if (_has_en) then {

if (_city getVariable ["spawn_more",false]) then {
_city setVariable ["spawn_more",false];
for "_i" from 1 to (2 + round random 3) do {[_city,_radius,(4 + random 3),(random 1)] call btc_fnc_mil_create_group;};
for "_i" from 1 to (2 + round random 3) do {
[_city,_radius,(4 + random 3),(random 1)] call btc_fnc_mil_create_group;
};
if (btc_p_veh_armed_spawn_more) then {
private _closest = [_city,btc_city_all select {!(_x getVariable ["active",false])},false] call btc_fnc_find_closecity;
for "_i" from 1 to (1 + round random 2) do {
[{_this call btc_fnc_mil_send}, [_closest,getpos _city,1,selectRandom btc_type_motorized_armed], _i * 2] call CBA_fnc_waitAndExecute;
};
};
};

if !(btc_cache_pos isEqualTo []) then {
if (btc_cache_pos distance _city < (_radius_x+_radius_y)) then {
if (count (btc_cache_pos nearEntities ["Man", 30]) > 3) exitWith {};
[btc_cache_pos,8,3,0.2] call btc_fnc_mil_create_group;
[btc_cache_pos,60,4,0.5] call btc_fnc_mil_create_group;
if (btc_p_veh_armed_spawn_more) then {
private _closest = [_city,btc_city_all select {!(_x getVariable ["active",false])},false] call btc_fnc_find_closecity;
for "_i" from 1 to (1 + round random 3) do {
[{_this call btc_fnc_mil_send}, [_closest,getpos _city,1,selectRandom btc_type_motorized_armed], _i * 2] call CBA_fnc_waitAndExecute;
};
};
};
};

Expand Down Expand Up @@ -140,6 +154,12 @@ if (_has_ho && {!(_city getVariable ["ho_units_spawned",false])}) then {
[[(_pos select 0) - 7,(_pos select 1) - 7,0],_statics,225] call btc_fnc_mil_create_static;
};
};
if (btc_p_veh_armed_ho) then {
_closest = [_city,btc_city_all select {!(_x getVariable ["active",false])},false] call btc_fnc_find_closecity;
for "_i" from 1 to (2 + round random 3) do {
[{_this call btc_fnc_mil_send}, [_closest,_pos,1,selectRandom btc_type_motorized_armed], _i * 2] call CBA_fnc_waitAndExecute;
};
};
};

//Suicider
Expand Down
5 changes: 4 additions & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/city/create.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

private ["_position","_type","_name","_radius_x","_radius_y","_has_en","_id","_city","_trigger"];
private ["_position","_type","_name","_radius_x","_radius_y","_has_en","_id","_city"];

_position = _this select 0;
_type = _this select 1;
Expand All @@ -24,6 +24,9 @@ _city setVariable ["type",_type];
_city setVariable ["spawn_more",false];
_city setVariable ["data_units",[]];
_city setVariable ["occupied",_has_en];
if (btc_p_sea) then {
_city setVariable ["hasbeach", (((selectBestPlaces [_position,0.8*(_radius_x+_radius_y), "sea",10,1]) select 0 select 1) isEqualTo 1)];
};

btc_city_all set [_id,_city];
[_position,_radius_x,_radius_y,_city,_has_en,_name,_type,_id] call btc_fnc_city_trigger_player_side;
Expand Down
29 changes: 4 additions & 25 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/city/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ for "_i" from 0 to (count _locations - 1) do {

_type = gettext(_current >> "type");
if (_type in _cities) then {
private ["_id","_city","_position","_name","_position","_radius_x","_radius_y","_has_en","_trigger","_new_position","_area"];
_id = count btc_city_all;
private ["_position","_name","_position","_radius_x","_radius_y","_new_position","_area"];
_position = getarray(_current >> "position");
if (surfaceIsWater _position) then {
if !(_type isEqualTo "NameMarine") then {
Expand All @@ -36,32 +35,12 @@ for "_i" from 0 to (count _locations - 1) do {

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;
_city enableSimulation false;
_city setVariable ["activating",false];
_city setVariable ["initialized",false];
_city setVariable ["id",_id];
_city setVariable ["name",_name];
_city setVariable ["RadiusX",_radius_x];
_city setVariable ["RadiusY",_radius_y];
_city setVariable ["active",false];
_city setVariable ["type",_type];
_city setVariable ["spawn_more",false];
_city setVariable ["data_units",[]];
_has_en = (random 1 > 0.45);
_city setVariable ["occupied",_has_en];
if (btc_p_sea) then {
_city setVariable ["hasbeach", (((selectBestPlaces [_position,0.8*(_radius_x+_radius_y), "sea",10,1]) select 0 select 1) isEqualTo 1)];
};
btc_city_all set [_id,_city];
[_position,_radius_x,_radius_y,_city,_has_en,_name,_type,_id] call btc_fnc_city_trigger_player_side;
[_position,_type,_name,_radius_x,_radius_y,random 1 > 0.45] call btc_fnc_city_create;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _id = _this select 7;
_trigger = createTrigger["EmptyDetector",_position];
_trigger setTriggerArea[(_radius_x+_radius_y) + btc_city_radius,(_radius_x+_radius_y) + btc_city_radius,0,false];
_trigger setTriggerActivation["ANYPLAYER","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]];
_trigger setTriggerStatements [btc_p_trigger, format ["[%1] spawn btc_fnc_city_activate",_id], format ["[%1] spawn btc_fnc_city_de_activate",_id]];
_city setVariable ["trigger_player_side",_trigger];

if (btc_debug) then {//_debug
Expand Down
15 changes: 15 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/add_grenade.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

private _unit = _this select 0;

_unit addMagazines [selectRandom btc_g_civs, 1];

_unit addEventHandler ["Fired", {
if ((_this select 1) isEqualTo "Throw") then {
(_this select 0) removeEventHandler ["Fired", _thisEventHandler];
[_this select 0] joinSilent createGroup [civilian, true];
[{
(_this select 0) call btc_fnc_rep_add_eh;
(group (_this select 0)) call btc_fnc_civ_addWP;
}, [_this select 0], 20] call CBA_fnc_waitAndExecute;
};
}];
37 changes: 37 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/class.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

private _factions = _this select 0;

private _type_units = [];
private _type_boats = [];
private _type_veh = [];

//Get all vehicles
private _allclass = ("(configName _x) isKindOf 'AllVehicles'" configClasses (configFile >> "CfgVehicles")) apply {configName _x};
_allclass = _allclass select {getNumber(configfile >> "CfgVehicles" >> _x >> "scope") isEqualTo 2};

//Check if faction existe
_factions = _factions apply {if !isClass(configFile >> "CfgFactionClasses" >> _x) then {"CIV_F"} else {_x};};

{
private _faction = _x;

//Get all vehicles of the _faction selected
private _allclass_f = _allclass select {(toUpper getText(configFile >> "cfgvehicles" >> _x >> "faction")) isEqualTo _faction};

//Units
_type_units append (_allclass_f select {_x isKindOf "Man"});
if (_type_units isEqualTo []) then {_type_units append ["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_1_F_afro","C_man_polo_1_F_euro","C_man_polo_1_F_asia","C_man_polo_2_F","C_man_polo_2_F_afro","C_man_polo_2_F_euro","C_man_polo_2_F_asia","C_man_polo_3_F","C_man_polo_3_F_afro","C_man_polo_3_F_euro","C_man_polo_3_F_asia","C_man_polo_4_F","C_man_polo_4_F_afro","C_man_polo_4_F_euro","C_man_polo_4_F_asia","C_man_polo_5_F","C_man_polo_5_F_afro","C_man_polo_5_F_euro","C_man_polo_5_F_asia","C_man_polo_6_F","C_man_polo_6_F_afro","C_man_polo_6_F_euro","C_man_polo_6_F_asia","C_man_p_fugitive_F","C_man_p_fugitive_F_afro","C_man_p_fugitive_F_euro","C_man_p_fugitive_F_asia","C_man_p_beggar_F","C_man_p_beggar_F_afro","C_man_p_beggar_F_euro","C_man_p_beggar_F_asia","C_man_w_worker_F","C_man_hunter_1_F","C_Orestes","C_Nikos","C_Man_casual_4_F","C_Man_casual_5_F","C_Man_casual_6_F","C_Man_sport_1_F","C_Man_sport_2_F","C_Man_sport_3_F","C_Man_casual_1_F","C_Man_casual_2_F","C_Man_casual_3_F"]};

//Vehicles
_type_boats append (_allclass_f select {_x isKindOf "Ship"});
if (_type_boats isEqualTo []) then {_type_boats append ["C_Rubberboat","C_Boat_Civil_01_F","C_Boat_Civil_01_rescue_F","C_Boat_Civil_01_police_F","C_Boat_Transport_02_F","C_Scooter_Transport_01_F"];};
_type_veh append (_allclass_f select {(_x isKindOf "Car") || (_x isKindOf "Truck") || (_x isKindOf "Truck_F")});
if (_type_veh isEqualTo []) then {_type_veh append ["C_Hatchback_01_F","C_SUV_01_F","C_Offroad_01_F","C_Van_01_transport_F","C_Van_01_box_F","C_Truck_02_transport_F","C_Truck_02_covered_F","C_Offroad_02_unarmed_F"]};
} forEach _factions;

//Final filter unwanted units type
_type_units = _type_units select {((_x find "_Driver_") isEqualTo -1) && ((_x find "_base") isEqualTo -1) && ((_x find "_unarmed_") isEqualTo -1) && ((_x find "_VR_") isEqualTo -1) && ((_x find "_pilot_") isEqualTo -1)};
_type_veh = _type_veh select {((_x find "UAV") isEqualTo -1) && ((_x find "UGV") isEqualTo -1) && ((_x find "_Kart_") isEqualTo -1)};


[_type_units,_type_boats,_type_veh]
28 changes: 28 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/get_grenade.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

private ["_pos","_range","_units"];

_pos = _this select 0;
_range = _this select 1;
_units = [];
if (count _this > 2) then {_units = _this select 2;} else {_units = _pos nearEntities [btc_civ_type_units, _range];};

_units = (_units select {side _x isEqualTo civilian});

if (_units isEqualTo []) exitWith {};

{
if (btc_debug_log) then {diag_log format ["fnc_civ_get_grenade %1 - %2",_x,side _x];};

_x call btc_fnc_rep_remove_eh;

[_x] call btc_fnc_civ_add_grenade;

[_x] joinSilent createGroup [btc_enemy_side, true];

(group _x) setVariable ["getWeapons",true];

(group _x) setBehaviour "AWARE";
private _wp = (group _x) addWaypoint [_pos, 10];
_wp setWaypointType "GUARD";
_wp setWaypointCombatMode "RED";
} foreach [selectRandom _units];
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ _units = _units select {side _x isEqualTo civilian};

[_x] call btc_fnc_civ_add_weapons;

[_x] joinSilent btc_hq;
[_x] joinSilent GrpNull;
[_x] joinSilent createGroup [btc_enemy_side, true];

(group _x) setVariable ["getWeapons",true];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ if ({_x distance _active_city < (_area/2) || _x distance leader _group < (_area/
if (btc_debug_log) then {
diag_log format ["TRAFFIC REMOVE ID: %1 (%3) POS: %2",_group getVariable "btc_traffic_id",getpos leader _group,typeof vehicle leader _group];
};
if (vehicle leader _group != leader _group) then {
(vehicle leader _group) call btc_fnc_civ_traffic_eh_remove;
deleteVehicle (vehicle leader _group);
};
{deleteVehicle _x;} foreach units _group;deleteGroup _group;
vehicle leader _group setFuel 0;
};

//Sometimes the waypoints is completed but too far do to obstacle (water for island etc)
//Sometimes the waypoints is completed but too far due to obstacle (water for island etc)
if ((leader _group) distance _end_city > 300) then {
_noaccess pushBack _end_city;
_tmp_area = _area - ((leader _group) distance _end_city) * 0.3 * count _noaccess;
Expand Down
10 changes: 2 additions & 8 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/traffic_eh.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@

//if (count _this > 4 && {!((_this select 1) isEqualTo "engine")}) exitWith {};

private ["_veh"];

_veh = _this select 0;
private _veh = _this select 0;
if (btc_debug_log) then {
diag_log format ["EH TRAFFIC ID: %1 veh: %2 driver: %3 pos_veh: %4",(_veh getVariable ["driver",_veh]) getVariable "btc_traffic_id", _veh,_veh getVariable ["driver",_veh], getPos _veh];
};

_veh call btc_fnc_civ_traffic_eh_remove;

[_veh,(_veh getVariable ["driver",grpNull])] spawn {
waitUntil {sleep 5; ({_x distance (_this select 0) < 600} count playableUnits == 0)};
{deleteVehicle _x;} foreach ([_this select 0] + units (_this select 1));
deleteGroup (_this select 1);
};
[[], [_veh], [], [(_veh getVariable ["driver",grpNull])]] call btc_fnc_delete;
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
private ["_obj"];_obj = _x;
private _obj = _x;
if (({_x distance _obj < 150} count playableUnits) == 0) then {deleteVehicle _obj};
} foreach ((allMissionObjects "groundweaponholder") select {!(_x getVariable ["no_cache",false])});
{
private ["_dead"];_dead = _x;
private _dead = _x;
if (({_x distance _dead < 300} count playableUnits) == 0 && isNil {_dead getVariable "btc_dont_delete"}) then {deleteVehicle _dead};
} foreach alldead;
{
Expand Down
39 changes: 39 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/common/delete.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// [marker array], [object array],[fx object array (test_EmptyObjectForSmoke)] , [group array]

{
deletemarker _x;
} foreach (_this select 0);

{
private _object = _x;
[{
params ["_args", "_id"];
if ({_x distance _args < 1000} count playableUnits == 0) then {
[_id] call CBA_fnc_removePerFrameHandler;
deleteVehicle _args;
};
} , 5, _object] call CBA_fnc_addPerFrameHandler;
} forEach (_this select 1);

{
private _fx = _x;
[{
params ["_args", "_id"];
if ({_x distance _args < 1000} count playableUnits == 0) then {
[_id] call CBA_fnc_removePerFrameHandler;
_args call btc_fnc_deleteTestObj;
};
} , 5, _fx] call CBA_fnc_addPerFrameHandler;
} forEach (_this select 2);

{
private _group = _x;
[{
params ["_args", "_id"];
if ({_x distance leader _args < 1000} count playableUnits == 0) then {
[_id] call CBA_fnc_removePerFrameHandler;
{deleteVehicle _x} foreach units _args;
[_args] call btc_fnc_deletegroup;
};
} , 5, _group] call CBA_fnc_addPerFrameHandler;
} forEach (_this select 3);
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ if (local (_this select 0)) then {
deleteGroup (_this select 0);
} else {
//DeleteGroup where is local
[(_this select 0), {deleteGroup _this}] remoteExec ["call", groupOwner (_this select 0)];
(_this select 0) remoteExec ["deleteGroup", groupOwner (_this select 0)];
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

private ["_radius_x","_radius_y","_marker"];

[[6],"btc_fnc_show_hint"] spawn BIS_fnc_MP;
[6] remoteExec ["btc_fnc_show_hint", 0];

{1 call btc_fnc_task_set_done} remoteExec ["call", 0];
1 remoteExec ["btc_fnc_task_set_done", 0];

btc_final_phase = true;

Expand All @@ -26,8 +26,8 @@ btc_city_remaining = [];

waitUntil {sleep 15; (btc_city_remaining isEqualTo [])};

{0 call btc_fnc_task_set_done;} remoteExec ["call", 0];
0 remoteExec ["btc_fnc_task_set_done", 0];
2 call btc_fnc_task_set_done;

//END
[[],"btc_fnc_end_mission",true,true] spawn BIS_fnc_MP;
[] remoteExec ["btc_fnc_end_mission", 0, true];
Loading

0 comments on commit de9c746

Please sign in to comment.