Sector defenders dynamicly, Guerilla dynamic loadouts

This commit is contained in:
Christian 2017-10-08 12:51:48 +02:00
parent 914ae1a445
commit e6272b4807
38 changed files with 324 additions and 600 deletions

View File

@ -120,6 +120,9 @@ KP_liberation_civinfo_duration = 1200; // Civil Informant stay
KP_liberation_convoy_ambush_chance = 4; // Chance that a logistic convoy will be ambushed, when civil reputation is low
KP_liberation_convoy_ambush_duration = 1800; // Duration of the convoy ambush event (seconds)
KP_liberation_resistance_tier2 = 30; // At which strength (0-100) the guerilla forces will be at tier 2?
KP_liberation_resistance_tier3 = 70; // At which strength (0-100) the guerilla forces will be at tier 3?
/* - Default arsenal blacklist method.
Useless if you're using anything other than "kp_liberation_arsenal = 0;" above. A whitelisted arsenal is always more performance friendly then a blacklisted arsenal.
REMEMBER: All static turret and UAV bags should be defined here, to stop players from exploiting free resources via the virtual arsenal. */

View File

@ -137,7 +137,6 @@ ammobox_transports_typenames = [];
{ammobox_transports_typenames pushback (_x select 0)} foreach box_transport_config;
ammobox_transports_typenames = [ammobox_transports_typenames, {[_x] call F_checkClass}] call BIS_fnc_conditionalSelect;
elite_vehicles = [elite_vehicles, {[_x] call F_checkClass}] call BIS_fnc_conditionalSelect;
original_resistance = ["O_G_Soldier_TL_F","O_G_Soldier_SL_F","O_G_Soldier_lite_F","O_G_Soldier_F","O_G_Soldier_F","O_G_Soldier_LAT_F","O_G_Soldier_GL_F","O_G_Soldier_AR_F","O_G_Soldier_AR_F","O_G_Soldier_M_F","O_G_engineer_F","O_G_Soldier_exp_F"];
opfor_infantry = [opfor_sentry,opfor_rifleman,opfor_grenadier,opfor_squad_leader,opfor_team_leader,opfor_marksman,opfor_machinegunner,opfor_heavygunner,opfor_medic,opfor_rpg,opfor_at,opfor_aa,opfor_officer,opfor_sharpshooter,opfor_sniper,opfor_engineer];
GRLIB_intel_file = "Land_File1_F";
GRLIB_intel_laptop = "Land_Laptop_device_F";

View File

@ -1,4 +1,4 @@
private dact_build = -1;
private _idact_build = -1;
private _idact_arsenal = -1;
private _idact_buildfob = -1;
private _idact_redeploy = -1;

View File

