From 3b2637da85dd36e346047f18a087dc4523b11e15 Mon Sep 17 00:00:00 2001 From: Robalo Date: Wed, 2 Mar 2016 02:43:01 +0200 Subject: [PATCH] asr ai 0.9.28 --- asr_ai3/addons/greenrico/config.cpp | 3 +- asr_ai3/addons/main/CfgAmmo.hpp | 9 +- asr_ai3/addons/main/CfgVehicles.hpp | 26 ---- asr_ai3/addons/main/CfgWeapons.hpp | 8 +- asr_ai3/addons/main/XEH_postInit.sqf | 4 +- asr_ai3/addons/main/XEH_preInit.sqf | 47 +++++-- asr_ai3/addons/main/fnc_addUnitToQueue.sqf | 6 +- asr_ai3/addons/main/fnc_broadcastInfo.sqf | 2 +- asr_ai3/addons/main/fnc_configLoop.sqf | 10 ++ asr_ai3/addons/main/fnc_configureUnit.sqf | 20 +-- asr_ai3/addons/main/fnc_copyMyStance.sqf | 31 +++++ asr_ai3/addons/main/fnc_countItems.sqf | 2 +- asr_ai3/addons/main/fnc_findCover.sqf | 3 +- asr_ai3/addons/main/fnc_firedEH.sqf | 2 +- asr_ai3/addons/main/fnc_getCompatMags.sqf | 7 +- asr_ai3/addons/main/fnc_getInWeaponsEH.sqf | 4 +- asr_ai3/addons/main/fnc_getNearest.sqf | 6 +- asr_ai3/addons/main/fnc_handleHit.sqf | 2 +- asr_ai3/addons/main/fnc_hasPlayer.sqf | 2 +- asr_ai3/addons/main/fnc_inventoryCheck.sqf | 3 +- asr_ai3/addons/main/fnc_inventoryClosed.sqf | 6 +- asr_ai3/addons/main/fnc_isNearStuff.sqf | 2 +- asr_ai3/addons/main/fnc_killedEH.sqf | 2 +- asr_ai3/addons/main/fnc_moveToCover.sqf | 6 +- asr_ai3/addons/main/fnc_nearFactionGroups.sqf | 2 +- asr_ai3/addons/main/fnc_pistolToPrimary.sqf | 6 +- asr_ai3/addons/main/fnc_reactDanger.sqf | 19 ++- asr_ai3/addons/main/fnc_rearm.sqf | 6 +- asr_ai3/addons/main/fnc_reveal.sqf | 2 +- asr_ai3/addons/main/fnc_sendInfo.sqf | 2 +- asr_ai3/addons/main/fnc_setSkill.sqf | 2 +- asr_ai3/addons/main/fnc_setUnitSkill.sqf | 2 +- asr_ai3/addons/main/fnc_setupGear.sqf | 4 +- asr_ai3/addons/main/fnc_shootingStance.sqf | 2 +- asr_ai3/addons/main/fnc_showHideNVG.sqf | 2 +- asr_ai3/addons/main/script_mod.hpp | 6 +- asr_ai3/addons/rhs_c/CfgAmmo.hpp | 2 +- asr_ai3/addons/rhs_us_c/CfgAmmo.hpp | 17 ++- asr_ai3/addons/rhs_us_c/CfgVehicles.hpp | 125 ++++++++++-------- 39 files changed, 226 insertions(+), 186 deletions(-) create mode 100644 asr_ai3/addons/main/fnc_configLoop.sqf create mode 100644 asr_ai3/addons/main/fnc_copyMyStance.sqf diff --git a/asr_ai3/addons/greenrico/config.cpp b/asr_ai3/addons/greenrico/config.cpp index 7f4b48f..6c8267a 100644 --- a/asr_ai3/addons/greenrico/config.cpp +++ b/asr_ai3/addons/greenrico/config.cpp @@ -33,7 +33,7 @@ PRELOAD_ADDONS; class Extended_InitPost_EventHandlers { class asdg_I_Soldier_recon_base { class ADDON { - serverInit = "(_this select 0) execVM ""\A3\Characters_F_Bootcamp\Data\Scripts\randomize_gue1.sqf"""; + init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear;};"; }; }; }; @@ -107,7 +107,6 @@ class CfgVehicles { textPlural = "$STR_A3_nameSound_veh_infantry_SF_p"; nameSound = "veh_infantry_SF_s"; vehicleClass = "MenRecon"; - sensitivity = 3.5; detectSkill = 30; ASR_AI_SKILL_SOF2; ASR_AI_COST_SPECIAL; diff --git a/asr_ai3/addons/main/CfgAmmo.hpp b/asr_ai3/addons/main/CfgAmmo.hpp index 3e82f79..efcc0fd 100644 --- a/asr_ai3/addons/main/CfgAmmo.hpp +++ b/asr_ai3/addons/main/CfgAmmo.hpp @@ -1,6 +1,5 @@ #define __AUDIBLE0 1 #define __AUDIBLE1 12 -#define __AUDIBLE2 16 #define __RANGE_HIT_FAR 1000 #define __RANGE_HIT_SMALL 5 #define __RANGE_CRACKS 100 @@ -144,22 +143,22 @@ class CfgAmmo { }; class B_127x33_Ball : BulletBase { - audibleFire = __AUDIBLE2; //12; + audibleFire = __AUDIBLE1; //12; }; class B_127x99_Ball : BulletBase { - audibleFire = __AUDIBLE2; //15; + audibleFire = __AUDIBLE1; //15; dangerRadiusBulletClose = __RANGE_CRACKS; dangerRadiusHit = __RANGE_HIT_SMALL; }; class B_127x108_Ball : BulletBase { - audibleFire = __AUDIBLE2; //48; + audibleFire = __AUDIBLE1; //15; dangerRadiusBulletClose = __RANGE_CRACKS; dangerRadiusHit = __RANGE_HIT_SMALL; }; class B_127x108_APDS : B_127x108_Ball { - audibleFire = __AUDIBLE2; //15; + audibleFire = __AUDIBLE1; //15; }; class B_19mm_HE : BulletBase { diff --git a/asr_ai3/addons/main/CfgVehicles.hpp b/asr_ai3/addons/main/CfgVehicles.hpp index 87ae698..f44aad7 100644 --- a/asr_ai3/addons/main/CfgVehicles.hpp +++ b/asr_ai3/addons/main/CfgVehicles.hpp @@ -1,21 +1,8 @@ class CfgVehicles { - class AllVehicles; - class Air : AllVehicles { - sensitivity = 6; - }; - class Helicopter_Base_H; - class Heli_Light_01_base_F : Helicopter_Base_H { - sensitivity = 6; - }; - class Heli_Light_02_base_F : Helicopter_Base_H { - sensitivity = 6; - }; - class Man; class CAManBase: Man { ASR_AI_SKILL_INS2; // default insurgent - //sensitivity = 3.0; //sensitivityEar = 0.5; audible = 0.01; //0.05 //lyingLimitSpeedHiding = 0.8; @@ -32,7 +19,6 @@ class CfgVehicles { class Civilian: CAManBase { ASR_AI_SKILL_CIV1; // default civilian ASR_AI_COST_LESS; - sensitivity = 2; minFireTime = 10; ASR_AI_CAMO_NONE; accuracy = 0.2; @@ -241,24 +227,20 @@ class CfgVehicles { class B_Soldier_sniper_base_F: B_Soldier_base_F { ASR_AI_SKILL_SNP1; ASR_AI_COST_SPECIAL; - sensitivity = 4; minFireTime = 5; ASR_AI_CAMO_GHIL; }; class B_spotter_F: B_Soldier_sniper_base_F { ASR_AI_SKILL_SOF2; ASR_AI_COST_SPECIAL; - sensitivity = 4; ASR_AI_CAMO_GHIL; }; class B_sniper_F: B_Soldier_sniper_base_F { ASR_AI_COST_SPECIAL; - sensitivity = 4; ASR_AI_CAMO_GHIL; }; class B_ghillie_base_F : B_Soldier_sniper_base_F { ASR_AI_COST_SPECIAL; - sensitivity = 4; }; // officer @@ -559,24 +541,20 @@ class CfgVehicles { class O_Soldier_sniper_base_F: O_Soldier_base_F { ASR_AI_SKILL_SNP1; ASR_AI_COST_SPECIAL; - sensitivity = 4; minFireTime = 5; ASR_AI_CAMO_GHIL; }; class O_spotter_F: O_Soldier_sniper_base_F { ASR_AI_SKILL_SOF2; ASR_AI_COST_SPECIAL; - sensitivity = 4; ASR_AI_CAMO_GHIL; }; class O_sniper_F: O_Soldier_sniper_base_F { ASR_AI_COST_SPECIAL; - sensitivity = 4; ASR_AI_CAMO_GHIL; }; class O_ghillie_base_F : O_Soldier_sniper_base_F { ASR_AI_COST_SPECIAL; - sensitivity = 4; }; // officer @@ -760,23 +738,19 @@ class CfgVehicles { class I_Soldier_sniper_base_F: I_Soldier_base_F { ASR_AI_SKILL_SNP1; ASR_AI_COST_SPECIAL; - sensitivity = 4; minFireTime = 5; ASR_AI_CAMO_GHIL; }; class I_Spotter_F: I_Soldier_sniper_base_F { ASR_AI_COST_SPECIAL; - sensitivity = 4; ASR_AI_CAMO_GHIL; }; class I_Sniper_F: I_Soldier_sniper_base_F { ASR_AI_COST_SPECIAL; - sensitivity = 4; ASR_AI_CAMO_GHIL; }; class I_ghillie_base_F : I_Soldier_sniper_base_F { ASR_AI_COST_SPECIAL; - sensitivity = 4; }; // diver diff --git a/asr_ai3/addons/main/CfgWeapons.hpp b/asr_ai3/addons/main/CfgWeapons.hpp index 5b165d8..c9192f0 100644 --- a/asr_ai3/addons/main/CfgWeapons.hpp +++ b/asr_ai3/addons/main/CfgWeapons.hpp @@ -255,7 +255,13 @@ class CfgWeapons { ASR_AI_DISP_SNIPER; }; }; - class cannon_105mm: cannon_120mm { + class cannon_125mm : CannonCore { + class player; + class close: player { + ASR_AI_DISP_SNIPER; + }; + }; + class cannon_105mm: CannonCore { class player; class close: player { ASR_AI_DISP_SNIPER; diff --git a/asr_ai3/addons/main/XEH_postInit.sqf b/asr_ai3/addons/main/XEH_postInit.sqf index 9790614..2557b6d 100644 --- a/asr_ai3/addons/main/XEH_postInit.sqf +++ b/asr_ai3/addons/main/XEH_postInit.sqf @@ -6,7 +6,7 @@ if (isServer) then { // Server, propagate settings and required functions to clients publicVariable "ASR_AI3_SETTINGS"; if (GVAR(enabled) == 1) then { - ["itemAdd", [QGVAR(cfgLoop), {while {count GVAR(configQueue) > 0} do {(GVAR(configQueue) deleteAt 0) call FUNC(configureUnit)}}, 20]] call BIS_fnc_loop; + ["itemAdd", [QGVAR(cfgLoop), {call FUNC(configLoop);}, 10]] call BIS_fnc_loop; if (GVAR(rearm) > 0) then { [] spawn { @@ -63,7 +63,5 @@ if (hasInterface) then { waitUntil {time > 5 && player == player}; //make player leader on teamswitch; prevents AI left in place from sending stupid orders if (GVAR(onteamswitch) > 0) then {onTeamSwitch {[_from,_to] call FUNC(onTeamSwitch)}}; - //Disables fatigue for AI units in player's group so they are able to keep up - if (GVAR(disableAIPGfatigue) > 0) then {{_x enableFatigue (isPlayer _x)} forEach (units group player)}; } }; diff --git a/asr_ai3/addons/main/XEH_preInit.sqf b/asr_ai3/addons/main/XEH_preInit.sqf index e486290..dba6bcf 100644 --- a/asr_ai3/addons/main/XEH_preInit.sqf +++ b/asr_ai3/addons/main/XEH_preInit.sqf @@ -1,38 +1,56 @@ //#define DEBUG_MODE_FULL +#include "\a3\editor_f\Data\Scripts\dikCodes.h" #include "script_component.hpp" LOG(MSG_INIT); if (isServer) then { - ASR_AI3_SETTINGS = compile preprocessFileLineNumbers "\userconfig\asr_ai3\asr_ai3_settings.sqf"; - if (!isNil "ASR_AI3_SETTINGS") then { - [] call ASR_AI3_SETTINGS; // Load the global defaults - }; - ASR_AI3_SETTINGS_SS = compile preprocessFileLineNumbers "\userconfig\asr_ai3\asr_ai3_settings_ss.sqf"; - if (!isNil "ASR_AI3_SETTINGS_SS") then { - [] call ASR_AI3_SETTINGS_SS; // Load the server-side defaults - }; + if (isFilePatchingEnabled) then { + ASR_AI3_SETTINGS = compile preprocessFileLineNumbers "\userconfig\asr_ai3\asr_ai3_settings.sqf"; + if (!isNil "ASR_AI3_SETTINGS") then { + [] call ASR_AI3_SETTINGS; // Load the global defaults + }; + ASR_AI3_SETTINGS_SS = compile preprocessFileLineNumbers "\userconfig\asr_ai3\asr_ai3_settings_ss.sqf"; + if (!isNil "ASR_AI3_SETTINGS_SS") then { + [] call ASR_AI3_SETTINGS_SS; // Load the server-side defaults + }; + } else { + diag_log "ASR AI3: Loading default settings, launch the game with -filePatching to enable userconfig"; + }; }; ASR_AI_SETDEFAULT(enabled,1); -ASR_AI_SETDEFAULT(radiorange,500); +ASR_AI_SETDEFAULT(radiorange,600); ASR_AI_SETDEFAULT(seekcover,1); ASR_AI_SETDEFAULT(usebuildings,0.8); ASR_AI_SETDEFAULT(getinweapons,0.5); ASR_AI_SETDEFAULT(packNVG,1); ASR_AI_SETDEFAULT(disableAIPGfatigue,1); ASR_AI_SETDEFAULT(onteamswitch,1); -ASR_AI_SETDEFAULT(copymystance,1); ASR_AI_SETDEFAULT(debug,0); ASR_AI_SETDEFAULT(setskills,1); -ASR_AI_SETDEFAULT(rearm,40); ASR_AI_SETDEFAULT(joinlast,2); ASR_AI_SETDEFAULT(removegimps,300); +ASR_AI_SETDEFAULT(rearm,40); ASR_AI_SETDEFAULT(sets,[]); ASR_AI_SETDEFAULT(levels_units,[]); ASR_AI_SETDEFAULT(factions,[]); -if (count GVAR(sets) < 10) then {GVAR(sets) = [["aiming",[1,0],"spotting",[1,0],"general",[1,0]],["aiming",[0.4,0.1],"spotting",[0.4,0.2],"general",[0.8,0.2]],["aiming",[0.35,0.1],"spotting",[0.35,0.2],"general",[0.75,0.2]],["aiming",[0.3,0.1],"spotting",[0.3,0.2],"general",[0.7,0.2]],["aiming",[0.25,0.1],"spotting",[0.25,0.2],"general",[0.65,0.2]],["aiming",[0.2,0.1],"spotting",[0.2,0.2],"general",[0.6,0.2]],["aiming",[0.15,0.1],"spotting",[0.15,0.2],"general",[0.55,0.2]],["aiming",[0.1,0.1],"spotting",[0.1,0.2],"general",[0.5,0.2]],["aiming",[0.25,0.1],"spotting",[0.5,0.2],"general",[0.7,0.2]],["aiming",[0.2,0.1],"spotting",[0.4,0.2],"general",[0.6,0.2]],["aiming",[0.6,0.4],"spotting",[0.8,0.2],"general",[0.8,0.2]]]}; +if (count GVAR(sets) < 10) then { + GVAR(sets) = [ + [ "general",[1.00,0.0], "aiming",[1.00,0.0], "spotting",[1.00,0.0] ], + [ "general",[0.90,0.1], "aiming",[0.40,0.2], "spotting",[0.40,0.1] ], + [ "general",[0.85,0.1], "aiming",[0.35,0.2], "spotting",[0.35,0.1] ], + [ "general",[0.80,0.1], "aiming",[0.30,0.1], "spotting",[0.30,0.1] ], + [ "general",[0.75,0.1], "aiming",[0.25,0.1], "spotting",[0.25,0.1] ], + [ "general",[0.70,0.1], "aiming",[0.20,0.1], "spotting",[0.20,0.1] ], + [ "general",[0.65,0.1], "aiming",[0.15,0.1], "spotting",[0.15,0.1] ], + [ "general",[0.60,0.1], "aiming",[0.10,0.1], "spotting",[0.10,0.1] ], + [ "general",[0.80,0.1], "aiming",[0.25,0.1], "spotting",[0.35,0.1] ], + [ "general",[0.70,0.1], "aiming",[0.20,0.1], "spotting",[0.30,0.1] ], + [ "general",[0.90,0.1], "aiming",[0.70,0.3], "spotting",[0.90,0.1] ] + ] +}; if (count GVAR(levels_units) < 10) then {GVAR(levels_units) = [[],[],[],[],[],[],[],[],[],[],[]]}; ASR_AI_SETDEFAULT(gunshothearing,1.1); @@ -44,6 +62,7 @@ GVAR(needmax) = [ // The level of supplies the unit will try to maintain ]; GVAR(configQueue) = []; +GVAR(copymystance) = 0; FUNC(isValidUnit) = {!(isNull _this) && {alive _this} && {!(_this isKindOf "Civilian")} && {!(_this getVariable ["asr_ai_exclude", false])}}; FUNC(isValidUnitC) = {_this call FUNC(isValidUnit) && {!(_this call FUNC(isUnc))}}; @@ -85,3 +104,7 @@ PREP(getCompatMags); PREP(countItems); PREP(inventoryCheck); PREP(rearm); +PREP(copyMyStance); +PREP(configLoop); + +["ASR AI3", "ASR AI3", ["Toggle Copy My Stance", "asr_ai3_copymystance"], {player call FUNC(copyMyStance)}, {}, [DIK_BACKSLASH, [true, true, false]]] call cba_fnc_addKeybind; diff --git a/asr_ai3/addons/main/fnc_addUnitToQueue.sqf b/asr_ai3/addons/main/fnc_addUnitToQueue.sqf index cb20321..c5fa44e 100644 --- a/asr_ai3/addons/main/fnc_addUnitToQueue.sqf +++ b/asr_ai3/addons/main/fnc_addUnitToQueue.sqf @@ -1,7 +1,5 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -if (GVAR(enabled) == 1) then { - GVAR(configQueue) pushBack _unit; -}; +if (GVAR(enabled) == 1) then {GVAR(configQueue) pushBack _unit}; diff --git a/asr_ai3/addons/main/fnc_broadcastInfo.sqf b/asr_ai3/addons/main/fnc_broadcastInfo.sqf index 818619f..c6c86f3 100644 --- a/asr_ai3/addons/main/fnc_broadcastInfo.sqf +++ b/asr_ai3/addons/main/fnc_broadcastInfo.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_grp,_info); +params ["_grp", "_info"]; private ["_leader","_recgroups"]; _leader = leader _grp; // if leader valid and not already sending and has radio diff --git a/asr_ai3/addons/main/fnc_configLoop.sqf b/asr_ai3/addons/main/fnc_configLoop.sqf new file mode 100644 index 0000000..9f54fe4 --- /dev/null +++ b/asr_ai3/addons/main/fnc_configLoop.sqf @@ -0,0 +1,10 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +while {count GVAR(configQueue) > 0} do { + (GVAR(configQueue) deleteAt 0) call FUNC(configureUnit); +}; + +if (GVAR(packNVG) == 1) then { + {_x call FUNC(setupGear)} forEach allUnits; +}; diff --git a/asr_ai3/addons/main/fnc_configureUnit.sqf b/asr_ai3/addons/main/fnc_configureUnit.sqf index 719be0e..e57bb34 100644 --- a/asr_ai3/addons/main/fnc_configureUnit.sqf +++ b/asr_ai3/addons/main/fnc_configureUnit.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; if (!isNull _unit && {alive _unit} && {!(_unit getVariable ["asr_ai_exclude", false])}) then { @@ -11,23 +11,9 @@ if (!isNull _unit && {alive _unit} && {!(_unit getVariable ["asr_ai_exclude", fa }; if (GVAR(setskills) > 0) then {_unit call FUNC(setUnitSkill)}; - if (GVAR(packNVG) == 1) then {_unit call FUNC(setupGear)}; - if (GVAR(copymystance) == 1 && {isPlayer leader _unit}) then { - _unit spawn { - private ["_lead"]; - while {alive _this} do { - _lead = leader _this; - if (isPlayer _lead && !isPlayer _this) then { - switch (stance _lead) do { - case "CROUCH": {_this setUnitPosWeak "MIDDLE"}; - case "PRONE": {_this setUnitPosWeak "DOWN"}; - default {_this setUnitPosWeak "AUTO"}; - }; - }; - sleep 2; - }; - }; + if (isPlayer leader _unit) then { + if (GVAR(disableAIPGfatigue) > 0) then {_unit enableFatigue (isPlayer _unit)}; }; _unit setVariable [QGVAR(configured),true]; diff --git a/asr_ai3/addons/main/fnc_copyMyStance.sqf b/asr_ai3/addons/main/fnc_copyMyStance.sqf new file mode 100644 index 0000000..2c3d7de --- /dev/null +++ b/asr_ai3/addons/main/fnc_copyMyStance.sqf @@ -0,0 +1,31 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +params ["_caller"]; +if (leader _caller != _caller) exitWith {hint "ASR-AI3 :: Copy My Stance : You are not the leader of the group !"; false}; + +if (GVAR(copymystance) == 0) then { + GVAR(copymystance) = 1; + { + _x spawn { + private "_leader"; + while {alive _this && GVAR(copymystance) == 1} do { + _leader = leader _this; + if (isPlayer _leader && !isPlayer _this) then { + switch (stance _leader) do { + case "CROUCH": {_this setUnitPos "MIDDLE"}; + case "PRONE": {_this setUnitPos "DOWN"}; + default {_this setUnitPos "AUTO"}; + }; + }; + sleep 2; + }; + }; + } forEach units group _caller; + hintSilent "ASR-AI3 :: Copy My Stance : Enabled"; +} else { + GVAR(copymystance) = 0; + { if (!isPlayer _x) then {_x setUnitPos "AUTO"} } forEach units group _caller; + hintSilent "ASR-AI3 :: Copy My Stance : Disabled"; +}; + +true diff --git a/asr_ai3/addons/main/fnc_countItems.sqf b/asr_ai3/addons/main/fnc_countItems.sqf index ae62626..0b1d72f 100644 --- a/asr_ai3/addons/main/fnc_countItems.sqf +++ b/asr_ai3/addons/main/fnc_countItems.sqf @@ -1,7 +1,7 @@ // return number of items that list (param 1) has from a list (param 2) //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_magpool,_check); +params ["_magpool", "_check"]; private["_m","_c"]; _c = 0; diff --git a/asr_ai3/addons/main/fnc_findCover.sqf b/asr_ai3/addons/main/fnc_findCover.sqf index 4cc11c0..49e92e3 100644 --- a/asr_ai3/addons/main/fnc_findCover.sqf +++ b/asr_ai3/addons/main/fnc_findCover.sqf @@ -1,8 +1,7 @@ // returns array with 1 cover position near unit //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_unit,_dangerobj); -DEFAULT_PARAM(2,_maxdisttocover,100); +params ["_unit", "_dangerobj", ["_maxdisttocover", 100]]; scopeName "main"; private ["_cover","_enemydist","_dangerpos","_coverpos","_debug","_fnc_debug","_bposa","_bbdim","_maxWidth","_maxLength","_maxHeight","_min","_max","_objpos","_nBuilding","_isHouse"]; diff --git a/asr_ai3/addons/main/fnc_firedEH.sqf b/asr_ai3/addons/main/fnc_firedEH.sqf index 830c6f2..66904f5 100644 --- a/asr_ai3/addons/main/fnc_firedEH.sqf +++ b/asr_ai3/addons/main/fnc_firedEH.sqf @@ -1,7 +1,7 @@ // help the AI hear weapons fired //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +params ["_shooter", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; #define _MAXREVEAL_ 1.7 //limit diff --git a/asr_ai3/addons/main/fnc_getCompatMags.sqf b/asr_ai3/addons/main/fnc_getCompatMags.sqf index 3a7b04f..074ed1f 100644 --- a/asr_ai3/addons/main/fnc_getCompatMags.sqf +++ b/asr_ai3/addons/main/fnc_getCompatMags.sqf @@ -1,13 +1,12 @@ +// return array with all compatible mags for a weapon's main muzzle //#define DEBUG_MODE_FULL #include "script_component.hpp" - -// return array with all compatible mags for a weapon's main muzzle -PARAMS_1(_w); +params ["_w"]; private["_mags","_compat","_find"]; _compat = []; _find = { - PARAMS_2(_needle,_haystack); + params ["_needle", "_haystack"]; ({_needle == _x} count _haystack) > 0 }; diff --git a/asr_ai3/addons/main/fnc_getInWeaponsEH.sqf b/asr_ai3/addons/main/fnc_getInWeaponsEH.sqf index 8fb4020..69ee28c 100644 --- a/asr_ai3/addons/main/fnc_getInWeaponsEH.sqf +++ b/asr_ai3/addons/main/fnc_getInWeaponsEH.sqf @@ -1,7 +1,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_4(_veh,_pos,_unit,_turret); -if (isPlayer _unit || {_unit == missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]}) exitWith {}; +params ["_veh", "_pos", "_unit", "_turret"]; +if ([group _unit] call FUNC(hasPlayer) || {_unit == missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]}) exitWith {}; private "_time2leave"; _time2leave = time + 300 + (random 300); while {count (_veh magazinesTurret _turret) > 0 && {time < _time2leave}} do {sleep 10}; diff --git a/asr_ai3/addons/main/fnc_getNearest.sqf b/asr_ai3/addons/main/fnc_getNearest.sqf index 6c1f052..cb858f2 100644 --- a/asr_ai3/addons/main/fnc_getNearest.sqf +++ b/asr_ai3/addons/main/fnc_getNearest.sqf @@ -1,10 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" - -PARAMS_2(_position,_array); - -DEFAULT_PARAM(2,_radius,10^5); -DEFAULT_PARAM(3,_code,{true}); +params ["_position", "_array", ["_radius", 10^5], ["_code", {true}]]; private "_return"; _return = if (count _this > 2) then {[]} else {objNull}; diff --git a/asr_ai3/addons/main/fnc_handleHit.sqf b/asr_ai3/addons/main/fnc_handleHit.sqf index 0adab09..dc6698d 100644 --- a/asr_ai3/addons/main/fnc_handleHit.sqf +++ b/asr_ai3/addons/main/fnc_handleHit.sqf @@ -1,7 +1,7 @@ //hit EH: remove gimps; switch to combat; go to cover //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_unit,_hitman); +params ["_unit", "_hitman"]; if (!(isPlayer _unit) && {_unit call FUNC(isValidUnitC)} && {_unit != missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]}) then { // move to cover diff --git a/asr_ai3/addons/main/fnc_hasPlayer.sqf b/asr_ai3/addons/main/fnc_hasPlayer.sqf index 66fcbf2..e22764c 100644 --- a/asr_ai3/addons/main/fnc_hasPlayer.sqf +++ b/asr_ai3/addons/main/fnc_hasPlayer.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_grp); +params ["_grp"]; private "_hasPlayer"; _hasPlayer = false; diff --git a/asr_ai3/addons/main/fnc_inventoryCheck.sqf b/asr_ai3/addons/main/fnc_inventoryCheck.sqf index 6bd1ac2..ef22135 100644 --- a/asr_ai3/addons/main/fnc_inventoryCheck.sqf +++ b/asr_ai3/addons/main/fnc_inventoryCheck.sqf @@ -1,7 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_unit); - +params ["_unit"]; private["_fa","_nt","_w"]; #define __m_primary_1 0 diff --git a/asr_ai3/addons/main/fnc_inventoryClosed.sqf b/asr_ai3/addons/main/fnc_inventoryClosed.sqf index 8302127..8408b40 100644 --- a/asr_ai3/addons/main/fnc_inventoryClosed.sqf +++ b/asr_ai3/addons/main/fnc_inventoryClosed.sqf @@ -1,6 +1,4 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_unit); -if (!(isPlayer _unit) && {local _unit} && {_unit call FUNC(isValidUnitC)}) then { - _unit call FUNC(pistolToPrimary); -}; +params ["_unit"]; +if (!(isPlayer _unit) && {local _unit} && {_unit call FUNC(isValidUnitC)}) then {_unit call FUNC(pistolToPrimary)}; diff --git a/asr_ai3/addons/main/fnc_isNearStuff.sqf b/asr_ai3/addons/main/fnc_isNearStuff.sqf index 7a703c2..a3df998 100644 --- a/asr_ai3/addons/main/fnc_isNearStuff.sqf +++ b/asr_ai3/addons/main/fnc_isNearStuff.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_3(_unit,_places,_distance); +params ["_unit", "_places", "_distance"]; private ["_nearSomething","_sbp"]; _nearSomething = false; _sbp = selectBestPlaces [(getPosASL _unit),_distance,_places,1,1]; diff --git a/asr_ai3/addons/main/fnc_killedEH.sqf b/asr_ai3/addons/main/fnc_killedEH.sqf index f94f50b..64eb724 100644 --- a/asr_ai3/addons/main/fnc_killedEH.sqf +++ b/asr_ai3/addons/main/fnc_killedEH.sqf @@ -18,7 +18,7 @@ _remaining = count _units; if (_remaining == 0) exitWith {LOG("Group is empty, exiting")}; // reduce morale for all remaining units -{ _x setskill ["courage",(_x skill "courage")-0.025] } forEach _units; +{ _x setskill ["courage",(_x skill "courage")-0.05] } forEach _units; // if one of them is a player, do nothing if (_grp call FUNC(hasPlayer)) exitWith {LOG("Group with player, exiting")}; diff --git a/asr_ai3/addons/main/fnc_moveToCover.sqf b/asr_ai3/addons/main/fnc_moveToCover.sqf index fc00f33..9d32e65 100644 --- a/asr_ai3/addons/main/fnc_moveToCover.sqf +++ b/asr_ai3/addons/main/fnc_moveToCover.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_3(_unit,_source,_distance); +params ["_unit", "_source", "_distance"]; #define __DELAY_ 60 @@ -39,7 +39,7 @@ if (_mToCover) then { if (_mToCover && {count _cpa > 0}) then { [_unit,_cpa,_time] spawn { - PARAMS_3(_unit,_cpa,_until); + params ["_unit", "_cpa", "_until"]; private ["_grp","_speed","_cover"]; _cover = [_cpa] call BIS_fnc_arrayShift; // get first cover pos out of array TRACE_2("Choose cover",_cover,_cpa); @@ -52,7 +52,7 @@ if (_mToCover && {count _cpa > 0}) then { { if (_x != _unit) then {_x doFollow _unit} } forEach (units _grp); _grp setSpeedMode "FULL"; [_unit,_grp,_until,_speed,_cover] spawn { - PARAMS_5(_unit,_grp,_until,_speed,_cover); + params ["_unit", "_grp", "_until", "_speed", "_cover"]; waitUntil {!alive _unit || {time > _until + __DELAY_} || {_unit distance _cover < 1}}; _grp lockwp false; {[_x] joinSilent _grp} forEach (units _grp); diff --git a/asr_ai3/addons/main/fnc_nearFactionGroups.sqf b/asr_ai3/addons/main/fnc_nearFactionGroups.sqf index fa23dc5..f35d590 100644 --- a/asr_ai3/addons/main/fnc_nearFactionGroups.sqf +++ b/asr_ai3/addons/main/fnc_nearFactionGroups.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_group,_range); +params ["_group", "_range"]; private ["_leader","_faction","_rg"]; _leader = leader _group; _faction = faction _leader; diff --git a/asr_ai3/addons/main/fnc_pistolToPrimary.sqf b/asr_ai3/addons/main/fnc_pistolToPrimary.sqf index 262cc79..7145306 100644 --- a/asr_ai3/addons/main/fnc_pistolToPrimary.sqf +++ b/asr_ai3/addons/main/fnc_pistolToPrimary.sqf @@ -1,7 +1,5 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; _pw = primaryWeapon _unit; -if (_pw != "" && {_pw != currentWeapon _unit}) then { - _unit action ["handGunOff", _unit]; -}; +if (_pw != "" && {_pw != currentWeapon _unit}) then {_unit action ["handGunOff", _unit]}; diff --git a/asr_ai3/addons/main/fnc_reactDanger.sqf b/asr_ai3/addons/main/fnc_reactDanger.sqf index 58eeb51..c2de5e3 100644 --- a/asr_ai3/addons/main/fnc_reactDanger.sqf +++ b/asr_ai3/addons/main/fnc_reactDanger.sqf @@ -1,14 +1,14 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_unit,_dangerCausedBy); +params ["_unit", "_dangerCausedBy"]; private ["_coverRange","_grp","_bpos","_dude"]; _grp = group _unit; _time = time; -if (unitReady _unit && {!(_grp call FUNC(hasPlayer))} && {_time > (_unit getVariable [QGVAR(reacting),0]) + 30}) then { +if (unitReady _unit && {!(_grp call FUNC(hasPlayer))} && {_time > (_unit getVariable [QGVAR(reacting),0]) + 20}) then { - _unit setVariable [QGVAR(reacting),_time,false]; //save last time we ran this for this unit, so we don't run more than twice per minute / unit + _unit setVariable [QGVAR(reacting),_time,false]; //save last time we ran this for this unit, so we don't run more than thrice per minute / unit // mount weapons if (random 1 < GVAR(getinweapons)) then { @@ -19,7 +19,7 @@ if (unitReady _unit && {!(_grp call FUNC(hasPlayer))} && {_time > (_unit getVari _wc = count _weapons; if (_wc > 0) then { { //get some units to man the weapons - if (_wc > 0 && {_x != _leader} && {random 1 < 0.8}) then { + if (_wc > 0 && {_x != _leader} && {getSuppression _x < 0.4} && {random 1 < 0.8}) then { DEC(_wc); _weap = _weapons select _wc; _ehid = _weap getVariable [QGVAR(getInWeaponsEH), -1]; @@ -28,7 +28,7 @@ if (unitReady _unit && {!(_grp call FUNC(hasPlayer))} && {_time > (_unit getVari _weap setVariable [QGVAR(getInWeaponsEH), _ehid]; }; _mc = _weap getVariable [QGVAR(mountcount), 0]; - if (_mc < ceil (2 + random 4)) then { // mount up to a few times + if (_mc < ceil (2 + random 5)) then { // mount up to a few times doStop _x; _x assignAsGunner _weap; [_x] orderGetIn true; @@ -45,7 +45,7 @@ if (unitReady _unit && {!(_grp call FUNC(hasPlayer))} && {_time > (_unit getVari _dude = _unit; //pick another dude if possible {if (_x != _unit) exitWith {_dude = _x}} forEach units _grp; - if (_dude getVariable [QGVAR(housing),false]) exitWith {}; + if (_dude getVariable [QGVAR(housing),false]) exitWith {}; _bpos = []; { { @@ -55,16 +55,15 @@ if (unitReady _unit && {!(_grp call FUNC(hasPlayer))} && {_time > (_unit getVari if (count _bpos > 0) then { _bpos sort false; //prefer higher positions [_dude,(_time + 300),_bpos] spawn { - PARAMS_3(_dude,_dangerUntil,_bpos); + params ["_dude", "_dangerUntil", "_bpos"]; private "_timeout"; _dude setVariable [QGVAR(housing),true,false]; TRACE_1("House search duty",_dude); while {count _bpos > 0 && {time < _dangerUntil} && {_dude call FUNC(isValidUnitC)}} do { - waitUntil {isNil {_dude getVariable QGVAR(shooting)}}; // stopped shooting + waitUntil {isNil {_dude getVariable QGVAR(shooting)} && {getSuppression _dude < 0.4}}; //stopped shooting and not suppressed doStop _dude; _dude doMove (([_bpos] call BIS_fnc_arrayShift) select 1); - _timeout = time + 60; - waitUntil {unitReady _dude || {_timeout < time}}; + waitUntil {unitReady _dude}; //reached pos if (_dude call FUNC(isUnderRoof)) then {_dude setUnitPosWeak "Up"} else {_dude setUnitPosWeak "Auto"}; doStop _dude; sleep (5 + random 20); diff --git a/asr_ai3/addons/main/fnc_rearm.sqf b/asr_ai3/addons/main/fnc_rearm.sqf index 1ee84dc..e2815ef 100644 --- a/asr_ai3/addons/main/fnc_rearm.sqf +++ b/asr_ai3/addons/main/fnc_rearm.sqf @@ -1,8 +1,8 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" - -PARAMS_1(_unit); +params ["_unit"]; private["_to","_need","_leaderpos","_search","_lootchkcnt","_lootchktime","_checkit"]; + if (_unit getVariable[QGVAR(inprogress),false]) exitWith {}; if (isPlayer _unit || {getText (configFile >> "cfgVehicles" >> (typeOf _unit) >> "genericNames") == "VRMen"}) exitWith {}; @@ -68,7 +68,7 @@ if (GVAR(debug) == 1) then {diag_log format ["%1 | %2 | [REARM] Places to loot: } forEach _search; [_unit,_leaderpos] spawn { - PARAMS_2(_unit,_pos); + params ["_unit", "_pos"]; private ["_group"]; _group = group _unit; _unit doWatch objNull; diff --git a/asr_ai3/addons/main/fnc_reveal.sqf b/asr_ai3/addons/main/fnc_reveal.sqf index b166cfd..bcc359e 100644 --- a/asr_ai3/addons/main/fnc_reveal.sqf +++ b/asr_ai3/addons/main/fnc_reveal.sqf @@ -1,7 +1,7 @@ //rx gain knowledge about tx based on audible range, distance and environment //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_4(_rx,_tx,_k,_r); +params ["_rx", "_tx", "_k", "_r"]; _k = _k * (1 - ((_tx distance _rx)/_r)); // when in forest/houses/rain/wind/night, not so accurate if ([_rx,"(forest + houses)",2] call FUNC(isNearStuff)) then {_k = _k * 0.75}; diff --git a/asr_ai3/addons/main/fnc_sendInfo.sqf b/asr_ai3/addons/main/fnc_sendInfo.sqf index 0860c9a..940744d 100644 --- a/asr_ai3/addons/main/fnc_sendInfo.sqf +++ b/asr_ai3/addons/main/fnc_sendInfo.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_3(_sender,_rxgrp,_target); +params ["_sender", "_rxgrp", "_target"]; if (isNull _sender || isNull _rxgrp || isNull _target) exitWith {LOG("Error: at least one parameter was null")}; private ["_knowledge","_rxleader"]; _knowledge = _sender knowsAbout _target; diff --git a/asr_ai3/addons/main/fnc_setSkill.sqf b/asr_ai3/addons/main/fnc_setSkill.sqf index 3cfb313..b0fe64e 100644 --- a/asr_ai3/addons/main/fnc_setSkill.sqf +++ b/asr_ai3/addons/main/fnc_setSkill.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_unit,_skillset); +params ["_unit", "_skillset"]; _unit setSkill _skillset; if (GVAR(debug) > 0) then { private "_type"; _type = _skillset select 0; diff --git a/asr_ai3/addons/main/fnc_setUnitSkill.sqf b/asr_ai3/addons/main/fnc_setUnitSkill.sqf index 3847f3a..470f64d 100644 --- a/asr_ai3/addons/main/fnc_setUnitSkill.sqf +++ b/asr_ai3/addons/main/fnc_setUnitSkill.sqf @@ -1,8 +1,8 @@ // sets random skill depending on unit's class //#define DEBUG_MODE_FULL #include "script_component.hpp" +params ["_unit"]; private["_t","_sc","_sa","_i","_st","_sv","_fc","_fnc_getskillvalue"]; -PARAMS_1(_unit); _fnc_getskillvalue = { private["_sv","_min","_var"]; diff --git a/asr_ai3/addons/main/fnc_setupGear.sqf b/asr_ai3/addons/main/fnc_setupGear.sqf index da61796..a5be77c 100644 --- a/asr_ai3/addons/main/fnc_setupGear.sqf +++ b/asr_ai3/addons/main/fnc_setupGear.sqf @@ -1,7 +1,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; if (!isPlayer _unit && {_unit call FUNC(isValidUnit)}) then { - if (GVAR(packNVG) == 1) then {[_unit,(sunOrMoon < 1)] call FUNC(showHideNVG)}; // show NVG ? yeah, but only if it's dark + [_unit,(sunOrMoon < 1)] call FUNC(showHideNVG); // show NVG ? yeah, but only if it's dark }; diff --git a/asr_ai3/addons/main/fnc_shootingStance.sqf b/asr_ai3/addons/main/fnc_shootingStance.sqf index cac2648..6ab9b39 100644 --- a/asr_ai3/addons/main/fnc_shootingStance.sqf +++ b/asr_ai3/addons/main/fnc_shootingStance.sqf @@ -6,7 +6,7 @@ if (_this getVariable [QGVAR(shooting), false]) exitWith {}; // already shooting _wpntype = (primaryWeapon _this) call FUNC(getWeaponType); if ((_wpntype == "MG" || _wpntype == "SNIPER") && {count ((getPosATL _this) nearObjects ["HouseBase", 3]) == 0}) then { _this spawn { - PARAMS_1(_unit); + params ["_unit"]; private "_t"; _t = time; _unit setVariable [QGVAR(shooting), true]; diff --git a/asr_ai3/addons/main/fnc_showHideNVG.sqf b/asr_ai3/addons/main/fnc_showHideNVG.sqf index 2b4698d..410ab67 100644 --- a/asr_ai3/addons/main/fnc_showHideNVG.sqf +++ b/asr_ai3/addons/main/fnc_showHideNVG.sqf @@ -1,6 +1,6 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_unit,_show); +params ["_unit", "_show"]; private ["_nvg","_eyew"]; _nvg = ""; diff --git a/asr_ai3/addons/main/script_mod.hpp b/asr_ai3/addons/main/script_mod.hpp index 6553769..0644c92 100644 --- a/asr_ai3/addons/main/script_mod.hpp +++ b/asr_ai3/addons/main/script_mod.hpp @@ -1,11 +1,11 @@ #define PREFIX asr_ai3 #define MAJOR 0 #define MINOR 9 -#define PATCHLVL 27 -#define BUILD 85 +#define PATCHLVL 28 +#define BUILD 88 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 1.48 +#define REQUIRED_VERSION 1.56 diff --git a/asr_ai3/addons/rhs_c/CfgAmmo.hpp b/asr_ai3/addons/rhs_c/CfgAmmo.hpp index 629d4c2..10f55db 100644 --- a/asr_ai3/addons/rhs_c/CfgAmmo.hpp +++ b/asr_ai3/addons/rhs_c/CfgAmmo.hpp @@ -20,7 +20,7 @@ class CfgAmmo { }; class rhs_ammo_M136_rocket : RocketBase { audibleFire = __AUDIBLE2; //16; - allowAgainstInfantry = 0; + //allowAgainstInfantry = 0; airLock = 1; //yes on air }; class rhs_B_545x39_Ball: B_556x45_Ball { diff --git a/asr_ai3/addons/rhs_us_c/CfgAmmo.hpp b/asr_ai3/addons/rhs_us_c/CfgAmmo.hpp index 246e4b2..23bca95 100644 --- a/asr_ai3/addons/rhs_us_c/CfgAmmo.hpp +++ b/asr_ai3/addons/rhs_us_c/CfgAmmo.hpp @@ -1,6 +1,5 @@ #define __AUDIBLE0 1 #define __AUDIBLE1 12 -#define __AUDIBLE2 16 #define __RANGE_HIT_FAR 1000 #define __RANGE_HIT_SMALL 5 #define __RANGE_CRACKS 100 @@ -28,7 +27,7 @@ class CfgAmmo { suppressionRadiusHit = 8; }; class rhsusf_M33_Ball_M107 : BulletBase { - audibleFire = __AUDIBLE2; + audibleFire = __AUDIBLE1; dangerRadiusBulletClose = __RANGE_CRACKS; dangerRadiusHit = __RANGE_HIT_SMALL; suppressionRadiusBulletClose = 8; @@ -57,11 +56,21 @@ class CfgAmmo { dangerRadiusHit = __RANGE_HIT_SMALL; suppressionRadiusBulletClose = 1; }; + class rhs_ammo_9x19_FMJ : BulletBase { + audibleFire = __AUDIBLE1; //3; + dangerRadiusBulletClose = __RANGE_CRACKS; + dangerRadiusHit = __RANGE_HIT_SMALL; + }; + class rhs_ammo_9x19_JHP : BulletBase { + audibleFire = __AUDIBLE1; //3; + dangerRadiusBulletClose = __RANGE_CRACKS; + dangerRadiusHit = __RANGE_HIT_SMALL; + }; class RocketBase; class rhs_ammo_M136_rocket : RocketBase { - audibleFire = __AUDIBLE2; //16; - allowAgainstInfantry = 0; + audibleFire = __AUDIBLE1; //16; + //allowAgainstInfantry = 0; airLock = 1; //yes on air }; }; diff --git a/asr_ai3/addons/rhs_us_c/CfgVehicles.hpp b/asr_ai3/addons/rhs_us_c/CfgVehicles.hpp index 323853b..e2b1ffb 100644 --- a/asr_ai3/addons/rhs_us_c/CfgVehicles.hpp +++ b/asr_ai3/addons/rhs_us_c/CfgVehicles.hpp @@ -6,12 +6,12 @@ class CfgVehicles { class rhsusf_infantry_army_base : SoldierWB { ASR_AI_SKILL_REG2; - - ASR_AI_COST_REG; ASR_AI_CAMO_FULL; + minFireTime = 7; ASR_AI_AMMOCOEF_STANDARD; + ASR_AI_COST_REG; }; - class rhsusf_army_ocp_rifleman; + class rhsusf_army_ocp_rifleman; class rhsusf_army_ocp_riflemanl : rhsusf_army_ocp_rifleman { ASR_AI_CAMO_FULL; ASR_AI_COST_REG; @@ -20,23 +20,18 @@ class CfgVehicles { ASR_AI_AMMOCOEF_AT; ASR_AI_COST_REG; }; - class rhsusf_army_ocp_aa : rhsusf_army_ocp_riflemanat { - ASR_AI_AMMOCOEF_AT; + class rhsusf_army_ocp_grenadier : rhsusf_infantry_army_base { ASR_AI_COST_REG; - ASR_AI_CAMO_FULL; }; class rhsusf_army_ocp_autorifleman : rhsusf_infantry_army_base { ASR_AI_COST_REG; }; class rhsusf_army_ocp_autoriflemana : rhsusf_army_ocp_rifleman { - ASR_AI_COST_REG; ASR_AI_CAMO_FULL; + ASR_AI_COST_REG; }; class rhsusf_army_ocp_machinegunnera : rhsusf_army_ocp_rifleman { - ASR_AI_COST_REG; ASR_AI_CAMO_FULL; - }; - class rhsusf_army_ocp_grenadier : rhsusf_infantry_army_base { ASR_AI_COST_REG; }; class rhsusf_army_ocp_officer : rhsusf_infantry_army_base { @@ -53,20 +48,6 @@ class CfgVehicles { ASR_AI_CAMO_FULL; ASR_AI_COST_REG; }; - class rhsusf_army_ocp_marksman : rhsusf_infantry_army_base { - ASR_AI_SKILL_REG1; - - ASR_AI_COST_REG; - ASR_AI_AMMOCOEF_SNIPER; - }; - class rhsusf_army_ocp_sniper : rhsusf_army_ocp_marksman { - ASR_AI_SKILL_SNP1; - ASR_AI_COST_SPECIAL; - ASR_AI_AMMOCOEF_SNIPER; - ASR_AI_CAMO_FULL; - sensitivity = 4; - minFireTime = 5; - }; class rhsusf_army_ocp_jfo : rhsusf_infantry_army_base { ASR_AI_SKILL_REG1; ASR_AI_COST_SPECIAL; @@ -79,6 +60,11 @@ class CfgVehicles { ASR_AI_CAMO_FULL; ASR_AI_COST_REG; }; + class rhsusf_army_ocp_aa : rhsusf_army_ocp_riflemanat { + ASR_AI_CAMO_FULL; + ASR_AI_COST_REG; + ASR_AI_AMMOCOEF_AT; + }; class rhsusf_army_ocp_engineer : rhsusf_army_ocp_rifleman { ASR_AI_CAMO_FULL; ASR_AI_COST_REG; @@ -87,24 +73,35 @@ class CfgVehicles { ASR_AI_CAMO_FULL; ASR_AI_COST_REG; }; - class rhsusf_army_ocp_helipilot : rhsusf_infantry_army_base { - ASR_AI_SKILL_PIL1; - ASR_AI_CAMO_FULL; + class rhsusf_army_ocp_marksman : rhsusf_infantry_army_base { + ASR_AI_SKILL_REG1; ASR_AI_COST_REG; + ASR_AI_AMMOCOEF_SNIPER; + }; + class rhsusf_army_ocp_sniper : rhsusf_army_ocp_marksman { + ASR_AI_SKILL_SNP1; + ASR_AI_COST_SPECIAL; + ASR_AI_AMMOCOEF_SNIPER; + ASR_AI_CAMO_FULL; + minFireTime = 5; }; class rhsusf_army_ocp_crewman : rhsusf_infantry_army_base { ASR_AI_CAMO_FULL; ASR_AI_COST_REG; }; + class rhsusf_army_ocp_helipilot : rhsusf_infantry_army_base { + ASR_AI_SKILL_PIL1; + ASR_AI_CAMO_FULL; + ASR_AI_COST_REG; + }; class rhsusf_army_ocp_helicrew : rhsusf_army_ocp_helipilot { ASR_AI_COST_REG; }; - //US MC class rhsusf_infantry_usmc_base; - class rhsusf_usmc_marpat_wd_rifleman; + class rhsusf_usmc_marpat_wd_rifleman; class rhsusf_usmc_marpat_wd_rifleman_light : rhsusf_usmc_marpat_wd_rifleman { ASR_AI_CAMO_FULL; ASR_AI_COST_REG; @@ -144,12 +141,11 @@ class CfgVehicles { ASR_AI_CAMO_FULL; ASR_AI_COST_REG; }; - class rhsusf_usmc_marpat_wd_fso : rhsusf_usmc_marpat_wd_rifleman { + class rhsusf_usmc_marpat_wd_jfo : rhsusf_usmc_marpat_wd_rifleman { ASR_AI_SKILL_REG1; - ASR_AI_COST_SPECIAL; }; - class rhsusf_usmc_marpat_wd_jfo : rhsusf_usmc_marpat_wd_rifleman { + class rhsusf_usmc_marpat_wd_fso : rhsusf_usmc_marpat_wd_rifleman { ASR_AI_SKILL_REG1; ASR_AI_COST_SPECIAL; }; @@ -180,14 +176,12 @@ class CfgVehicles { ASR_AI_COST_SPECIAL; ASR_AI_CAMO_FULL; ASR_AI_AMMOCOEF_STANDARD; - sensitivity = 4; }; class rhsusf_usmc_marpat_wd_sniper : rhsusf_usmc_marpat_wd_marksman { ASR_AI_SKILL_SNP1; ASR_AI_COST_SPECIAL; ASR_AI_CAMO_FULL; ASR_AI_AMMOCOEF_SNIPER; - sensitivity = 4; minFireTime = 5; }; class rhsusf_usmc_marpat_wd_crewman : rhsusf_infantry_usmc_base { @@ -203,16 +197,54 @@ class CfgVehicles { ASR_AI_COST_REG; }; +// USMC LAR + + class rhsusf_usmc_lar_marpat_wd_rifleman : rhsusf_usmc_marpat_wd_rifleman { + ASR_AI_SKILL_REG1; + }; + class rhsusf_usmc_lar_marpat_wd_rifleman_light : rhsusf_usmc_lar_marpat_wd_rifleman { + ASR_AI_CAMO_FULL; + ASR_AI_COST_REG; + }; + class rhsusf_usmc_lar_marpat_wd_riflemanat : rhsusf_usmc_lar_marpat_wd_rifleman { + ASR_AI_CAMO_FULL; + ASR_AI_COST_REG; + ASR_AI_AMMOCOEF_AT; + }; + class rhsusf_usmc_lar_marpat_wd_grenadier_m32 : rhsusf_usmc_lar_marpat_wd_rifleman { + ASR_AI_COST_REG; + }; + class rhsusf_usmc_lar_marpat_wd_autorifleman : rhsusf_infantry_usmc_base { + ASR_AI_SKILL_REG1; + ASR_AI_COST_REG; + }; + class rhsusf_usmc_lar_marpat_wd_squadleader : rhsusf_usmc_lar_marpat_wd_rifleman { + ASR_AI_CAMO_FULL; + ASR_AI_COST_REG; + }; + class rhsusf_usmc_lar_marpat_wd_teamleader : rhsusf_infantry_usmc_base { + ASR_AI_SKILL_REG1; + ASR_AI_CAMO_FULL; + ASR_AI_COST_REG; + }; + class rhsusf_usmc_lar_marpat_wd_marksman : rhsusf_usmc_lar_marpat_wd_rifleman { + ASR_AI_COST_REG; + ASR_AI_AMMOCOEF_SNIPER; + }; + class rhsusf_usmc_lar_marpat_wd_crewman : rhsusf_infantry_usmc_base { + ASR_AI_SKILL_REG1; + ASR_AI_CAMO_FULL; + ASR_AI_COST_REG; + }; //USMC FR class rhsusf_infantry_usmc_fr_base : rhsusf_infantry_usmc_base { ASR_AI_SKILL_SOF2; - ASR_AI_COST_SPECIAL; minFireTime = 5; }; - class rhsusf_usmc_fr_marpat_wd_rifleman; + class rhsusf_usmc_fr_marpat_wd_rifleman; class rhsusf_usmc_fr_marpat_wd_riflemanat : rhsusf_usmc_fr_marpat_wd_rifleman { ASR_AI_AMMOCOEF_AT; }; @@ -228,30 +260,25 @@ class CfgVehicles { }; class rhsusf_usmc_fr_marpat_wd_spotter : rhsusf_usmc_fr_marpat_wd_marksman { ASR_AI_AMMOCOEF_STANDARD; - sensitivity = 4; }; class rhsusf_usmc_fr_marpat_wd_sniper : rhsusf_usmc_fr_marpat_wd_marksman { ASR_AI_SKILL_SNP1; - ASR_AI_AMMOCOEF_SNIPER; - sensitivity = 4; }; //MARSOC class rhsusf_socom_marsoc_base : rhsusf_infantry_usmc_base { ASR_AI_SKILL_SOF1; - ASR_AI_COST_SPECIAL; ASR_AI_CAMO_FULL; minFireTime = 5; }; - class rhsusf_socom_marsoc_cso; class rhsusf_socom_marsoc_cso_light : rhsusf_socom_marsoc_base { - ASR_AI_COST_SPECIAL; ASR_AI_CAMO_FULL; }; + class rhsusf_socom_marsoc_cso; class rhsusf_socom_marsoc_teamleader : rhsusf_socom_marsoc_cso { ASR_AI_CAMO_FULL; }; @@ -259,7 +286,6 @@ class CfgVehicles { ASR_AI_COST_SPECIAL; }; class rhsusf_socom_marsoc_elementleader : rhsusf_socom_marsoc_cso { - ASR_AI_COST_SPECIAL; }; class rhsusf_socom_marsoc_jfo : rhsusf_socom_marsoc_base { @@ -272,27 +298,22 @@ class CfgVehicles { class rhsusf_socom_marsoc_spotter : rhsusf_socom_marsoc_cso_light { ASR_AI_COST_SPECIAL; ASR_AI_CAMO_FULL; - sensitivity = 4; }; class rhsusf_socom_marsoc_sniper : rhsusf_socom_marsoc_marksman { ASR_AI_SKILL_SNP1; - ASR_AI_COST_SPECIAL; ASR_AI_CAMO_FULL; ASR_AI_AMMOCOEF_SNIPER; - sensitivity = 4; }; - - class rhsusf_usmc_marpat_wd_rifleman_m4; + class rhsusf_usmc_marpat_wd_rifleman_m4; class rhsusf_navy_marpat_wd_medic : rhsusf_usmc_marpat_wd_rifleman_m4 { ASR_AI_COST_REG; }; - class rhsusf_usmc_marpat_d_rifleman_m4; + class rhsusf_usmc_marpat_d_rifleman_m4; class rhsusf_navy_marpat_d_medic : rhsusf_usmc_marpat_d_rifleman_m4 { ASR_AI_COST_REG; }; - - class rhsusf_socom_marsoc_cso_cqb; + class rhsusf_socom_marsoc_cso_cqb; class rhsusf_navy_sarc : rhsusf_socom_marsoc_cso_cqb { ASR_AI_COST_SPECIAL; }; @@ -301,9 +322,7 @@ class CfgVehicles { class rhsusf_airforce_jetpilot : rhsusf_usmc_marpat_wd_rifleman_m4 { ASR_AI_SKILL_PIL1; - ASR_AI_COST_REG; ASR_AI_CAMO_NONE; }; - };