@ -1,17 +0,0 @@
_is_rhs = false;
_rhs_classnames = [ "rhs_weap_ak74m_camo_folded","rhs_weap_ak74m_camo_npz","rhs_weap_pkm","rhs_weap_akms","rhs_weap_ak74m_camo_npz","rhs_weap_svdp_wd_npz","rhs_weap_akm","rhs_weap_rpg7" ];
if ( count ( [ _rhs_classnames, { isClass ( configFile / "cfgWeapons" / _x ) } ] call BIS_fnc_conditionalSelect ) == ( count _rhs_classnames ) ) then { _is_rhs = true };
_loadouts_folder = "scripts\loadouts\vanilla\";
if ( _is_rhs ) then { _loadouts_folder = "scripts\loadouts\rhs\"; };
loadout_crewman = compile preprocessFileLineNumbers (format ["%1%2.sqf", _loadouts_folder, "crewman" ]);
loadout_sl = compile preprocessFileLineNumbers (format ["%1%2.sqf", _loadouts_folder, "sl" ]);
loadout_rifleman = compile preprocessFileLineNumbers (format ["%1%2.sqf", _loadouts_folder, "rifleman" ]);
loadout_autorifleman = compile preprocessFileLineNumbers (format ["%1%2.sqf", _loadouts_folder, "autorifleman" ]);
loadout_rifleman_light = compile preprocessFileLineNumbers (format ["%1%2.sqf", _loadouts_folder, "rifleman_light" ]);
loadout_marksman = compile preprocessFileLineNumbers (format ["%1%2.sqf", _loadouts_folder, "marksman" ]);
loadout_at = compile preprocessFileLineNumbers (format ["%1%2.sqf", _loadouts_folder, "at" ]);
militia_standard_squad = [ loadout_sl, loadout_autorifleman, loadout_rifleman, loadout_rifleman, loadout_rifleman_light, loadout_rifleman_light, loadout_marksman, loadout_at, loadout_at, loadout_at ];

View File

@ -1,29 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_Chestrig_rgr";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 6 do {_unit addItemToVest "rhs_30Rnd_762x39mm";};
_unit addBackpack "rhs_rpg_empty";
for "_i" from 1 to 4 do {_unit addItemToBackpack "rhs_rpg7_PG7VL_mag";};
_unit addHeadgear "H_Cap_grn";
_unit addGoggles "G_Bandanna_aviator";
_unit addWeapon "rhs_weap_akm";
_unit addWeapon "rhs_weap_rpg7";
_unit addSecondaryWeaponItem "rhs_acc_pgo7v";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,26 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_I_G_ResistanceLeader_F";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
_unit addItemToVest "SmokeShell";
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
_unit addBackpack "B_TacticalPack_oli";
_unit addItemToVest "rhs_100Rnd_762x54mmR_green";
for "_i" from 1 to 4 do {_unit addItemToBackpack "rhs_100Rnd_762x54mmR_green";};
_unit addHeadgear "H_Watchcap_khk";
_unit addGoggles "G_Balaclava_lowprofile";
_unit addWeapon "rhs_weap_pkm";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,28 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_TacVest_camo";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 3 do { _unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 3 do { _unit addItemToVest "rhs_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do { _unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do { _unit addItemToVest "SmokeShell";};
_unit addItemToVest "Chemlight_green";
_unit addHeadgear "H_Cap_headphones";
_unit addGoggles "G_Balaclava_combat";
_unit addWeapon "rhs_weap_ak74m_camo_folded";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemRadio";

View File

@ -1,25 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_BandollierB_oli";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 10 do {_unit addItemToVest "rhs_10Rnd_762x54mmR_7N1";};
_unit addHeadgear "H_Booniehat_oli";
_unit addGoggles "G_Balaclava_lowprofile";
_unit addWeapon "rhs_weap_svdp_wd_npz";
_unit addPrimaryWeaponItem "optic_KHS_blk";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,25 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_Chestrig_oli";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 6 do {_unit addItemToVest "rhs_30Rnd_545x39_AK";};
_unit addHeadgear "H_Cap_blk";
_unit addGoggles "G_Balaclava_oli";
_unit addWeapon "rhs_weap_ak74m_camo_npz";
_unit addPrimaryWeaponItem "optic_ACO_grn";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,24 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_BandollierB_rgr";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 5 do {_unit addItemToVest "rhs_30Rnd_762x39mm";};
_unit addHeadgear "H_Bandanna_camo";
_unit addGoggles "G_Bandanna_beast";
_unit addWeapon "rhs_weap_akms";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,33 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_TacVest_oli";
for "_i" from 1 to 2 do {_unit addItemToVest "FirstAidKit";};
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "SmokeShell";};
_unit addItemToVest "Chemlight_green";
for "_i" from 1 to 2 do {_unit addItemToVest "rhs_30Rnd_545x39_AK";};
for "_i" from 1 to 4 do {_unit addItemToBackpack "rhs_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
_unit addBackpack "B_AssaultPack_rgr";
_unit addHeadgear "rhs_6b28_green";
_unit addGoggles "G_Bandanna_oli";
_unit addWeapon "rhs_weap_ak74m_camo_npz";
_unit addPrimaryWeaponItem "optic_MRCO";
_unit addWeapon "hgun_P07_F";
_unit addWeapon "Rangefinder";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemGPS";
_unit linkItem "NVGoggles_INDEP";

View File

@ -1,30 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_Chestrig_rgr";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 5 do {_unit addItemToVest "30Rnd_556x45_Stanag_Tracer_Green";};
_unit addBackpack "B_Carryall_oli";
for "_i" from 1 to 3 do {_unit addItemToBackpack "RPG32_F";};
for "_i" from 1 to 3 do {_unit addItemToBackpack "RPG32_HE_F";};
_unit addHeadgear "H_Cap_grn";
_unit addGoggles "G_Bandanna_aviator";
_unit addWeapon "arifle_TRG20_F";
_unit addPrimaryWeaponItem "optic_ACO_grn";
_unit addWeapon "launch_RPG32_F";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,25 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_I_G_ResistanceLeader_F";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
_unit addItemToVest "SmokeShell";
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
_unit addBackpack "B_TacticalPack_oli";
for "_i" from 1 to 5 do {_unit addItemToBackpack "150Rnd_762x54_Box_Tracer";};
_unit addHeadgear "H_Watchcap_khk";
_unit addGoggles "G_Balaclava_lowprofile";
_unit addWeapon "LMG_Zafir_F";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,28 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_TacVest_camo";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 3 do { _unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 3 do { _unit addItemToVest "30Rnd_9x21_Mag";};
for "_i" from 1 to 2 do { _unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do { _unit addItemToVest "SmokeShell";};
_unit addItemToVest "Chemlight_green";
_unit addHeadgear "H_Cap_headphones";
_unit addGoggles "G_Balaclava_combat";
_unit addWeapon "hgun_PDW2000_F";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemRadio";

View File

@ -1,26 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_BandollierB_oli";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 6 do {_unit addItemToVest "20Rnd_762x51_Mag";};
_unit addHeadgear "H_Booniehat_oli";
_unit addGoggles "G_Balaclava_lowprofile";
_unit addWeapon "srifle_DMR_03_woodland_F";
_unit addPrimaryWeaponItem "optic_Hamr";
_unit addPrimaryWeaponItem "bipod_03_F_oli";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,25 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_Chestrig_oli";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 6 do {_unit addItemToVest "20Rnd_762x51_Mag";};
_unit addHeadgear "H_Cap_blk";
_unit addGoggles "G_Balaclava_oli";
_unit addWeapon "srifle_DMR_06_camo_F";
_unit addPrimaryWeaponItem "optic_ACO_grn";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,24 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_BandollierB_rgr";
_unit addItemToVest "FirstAidKit";
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
for "_i" from 1 to 6 do {_unit addItemToVest "30Rnd_556x45_Stanag_Tracer_Green";};
_unit addHeadgear "H_Bandanna_camo";
_unit addGoggles "G_Bandanna_beast";
_unit addWeapon "arifle_Mk20C_F";
_unit addWeapon "hgun_P07_F";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";

View File

@ -1,32 +0,0 @@
_unit = _this select 0;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
sleep 0.5;
_unit addVest "V_TacVest_oli";
for "_i" from 1 to 2 do {_unit addItemToVest "FirstAidKit";};
for "_i" from 1 to 2 do {_unit addItemToVest "MiniGrenade";};
for "_i" from 1 to 2 do {_unit addItemToVest "SmokeShell";};
_unit addItemToVest "Chemlight_green";
for "_i" from 1 to 5 do {_unit addItemToVest "30Rnd_556x45_Stanag_Tracer_Green";};
for "_i" from 1 to 2 do {_unit addItemToVest "16Rnd_9x21_Mag";};
_unit addBackpack "B_AssaultPack_rgr";
_unit addHeadgear "H_Cap_oli_hs";
_unit addGoggles "G_Bandanna_oli";
_unit addWeapon "arifle_Mk20_F";
_unit addPrimaryWeaponItem "optic_MRCO";
_unit addWeapon "hgun_P07_F";
_unit addWeapon "Rangefinder";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemGPS";
_unit linkItem "NVGoggles_INDEP";

View File

@ -15,7 +15,7 @@ if ((alive _troup_transport) && (alive (driver _troup_transport))) then {
{
_x createUnit [_start_pos, _troupgrp,"this addMPEventHandler [""MPKilled"", {_this spawn kill_manager}]", 0.5, "private"];
} foreach ([] call F_getAdaptiveSquadComp);
} foreach (["army"] call F_getAdaptiveSquadComp);
{ _x moveInCargo _troup_transport } foreach (units _troupgrp);
while {(count (waypoints _troupgrp)) != 0} do {deleteWaypoint ((waypoints _troupgrp) select 0);};

View File

@ -24,7 +24,7 @@ while {GRLIB_endgame == 0} do {
KP_liberation_asymmetric_sectors pushBack _x;
private _hc = [] call F_lessLoadedHC;
private _ieds = round ((round (random 1)) * (round ((KP_liberation_civ_rep * -1) / 33)) * GRLIB_difficulty_modifier);
private _ieds = round ((round (random 1)) * ([] call F_cr_getMulti) * GRLIB_difficulty_modifier);
if (isNull _hc) then {
[_x, _ieds] spawn manage_asymIED;

View File

@ -88,12 +88,7 @@ while {_fuel > 0} do {
};
if (KP_liberation_asymmetric_debug > 0) then {diag_log format ["[KP LIBERATION] [ASYMMETRIC] Logistic convoy %1 ambush: resource spawning done", (_convoy select 0)];};
private _grp = createGroup GRLIB_side_resistance;
for "_i" from 1 to (4 + (random (round ((KP_liberation_civ_rep * -1) / 25))) + (random (round (KP_liberation_guerilla_strength / 25)))) do {
// GUERILLA -> Need adjusting after loadouts are finished
private _unit = _grp createUnit [selectRandom KP_liberation_guerilla_units, getPos _roadObj, [], 50, "NONE"];
[_unit] call (selectRandom [loadout_crewman, loadout_rifleman, loadout_autorifleman, loadout_rifleman_light, loadout_marksman]);
};
private _grp = [getPos _roadObj] call F_spawnGuerillaGroup;
private _waypoint = _grp addWaypoint [getPos _roadObj, 150];
_waypoint setWaypointType "SAD";

View File

@ -1,11 +1,9 @@
waitUntil { time > 1 };
waitUntil { !isNil "huron" };
private ["_KP_liberation_little_bird","_KP_liberation_little_bird_pad","_KP_liberation_boat","_KP_liberation_boat_spawn"];
waitUntil {time > 1};
waitUntil {!isNil "huron"};
for [{_i=0}, {!isNil ("littlebird_" + str _i)}, {_i = _i + 1}] do {
_KP_liberation_little_bird_pad = missionNamespace getVariable ("littlebird_" + str _i);
_KP_liberation_little_bird = KP_liberation_little_bird_classname createVehicle [((getposATL _KP_liberation_little_bird_pad) select 0),((getposATL _KP_liberation_little_bird_pad) select 1),((getposATL _KP_liberation_little_bird_pad) select 2) + 0.1];
private _KP_liberation_little_bird_pad = missionNamespace getVariable ("littlebird_" + str _i);
private _KP_liberation_little_bird = KP_liberation_little_bird_classname createVehicle [((getposATL _KP_liberation_little_bird_pad) select 0),((getposATL _KP_liberation_little_bird_pad) select 1),((getposATL _KP_liberation_little_bird_pad) select 2) + 0.1];
_KP_liberation_little_bird enableSimulationGlobal false;
_KP_liberation_little_bird allowdamage false;
_KP_liberation_little_bird setposATL [((getposATL _KP_liberation_little_bird_pad) select 0),((getposATL _KP_liberation_little_bird_pad) select 1),((getposATL _KP_liberation_little_bird_pad) select 2) + 0.1];
@ -22,8 +20,8 @@ for [{_i=0}, {!isNil ("littlebird_" + str _i)}, {_i = _i + 1}] do {
};
for [{_i=0}, {!isNil ("boat_" + str _i)}, {_i = _i + 1}] do {
_KP_liberation_boat_spawn = missionNamespace getVariable ("boat_" + str _i);
_KP_liberation_boat = KP_liberation_boat_classname createVehicle [((getposATL _KP_liberation_boat_spawn) select 0),((getposATL _KP_liberation_boat_spawn) select 1),((getposATL _KP_liberation_boat_spawn) select 2) + 0.1];
private _KP_liberation_boat_spawn = missionNamespace getVariable ("boat_" + str _i);
private _KP_liberation_boat = KP_liberation_boat_classname createVehicle [((getposATL _KP_liberation_boat_spawn) select 0),((getposATL _KP_liberation_boat_spawn) select 1),((getposATL _KP_liberation_boat_spawn) select 2) + 0.1];
_KP_liberation_boat enableSimulationGlobal false;
_KP_liberation_boat allowdamage false;
_KP_liberation_boat setposATL (getposATL _KP_liberation_boat_spawn);
@ -38,5 +36,3 @@ for [{_i=0}, {!isNil ("boat_" + str _i)}, {_i = _i + 1}] do {
_KP_liberation_boat allowdamage true;
_KP_liberation_boat setVariable ["KP_liberation_preplaced", true, true];
};
if (KP_liberation_debug) then {private _text = format ["[KP LIBERATION] [DEBUG] Startvehicle spawn done by: %1", debug_source];_text remoteExec ["diag_log",2];};

View File

@ -1,5 +1,3 @@
[] call compileFinal preprocessFileLineNumbers "scripts\loadouts\init_loadouts.sqf";
// AI
add_civ_waypoints = compileFinal preprocessFileLineNumbers "scripts\server\ai\add_civ_waypoints.sqf";
add_defense_waypoints = compileFinal preprocessFileLineNumbers "scripts\server\ai\add_defense_waypoints.sqf";

View File

@ -1,5 +1,3 @@
[] call compileFinal preprocessFileLineNumbers "scripts\loadouts\init_loadouts.sqf";
add_civ_waypoints = compileFinal preprocessFileLineNumbers "scripts\server\ai\add_civ_waypoints.sqf";
add_defense_waypoints = compileFinal preprocessFileLineNumbers "scripts\server\ai\add_defense_waypoints.sqf";
battlegroup_ai = compileFinal preprocessFileLineNumbers "scripts\server\ai\battlegroup_ai.sqf";

View File

@ -28,7 +28,7 @@ while { GRLIB_endgame == 0 } do {
if (_is_infantry) then {
_grp = createGroup GRLIB_side_enemy;
_squad = [] call F_getAdaptiveSquadComp;
_squad = ["army"] call F_getAdaptiveSquadComp;
{
_x createUnit [_sector_spawn_pos, _grp,"this addMPEventHandler [""MPKilled"", {_this spawn kill_manager}]", 0.5, "private"];
} foreach _squad;

View File

@ -78,8 +78,8 @@ _waypoint setWaypointType "CYCLE";
_waypoint setWaypointCompletionRadius 50;
private _troops_group = createGroup GRLIB_side_enemy;
{ _x createUnit [_spawnpos, _troops_group,"this addMPEventHandler [""MPKilled"", {_this spawn kill_manager}]", 0.5, "private"]; } foreach ([] call F_getAdaptiveSquadComp);
{ _x moveInCargo _troop_vehicle } foreach (units _troops_group);
{_x createUnit [_spawnpos, _troops_group,"this addMPEventHandler [""MPKilled"", {_this spawn kill_manager}]", 0.5, "private"];} foreach (["army"] call F_getAdaptiveSquadComp);
{_x moveInCargo _troop_vehicle} foreach (units _troops_group);
private _convoy_marker = createMarkerLocal [ format [ "convoymarker%1", round time], getpos _transport_vehicle ];
_convoy_marker setMarkerText (localize "STR_SECONDARY_CSAT_CONVOY");

View File

@ -36,7 +36,7 @@ private _patrolcorners = [
[ (getpos _helowreck select 0) - 40, (getpos _helowreck select 1) + 40, 0 ]
];
{ _x createUnit [ _patrolcorners select 0, _grppatrol,"this addMPEventHandler [""MPKilled"", {_this spawn kill_manager}]", 0.5, "private"]; } foreach ([] call F_getAdaptiveSquadComp);
{ _x createUnit [ _patrolcorners select 0, _grppatrol,"this addMPEventHandler [""MPKilled"", {_this spawn kill_manager}]", 0.5, "private"]; } foreach (["army"] call F_getAdaptiveSquadComp);
while {(count (waypoints _grppatrol)) != 0} do {deleteWaypoint ((waypoints _grppatrol) select 0);};
{

View File

@ -1,61 +1,60 @@
params [ "_sector" ];
private [ "_sectorpos", "_stopit", "_spawncivs", "_building_ai_max", "_infsquad", "_building_range", "_local_capture_size", "_iedcount","_combat_readiness_increase","_vehtospawn","_managed_units","_squad1", "_squad2", "_squad3", "_squad4", "_minimum_building_positions", "_popfactor", "_sector_despawn_tickets", "_opforcount" ];
params ["_sector"];
waitUntil { !isNil "combat_readiness" };
waitUntil {!isNil "combat_readiness"};
if (KP_liberation_debug) then {private _text = format ["[KP LIBERATION] [DEBUG] Sector %1 - %2 - populating start at %3", _sector, (markerText _sector), time];_text remoteExec ["diag_log",2];};
if (KP_liberation_sectorspawn_debug > 0) then {private _text = format ["[KP LIBERATION] [SECTORSPAWN] Sector %1 (%2) - manage_one_sector spawned on: %3 - time: %4", (markerText _sector), _sector, debug_source, time];_text remoteExec ["diag_log",2];};
_sectorpos = getmarkerpos _sector;
_stopit = false;
_spawncivs = false;
_building_ai_max = 0;
_infsquad = "militia";
_building_range = 50;
_local_capture_size = GRLIB_capture_size;
_iedcount = 0;
_vehtospawn = [];
_managed_units = [];
_squad1 = [];
_squad2 = [];
_squad3 = [];
_squad4 = [];
_minimum_building_positions = 5;
_sector_despawn_tickets = 12;
private _sectorpos = getmarkerpos _sector;
private _stopit = false;
private _spawncivs = false;
private _building_ai_max = 0;
private _infsquad = "militia";
private _building_range = 50;
private _local_capture_size = GRLIB_capture_size;
private _iedcount = 0;
private _vehtospawn = [];
private _managed_units = [];
private _squad1 = [];
private _squad2 = [];
private _squad3 = [];
private _squad4 = [];
private _minimum_building_positions = 5;
private _sector_despawn_tickets = 12;
private _popfactor = 1;
_popfactor = 1;
if ( GRLIB_unitcap < 1 ) then { _popfactor = GRLIB_unitcap; };
if (GRLIB_unitcap < 1) then {_popfactor = GRLIB_unitcap;};
if ( isNil "active_sectors" ) then { active_sectors = [] };
if ( _sector in active_sectors ) exitWith {};
if (_sector in active_sectors) exitWith {};
active_sectors pushback _sector; publicVariable "active_sectors";
_opforcount = [] call F_opforCap;
[ _sector, _opforcount ] call wait_to_spawn_sector;
private _opforcount = [] call F_opforCap;
[_sector, _opforcount] call wait_to_spawn_sector;
if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcount ] call F_getCorrectedSectorRange , GRLIB_side_friendly ] call F_getUnitsCount ) > 0 ) ) then {
if ((!(_sector in blufor_sectors)) && (([getmarkerpos _sector, [_opforcount] call F_getCorrectedSectorRange, GRLIB_side_friendly] call F_getUnitsCount) > 0)) then {
if ( _sector in sectors_bigtown ) then {
_vehtospawn =
[ ( [] call F_getAdaptiveVehicle ) ,
(selectRandom militia_vehicles),
(selectRandom militia_vehicles)];
_infsquad = "militia";
_squad1 = ([] call F_getAdaptiveSquadComp);
_squad2 = ([] call F_getAdaptiveSquadComp);
if ( GRLIB_unitcap >= 1) then {
_squad3 = ([] call F_getAdaptiveSquadComp);
if (_sector in sectors_bigtown) then {
if (combat_readiness > 30) then {_infsquad = "army";};
_squad1 = ([_infsquad] call F_getAdaptiveSquadComp);
_squad2 = ([_infsquad] call F_getAdaptiveSquadComp);
if (GRLIB_unitcap >= 1) then {_squad3 = ([_infsquad] call F_getAdaptiveSquadComp);};
if (GRLIB_unitcap >= 1.5) then {_squad4 = ([_infsquad] call F_getAdaptiveSquadComp);};
_vehtospawn = [(selectRandom militia_vehicles),(selectRandom militia_vehicles)];
if ((random 100) > (66 / GRLIB_difficulty_modifier)) then {_vehtospawn pushback (selectRandom militia_vehicles);};
if ((random 100) > (50 / GRLIB_difficulty_modifier)) then {_vehtospawn pushback (selectRandom militia_vehicles);};
if (_infsquad == "army") then {
_vehtospawn pushback ([] call F_getAdaptiveVehicle);
_vehtospawn pushback ([] call F_getAdaptiveVehicle);
if ((random 100) > (33 / GRLIB_difficulty_modifier)) then {_vehtospawn pushback ([] call F_getAdaptiveVehicle);};
};
if ( GRLIB_unitcap >= 1.5) then {
_squad4 = ([] call F_getAdaptiveSquadComp);
};
if((random 100) > (66 / GRLIB_difficulty_modifier)) then { _vehtospawn pushback (selectRandom militia_vehicles); };
if((random 100) > (50 / GRLIB_difficulty_modifier)) then { _vehtospawn pushback (selectRandom militia_vehicles); };
if((random 100) > (33 / GRLIB_difficulty_modifier)) then { _vehtospawn pushback ( [] call F_getAdaptiveVehicle ); };
_spawncivs = true;
_building_ai_max = round (50 * _popfactor) ;
_building_ai_max = round (50 * _popfactor);
_building_range = 200;
_local_capture_size = _local_capture_size * 1.4;
if (KP_liberation_civ_rep < 0) then {
_iedcount = round (2 + (ceil (random 4)) * (round ((KP_liberation_civ_rep * -1) / 33)) * GRLIB_difficulty_modifier);
} else {
@ -63,15 +62,28 @@ if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcou
};
if (_iedcount > 16) then {_iedcount = 16};
};
if ( _sector in sectors_capture ) then {
_vehtospawn = [];
_infsquad = "militia";
while { count _squad1 < ( 10 * _popfactor) } do { _squad1 pushback (selectRandom militia_squad) };
if((random 100) > (66 / GRLIB_difficulty_modifier)) then { _vehtospawn pushback (selectRandom militia_vehicles); };
if((random 100) > (33 / GRLIB_difficulty_modifier)) then { _vehtospawn pushback (selectRandom militia_vehicles); };
if (_sector in sectors_capture) then {
if (combat_readiness > 50) then {_infsquad = "army";};
_squad1 = ([_infsquad] call F_getAdaptiveSquadComp);
if (GRLIB_unitcap >= 1.25) then {_squad2 = ([_infsquad] call F_getAdaptiveSquadComp);};
if ((random 100) > (66 / GRLIB_difficulty_modifier)) then {_vehtospawn pushback (selectRandom militia_vehicles);};
if ((random 100) > (33 / GRLIB_difficulty_modifier)) then {_vehtospawn pushback (selectRandom militia_vehicles);};
if (_infsquad == "army") then {
_vehtospawn pushback (selectRandom militia_vehicles);
if ((random 100) > (33 / GRLIB_difficulty_modifier)) then {
_vehtospawn pushback ([] call F_getAdaptiveVehicle);
_squad3 = ([_infsquad] call F_getAdaptiveSquadComp);
};
};
_spawncivs = true;
_building_ai_max = round ((floor (18 + (round (combat_readiness / 10 )))) * _popfactor);
_building_range = 120;
if (KP_liberation_civ_rep < 0) then {
_iedcount = round ((ceil (random 4)) * (round ((KP_liberation_civ_rep * -1) / 33)) * GRLIB_difficulty_modifier);
} else {
@ -79,36 +91,41 @@ if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcou
};
if (_iedcount > 12) then {_iedcount = 12};
};
if ( _sector in sectors_military ) then {
_infsquad = "csat";
_squadies_to_spawn = ([] call F_getAdaptiveSquadComp);
_squad1 = ([] call F_getAdaptiveSquadComp);
_squad2 = ([] call F_getAdaptiveSquadComp);
if ( GRLIB_unitcap >= 1.5) then {
_squad3 = ([] call F_getAdaptiveSquadComp);
};
if ( GRLIB_unitcap >= 2) then {
_squad4 = ([] call F_getAdaptiveSquadComp);
};
if (_sector in sectors_military) then {
_infsquad = "army";
_squad1 = ([_infsquad] call F_getAdaptiveSquadComp);
_squad2 = ([_infsquad] call F_getAdaptiveSquadComp);
if (GRLIB_unitcap >= 1.5) then {_squad3 = ([_infsquad] call F_getAdaptiveSquadComp);};
_vehtospawn = [([] call F_getAdaptiveVehicle),([] call F_getAdaptiveVehicle)];
if((random 100) > (33 / GRLIB_difficulty_modifier)) then {_vehtospawn pushback ([] call F_getAdaptiveVehicle);};
if((random 100) > (66 / GRLIB_difficulty_modifier)) then {_vehtospawn pushback ([] call F_getAdaptiveVehicle);};
if ((random 100) > (33 / GRLIB_difficulty_modifier)) then {
_vehtospawn pushback ([] call F_getAdaptiveVehicle);
_squad4 = ([_infsquad] call F_getAdaptiveSquadComp);
};
if ((random 100) > (66 / GRLIB_difficulty_modifier)) then {_vehtospawn pushback ([] call F_getAdaptiveVehicle);};
_spawncivs = false;
_building_ai_max = round ((floor (18 + (round (combat_readiness / 4 )))) * _popfactor);
_building_range = 120;
};
if ( _sector in sectors_factory ) then {
_vehtospawn = [];
_infsquad = "militia";
_squad1 = ([] call F_getAdaptiveSquadComp);
if ( GRLIB_unitcap >= 1.25) then {
_squad2 = ([] call F_getAdaptiveSquadComp);
};
if((random 100) > 66) then {_vehtospawn pushback ([] call F_getAdaptiveVehicle);};
if((random 100) > 33) then {_vehtospawn pushback (selectRandom militia_vehicles);};
if (_sector in sectors_factory) then {
if (combat_readiness > 40) then {_infsquad = "army";};
_squad1 = ([_infsquad] call F_getAdaptiveSquadComp);
if (GRLIB_unitcap >= 1.25) then {_squad2 = ([_infsquad] call F_getAdaptiveSquadComp);};
if ((random 100) > 66) then {_vehtospawn pushback ([] call F_getAdaptiveVehicle);};
if ((random 100) > 33) then {_vehtospawn pushback (selectRandom militia_vehicles);};
_spawncivs = false;
_building_ai_max = round ((floor (18 + (round (combat_readiness / 10 )))) * _popfactor);
_building_range = 120;
if (KP_liberation_civ_rep < 0) then {
_iedcount = round ((ceil (random 3)) * (round ((KP_liberation_civ_rep * -1) / 33)) * GRLIB_difficulty_modifier);
} else {
@ -116,137 +133,140 @@ if ( (!(_sector in blufor_sectors)) && ( ( [ getmarkerpos _sector , [ _opforcou
};
if (_iedcount > 8) then {_iedcount = 8};
};
if ( _sector in sectors_tower ) then {
if (_sector in sectors_tower) then {
_infsquad = "army";
_squad1 = ([_infsquad] call F_getAdaptiveSquadComp);
if (combat_readiness > 30) then {_squad2 = ([_infsquad] call F_getAdaptiveSquadComp);};
if (GRLIB_unitcap >= 1.5) then {_squad3 = ([_infsquad] call F_getAdaptiveSquadComp);};
if((random 100) > 95) then {_vehtospawn pushback ([] call F_getAdaptiveVehicle);};
_spawncivs = false;
_squad1 = ([] call F_getAdaptiveSquadComp);
if ( GRLIB_unitcap >= 1.5) then {
_squad2 = ([] call F_getAdaptiveSquadComp);
};
_building_ai_max = 0;
if((random 100) > 95) then { _vehtospawn pushback ( [] call F_getAdaptiveVehicle ); };
};
if ( _building_ai_max > 0 && GRLIB_adaptive_opfor ) then {
_building_ai_max = round ( _building_ai_max * ([] call F_adaptiveOpforFactor));
if (KP_liberation_sectorspawn_debug > 0) then {private _text = format ["[KP LIBERATION] [SECTORSPAWN] Sector %1 (%2) - manage_one_sector calculated -> _infsquad: %3 - _squad1: %4 - _squad2: %5 - _squad3: %6 - _squad4: %7 - _vehtospawn: %8 - _building_ai_max: %9", (markerText _sector), _sector, _infsquad, (count _squad1), (count _squad2), (count _squad3), (count _squad4), (count _vehtospawn), (count _building_ai_max)];_text remoteExec ["diag_log",2];};
if (_building_ai_max > 0 && GRLIB_adaptive_opfor) then {
_building_ai_max = round (_building_ai_max * ([] call F_adaptiveOpforFactor));
};
{
_vehicle = [_sectorpos, _x] call F_libSpawnVehicle;
[group ((crew _vehicle) select 0 ),_sectorpos] spawn add_defense_waypoints;
[group ((crew _vehicle) select 0),_sectorpos] spawn add_defense_waypoints;
_managed_units pushback _vehicle;
{ _managed_units pushback _x; } foreach (crew _vehicle);
{_managed_units pushback _x;} foreach (crew _vehicle);
sleep 0.25;
} foreach _vehtospawn;
} forEach _vehtospawn;
if ( _building_ai_max > 0 ) then {
_allbuildings = [ nearestObjects [_sectorpos, ["House"], _building_range ], { alive _x } ] call BIS_fnc_conditionalSelect;
if (_building_ai_max > 0) then {
_allbuildings = [nearestObjects [_sectorpos, ["House"], _building_range], {alive _x}] call BIS_fnc_conditionalSelect;
_buildingpositions = [];
{
_buildingpositions = _buildingpositions + ( [_x] call BIS_fnc_buildingPositions );
} foreach _allbuildings;
if ( count _buildingpositions > _minimum_building_positions ) then {
_managed_units = _managed_units + ( [ _infsquad, _building_ai_max, _buildingpositions, _sectorpos, _sector ] call F_spawnBuildingSquad );
_buildingpositions = _buildingpositions + ([_x] call BIS_fnc_buildingPositions);
} forEach _allbuildings;
if (KP_liberation_sectorspawn_debug > 0) then {private _text = format ["[KP LIBERATION] [SECTORSPAWN] Sector %1 (%2) - manage_one_sector found %3 building positions -> _infsquad: %3 - _squad1: %4 - _squad2: %5 - _squad3: %6 - _squad4: %7 - _vehtospawn: %8 - _building_ai_max: %9", (markerText _sector), _sector, (count _buildingpositions)];_text remoteExec ["diag_log",2];};
if (count _buildingpositions > _minimum_building_positions) then {
_managed_units = _managed_units + ([_infsquad, _building_ai_max, _buildingpositions, _sectorpos, _sector] call F_spawnBuildingSquad);
};
};
_managed_units = _managed_units + ( [ _sectorpos ] call F_spawnMilitaryPostSquad );
_managed_units = _managed_units + ([_sectorpos] call F_spawnMilitaryPostSquad);
if ( count _squad1 > 0 ) then {
_grp = [ _sector, _squad1 ] call F_spawnRegularSquad;
[ _grp, _sectorpos ] spawn add_defense_waypoints;
if (count _squad1 > 0) then {
_grp = [_sector, _squad1] call F_spawnRegularSquad;
[_grp, _sectorpos] spawn add_defense_waypoints;
_managed_units = _managed_units + (units _grp);
};
if ( count _squad2 > 0 ) then {
_grp = [ _sector, _squad2 ] call F_spawnRegularSquad;
[ _grp, _sectorpos ] spawn add_defense_waypoints;
if (count _squad2 > 0) then {
_grp = [_sector, _squad2] call F_spawnRegularSquad;
[_grp, _sectorpos] spawn add_defense_waypoints;
_managed_units = _managed_units + (units _grp);
};
if ( count _squad3 > 0 ) then {
_grp = [ _sector, _squad3 ] call F_spawnRegularSquad;
[ _grp, _sectorpos ] spawn add_defense_waypoints;
if (count _squad3 > 0) then {
_grp = [_sector, _squad3] call F_spawnRegularSquad;
[_grp, _sectorpos] spawn add_defense_waypoints;
_managed_units = _managed_units + (units _grp);
};
if ( count _squad4 > 0 ) then {
_grp = [ _sector, _squad4 ] call F_spawnRegularSquad;
[ _grp, _sectorpos ] spawn add_defense_waypoints;
if (count _squad4 > 0) then {
_grp = [_sector, _squad4] call F_spawnRegularSquad;
[_grp, _sectorpos] spawn add_defense_waypoints;
_managed_units = _managed_units + (units _grp);
};
if ( _spawncivs && GRLIB_civilian_activity > 0) then {
_managed_units = _managed_units + ( [ _sector ] call F_spawnCivilians );
if (_spawncivs && GRLIB_civilian_activity > 0) then {
_managed_units = _managed_units + ([_sector] call F_spawnCivilians);
};
if (KP_liberation_debug) then {private _text = format ["[KP LIBERATION] [IED] Sector: %1 (%2) - Range: %3 - Count: %4", _sector, (markerText _sector), _building_range, _iedcount];_text remoteExec ["diag_log",2];};
[ _sector, _building_range, _iedcount ] spawn ied_manager;
if (KP_liberation_asymmetric_debug > 0) then {private _text = format ["[KP LIBERATION] [ASYMMETRIC] Sector: %1 (%2) - Range: %3 - Count: %4", (markerText _sector), _sector, _building_range, _iedcount];_text remoteExec ["diag_log",2];};
[_sector, _building_range, _iedcount] spawn ied_manager;
sleep 10;
if ( ( _sector in sectors_factory ) || (_sector in sectors_capture ) || (_sector in sectors_bigtown ) || (_sector in sectors_military ) ) then {
[_sector] remoteExec ["reinforcements_remote_call"];
if ((_sector in sectors_factory) || (_sector in sectors_capture) || (_sector in sectors_bigtown) || (_sector in sectors_military)) then {
[_sector] remoteExec ["reinforcements_remote_call",2];
};
if (KP_liberation_debug) then {private _text = format ["[KP LIBERATION] [DEBUG] Sector %1 - %2 - populating done at %3", _sector, (markerText _sector), time];_text remoteExec ["diag_log",2];};
while { !_stopit } do {
if ( ( [_sectorpos, _local_capture_size] call F_sectorOwnership == GRLIB_side_friendly ) && ( GRLIB_endgame == 0 ) ) then {
if (KP_liberation_sectorspawn_debug > 0) then {private _text = format ["[KP LIBERATION] [SECTORSPAWN] Sector: %1 (%2) - populating done at %3", (markerText _sector), _sector, time];_text remoteExec ["diag_log",2];};
while {!_stopit} do {
if (([_sectorpos, _local_capture_size] call F_sectorOwnership == GRLIB_side_friendly) && (GRLIB_endgame == 0)) then {
if (isServer) then {
[ _sector ] spawn sector_liberated_remote_call;
[_sector] spawn sector_liberated_remote_call;
} else {
[_sector] remoteExec ["sector_liberated_remote_call"];
[_sector] remoteExec ["sector_liberated_remote_call",2];
};
_stopit = true;
{ [_x] spawn prisonner_ai; } foreach ( (getmarkerpos _sector) nearEntities [ [ "Man" ], _local_capture_size * 1.2 ] );
{[_x] spawn prisonner_ai;} forEach ((getmarkerpos _sector) nearEntities [["Man"], _local_capture_size * 1.2]);
sleep 60;
active_sectors = active_sectors - [ _sector ]; publicVariable "active_sectors";
active_sectors = active_sectors - [_sector]; publicVariable "active_sectors";
sleep 600;
{
if (_x isKindOf "Man") then {
if ( side group _x != GRLIB_side_friendly ) then {
if (side group _x != GRLIB_side_friendly) then {
deleteVehicle _x;
};
} else {
[ _x ] call F_cleanOpforVehicle;
[_x] call F_cleanOpforVehicle;
};
} foreach _managed_units;
} forEach _managed_units;
} else {
if ( ( [_sectorpos, ( ( [ _opforcount ] call F_getCorrectedSectorRange ) + 300 ), GRLIB_side_friendly ] call F_getUnitsCount ) == 0 ) then {
if (([_sectorpos, (([_opforcount] call F_getCorrectedSectorRange) + 300), GRLIB_side_friendly] call F_getUnitsCount) == 0) then {
_sector_despawn_tickets = _sector_despawn_tickets - 1;
} else {
_sector_despawn_tickets = 12;
};
if ( _sector_despawn_tickets <= 0 ) then {
if (_sector_despawn_tickets <= 0) then {
{
if (_x isKindOf "Man") then {
deleteVehicle _x;
} else {
[ _x ] call F_cleanOpforVehicle;
[_x] call F_cleanOpforVehicle;
};
} foreach _managed_units;
} forEach _managed_units;
_stopit = true;
active_sectors = active_sectors - [ _sector ]; publicVariable "active_sectors";
active_sectors = active_sectors - [_sector]; publicVariable "active_sectors";
};
};
sleep 5;
};
} else {
sleep 40;
active_sectors = active_sectors - [ _sector ]; publicVariable "active_sectors";
active_sectors = active_sectors - [_sector]; publicVariable "active_sectors";
};
if (KP_liberation_debug) then {private _text = format ["[KP LIBERATION] [DEBUG] Sector %1 - %2 - dropped at %3", _sector, (markerText _sector), time];_text remoteExec ["diag_log",2];};
if (KP_liberation_sectorspawn_debug > 0) then {private _text = format ["[KP LIBERATION] [SECTORSPAWN] Sector %1 (%2) - manage_one_sector dropped on: %3", (markerText _sector), _sector, debug_source];_text remoteExec ["diag_log",2];};

View File

@ -3,13 +3,12 @@ active_sectors = [];
waitUntil {!isNil "blufor_sectors"};
waitUntil {!isNil "sectors_allSectors"};
if (KP_liberation_sectorspawn_debug > 0) then {diag_log format ["[KP LIBERATION] [SECTORSPAWN] Sector Manager started at %1", time];};
while {GRLIB_endgame == 0} do {
{
private ["_nextsector", "_opforcount"];
_nextsector = _x;
_opforcount = [] call F_opforCap;
private _nextsector = _x;
private _opforcount = [] call F_opforCap;
if (_opforcount < GRLIB_sector_cap) then {
@ -33,8 +32,14 @@ while {GRLIB_endgame == 0} do {
};
};
sleep 0.25;
} foreach (sectors_allSectors - blufor_sectors);
} forEach (sectors_allSectors - blufor_sectors);
if (KP_liberation_debug) then {private _text = format ["[KP LIBERATION] [DEBUG] Full sector scan at %1, active sectors: %2", time, active_sectors];_text remoteExec ["diag_log",2];};
if ((KP_liberation_sectorspawn_debug > 0) && ((round (time % 60)) == 0)) then {
private _current_sectors = [];
{
_current_sectors pushBack (markerText _x);
} forEach active_sectors;
diag_log format ["[KP LIBERATION] [SECTORSPAWN] Overview at %1 - active sectors: %2", time, _current_sectors];
};
sleep 1;
};

View File

@ -6,7 +6,7 @@ if (isServer) then {
_source = name player;
};
diag_log format ["[KP LIBERATION] [MISSIONSTART] Missionfile: %1 - World Name: %2 - Version: %3 - Unit Preset: %4 - Arsenal Preset: %5",(localize "STR_MISSION_TITLE"), worldName, (localize "STR_MISSION_VERSION"),KP_liberation_preset, KP_liberation_arsenal];
diag_log format ["[KP LIBERATION] [MISSIONSTART] Missionfile: %1 - World Name: %2 - Version: %3 - Blufor: %4 - Opfor: %5 - Resistance: %6 - Civilians: %7 - Arsenal Preset: %8",(localize "STR_MISSION_TITLE"), worldName, (localize "STR_MISSION_VERSION"),KP_liberation_preset_blufor, KP_liberation_preset_opfor, KP_liberation_preset_resistance, KP_liberation_preset_civilians, KP_liberation_arsenal];
while {true} do {
if (isServer) then {

View File

@ -1,41 +1,39 @@
private [ "_squadcomp", "_specialists", "_randomchance" ];
params [["_type","milita"]];
if ( isNil 'infantry_weight' ) then { infantry_weight = 33 };
if ( isNil 'armor_weight' ) then { armor_weight = 33 };
if ( isNil 'air_weight' ) then { air_weight = 33 };
private _squadcomp = [];
_squadcomp = opfor_squad_8_standard;
_specialists = false;
if (_type == "army") then {
private _specialists = false;
private _randomchance = -55;
_squadcomp = opfor_squad_8_standard;
if ( !isNil 'combat_readiness' ) then {
if ( combat_readiness < 35 ) then {
_squadcomp = opfor_squad_low_intensity;
_specialists = true;
if (armor_weight > 40 && !_specialists) then {
_randomchance = (armor_weight - 40) * 1.35;
if ((random 100) < _randomchance) then {
_specialists = true;
_squadcomp = opfor_squad_8_tankkillers;
};
};
};
if ( armor_weight > 40 && !_specialists) then {
_randomchance = (armor_weight - 40) * 1.35;
if ( (random 100) < _randomchance) then {
_specialists = true;
_squadcomp = opfor_squad_8_tankkillers;
if (air_weight > 40 && !_specialists) then {
_randomchance = (air_weight - 40) * 1.35;
if ((random 100) < _randomchance) then {
_specialists = true;
_squadcomp = opfor_squad_8_airkillers;
};
};
};
if ( air_weight > 40 && !_specialists) then {
_randomchance = (air_weight - 40) * 1.35;
if ( (random 100) < _randomchance) then {
_specialists = true;
_squadcomp = opfor_squad_8_airkillers;
};
};
if ( infantry_weight > 40 && !_specialists) then {
_randomchance = (infantry_weight - 40) * 1.35;
if ( (random 100) < _randomchance) then {
_specialists = true;
_squadcomp = opfor_squad_8_infkillers;
if (infantry_weight > 40 && !_specialists) then {
_randomchance = (infantry_weight - 40) * 1.35;
if ((random 100) < _randomchance) then {
_specialists = true;
_squadcomp = opfor_squad_8_infkillers;
};
};
} else {
private _multiplier = 1;
if (GRLIB_unitcap < 1) then {_multiplier = GRLIB_unitcap;};
while {count _squadcomp < (10 * _multiplier)} do {_squadcomp pushback (selectRandom militia_squad)};
};
_squadcomp

View File

@ -0,0 +1,20 @@
/*
F_kp_cr_getMulti.sqf
Author: Wyqer
Website: www.killahpotatoes.de
Date: 2017-10-08
Description:
Returns the current level of the civil reputation (positive or negative)
Parameters:
NONE
Return:
INTEGER - Reputation level
*/
private _reputation = if (KP_liberation_civ_rep < 0) then {KP_liberation_civ_rep * -1} else {KP_liberation_civ_rep};
private _return = floor (_reputation / 25);
if (_return == 4) then {_return = 3;};
_return

View File

@ -0,0 +1,27 @@
/*
F_kp_getResistanceTier.sqf
Author: Wyqer
Website: www.killahpotatoes.de
Date: 2017-10-08
Description:
Returns the current tier level of the resistance forces
Parameters:
NONE
Return:
INTEGER - Tier level
*/
private _return = 1;
if (KP_liberation_guerilla_strength >= KP_liberation_resistance_tier2) then {
_return = 2;
};
if (KP_liberation_guerilla_strength >= KP_liberation_resistance_tier3) then {
_return = 3;
};
_return

View File

@ -0,0 +1,61 @@
/*
F_kp_spawnGuerillaGroups.sqf
Author: Wyqer
Website: www.killahpotatoes.de
Date: 2017-10-08
Description:
Spawns a group of guerilla units with random gear depending on guerilla strength
Parameters:
_this select 0 - POSITION - Position where to spawn the group
Return:
GROUP
*/
params ["_pos"];
private _grp = createGroup GRLIB_side_resistance;
private _tier = [] call F_getResistanceTier;
private _cr_multi = [] call F_cr_getMulti;
private _amount = (4 + (round (random _cr_multi)) + (round (random _tier)));
private _weapons = missionNamespace getVariable ("KP_liberation_guerilla_weapons_" + str _tier);
private _uniforms = missionNamespace getVariable ("KP_liberation_guerilla_uniforms_" + str _tier);
private _vests = missionNamespace getVariable ("KP_liberation_guerilla_vests_" + str _tier);
private _headgear = missionNamespace getVariable ("KP_liberation_guerilla_headgear_" + str _tier);
while {(count (units _grp) < _amount)} do {
private _unit = _grp createUnit [(selectRandom KP_liberation_guerilla_units), _pos, [], 5, "NONE"];
private _weapon = selectRandom _weapons;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
_unit forceAddUniform (selectRandom _uniforms);
_unit addItemToUniform "FirstAidKit";
_unit addItemToUniform "MiniGrenade";
_unit addVest (selectRandom _vests);
for "_i" from 1 to (_weapon select 2) do {_unit addItemToVest (_weapon select 1);};
_unit addHeadgear (selectRandom _headgear);
if (_tier > 1) then {
_unit addGoggles (selectRandom KP_liberation_guerilla_facegear);
};
_unit addWeapon (_weapon select 0);
_unit addPrimaryWeaponItem (_weapon select 3);
_unit addPrimaryWeaponItem (_weapon select 4);
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemWatch";
_unit linkItem "ItemRadio";
};
_grp

View File

@ -14,10 +14,6 @@ while {count units _grp < 3} do {
{
if ( vehicle _x == _x ) then {
deleteVehicle _x;
} else {
if ( (typeof _x) in original_resistance) then {
[ _x ] call loadout_crewman;
};
};
} foreach (units _grp);

View File

@ -9,8 +9,8 @@ if (count _allposts > 0) then {
{
private _building_positions = [_x] call BIS_fnc_buildingPositions;
private _unitclasspost = opfor_marksman;
private nextunit_post = objNull;
if ( random 100 > 60 ) then {
nextunit_post = objNull;
if (random 100 > 60) then {
_unitclasspost = opfor_machinegunner;
};
_unitclasspost createUnit [_squadpos, _grp, "nextunit_post = this; this addMPEventHandler [""MPKilled"", {_this spawn kill_manager}]"];

View File

@ -51,3 +51,6 @@ F_crateCheckValue = compileFinal preprocessFileLineNumbers "scripts\shared\funct
F_sortStorage = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_sort_storage.sqf";
F_getMilitaryID = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_getMilitaryID.sqf";
F_cr_penaltyMsg = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_cr_penaltyMsg.sqf";
F_cr_getMulti = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_cr_getMulti.sqf";
F_getResistanceTier = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_getResistanceTier.sqf";
F_spawnGuerillaGroup = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_spawnGuerillaGroup.sqf";

View File

@ -179,7 +179,8 @@ class Missions
* Added: Possibility of IEDs in blufor sectors, if you have a bad civil reputation.
* Added: Own logistic convoys can be ambushed by guerilla forces.
* Added: Value for guerilla strength which will be affected by the events connected to guerilla forces.
* Added: Arrays in preset files for the guerilla forces.
* Added: Guerilla forces presets.
* Added: Dynamic guerilla forces equipment depending on their strength value.
* Added: Chinese Simplified localization. Thanks to [nercon](https://github.com/nercon)
* Added: Automatic server restart script for dedicated servers. Thanks to [k4s0](https://github.com/k4s0)
* Added: Settings in the mission parameters for particular debug messages.
@ -204,6 +205,7 @@ class Missions
* Tweaked: Replaced all deprecated `BIS_fnc_selectRandom` with the engine solution `selectRandom`.
* Tweaked: Server log will now contain the `[STATS]` message of all clients. (players and HCs)
* Tweaked: Preset system split to select blufor, opfor, resistance and civilians independently. Thanks to [Applejakerie](https://github.com/Applejakerie)
* Tweaked: Capitals, cities and factories are now basically guarded by "militia" forces. Switching to regular army if the enemy combat readiness is increased.
* Fixed: Player got custom recoil and aiming coefficients on respawn.
* Fixed: Rare script error on closing respawn screen directly after joining the mission.
* Fixed: Players could deploy multiple FOBs when they selected deploy fast enough on the same container.