Updated Killed EH, Added a HIt EH, Changed the Intelligence so that AI awareness of player location increases gradually.

This commit is contained in:
Ghostrider-DbD- 2017-03-12 22:42:19 -04:00
parent 9856233a7a
commit fcdc4a57d7
10 changed files with 64 additions and 14 deletions

View File

@ -0,0 +1,23 @@
/*
By Ghostrider-DbD-
Last Modified 3-12-17
*/
private ["_unit","_instigator"];
//diag_log format["_EH_AIHit::-->> _this = %1",_this];
_unit = _this select 0 select 0;
_instigator = _this select 0 select 3;
//diag_log format["EH_AIHit:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit];
if (!(alive _unit)) exitWith {};
if (!(isPlayer _instigator)) exitWith {};
[_unit,_instigator] call blck_fnc_alertNearbyLeader;
if (_unit getVariable ["hasHealed",false]) exitWith {};
if ((damage _unit) > 0.1 ) then
{
//diag_log format["_EH_AIHit::-->> Healing unit %1",_unit];
_unit setVariable["hasHealed",true,true];
_unit addMagazine "SmokeShellOrange";
_unit fire "SmokeShellMuzzle";
_unit addItem "FirstAidKit";
_unit action ["HealSoldierSelf", soldier1];
};

View File

@ -15,9 +15,14 @@
*/ */
private ["_unit","_mag"]; //private ["_unit","_mag"];
_unit = _this select 0; //_unit = _this select 0;
_mag = _this select 3 select 0; //_mag = _this select 3 select 0;
if (blck_debugLevel > 2) then {diag_log format["_EH_unitWeaponReloaded:: unit %1 reloaded weapon %2 with magazine %3",_unit,_this select 1,_mag]; (_this select 0) addMagazine (_this select 3 select 0);
if (blck_debugLevel > 2) then (diag_log format["_EH_unitWeaponReloaded:: one magazine of type %1 added to inventory of unit %2",_mag,_unit]; if (blck_debugON) then {
_unit addMagazine _mag; //diag_log format["_EH_unitWeaponReloaded:: unit %1 reloaded weapon %2 with magazine %3",_this select 0, (_this select 3 select 0)];
//diag_log format["_EH_unitWeaponReloaded:: unit %1 currently has the following magazines 2",_this select 0,magazines (_this select 0)];
};
//if (blck_debugLevel > 2) then (diag_log format["_EH_unitWeaponReloaded:: one magazine of type %1 added to inventory of unit %2",_mag,_unit];

View File

@ -0,0 +1,17 @@
/*
by Ghostrider
9-20-15
Because this is p-ecompiled there is less concern about keeping comments in.
*/
private["_knowsAbout","_intelligence";"_group"];
params["_unit","_target"];
_intelligence = _unit getVariable ["intelligence",1];
_group = group _unit;
{
_knowsAbout = _x knowsAbout _target;
_x reveal [_target,_knowsAbout + _intelligence];
}forEach units _group;

View File

@ -14,7 +14,8 @@ if (_alertDist > 0) then {
//diag_log format["+----+ alerting units close to %1",_unit]; //diag_log format["+----+ alerting units close to %1",_unit];
{ {
if (((position _x) distance2D (position _unit)) <= _alertDist) then { if (((position _x) distance2D (position _unit)) <= _alertDist) then {
_x reveal [_killer, _intelligence]; _knowsAbout = _x knowsAbout _killer;
_x reveal [_killer, _knowsAbout + _intelligence];
//diag_log "Killer revealed"; //diag_log "Killer revealed";
} }
} forEach allUnits; } forEach allUnits;

View File

@ -50,5 +50,5 @@ if (blck_useKillMessages) then
[_unit,_killer,_kills] call blck_fnc_rewardKiller; [_unit,_killer,_kills] call blck_fnc_rewardKiller;
{ {
_unit removeAllEventHandlers _x; _unit removeAllEventHandlers _x;
}forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear"] }forEach ["Killed","Fired","HandleDamage","HandleHeal","FiredNear","Hit"]

View File

@ -151,7 +151,9 @@ else
//_ai1 addeventhandler ["fired", {(_this select 0) setvehicleammo 1;}]; //_ai1 addeventhandler ["fired", {(_this select 0) setvehicleammo 1;}];
_ai1 addEventHandler ["reloaded", {_this call compile preprocessfilelinenumbers blck_EH_unitWeaponReloaded;}]; _ai1 addEventHandler ["reloaded", {_this call compile preprocessfilelinenumbers blck_EH_unitWeaponReloaded;}];
_ai1 addEventHandler ["killed",{ [(_this select 0), (_this select 1)] call compile preprocessfilelinenumbers blck_EH_AIKilled;}]; // changed to reduce number of concurrent threads, but also works as spawn blck_AIKilled; }]; _ai1 addEventHandler ["killed",{ [(_this select 0), (_this select 1)] call compile preprocessfilelinenumbers blck_EH_AIKilled;}]; // changed to reduce number of concurrent threads, but also works as spawn blck_AIKilled; }];
//_ai addEventHandler ["HandleDamage",{ [(_this select 0), (_this select 1)] execVM blck_EH_AIHandleDamage;}]; _ai1 addEventHandler ["Hit",{ [_this] call compile preprocessFileLineNumbers blck_EH_AHHit;}];
//_ai1 addEventHandler ["FiredNear",{diag_log "-------->>>>>>>> Weapon fired Near Unit";}];
//_ai1 addEventHandler ["FiredNear",{ [_this] call compile preprocessFileLineNumbers blck_EH_AIFiredNear;};];
switch (_skillLevel) do switch (_skillLevel) do
{ {

View File

@ -83,6 +83,8 @@ blck_fnc_vehicleMonitor = compileFinal preprocessFileLineNumbers "\q\addons\cust
blck_fnc_removeGear = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_removeGear.sqf"; // Strip an AI unit of all gear. blck_fnc_removeGear = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_removeGear.sqf"; // Strip an AI unit of all gear.
blck_fnc_spawnAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_spawnUnit.sqf"; // spawn individual AI blck_fnc_spawnAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_spawnUnit.sqf"; // spawn individual AI
blck_EH_AIKilled = "\q\addons\custom_server\Compiles\Units\GMS_EH_AIKilled.sqf"; // Event handler to process AI deaths blck_EH_AIKilled = "\q\addons\custom_server\Compiles\Units\GMS_EH_AIKilled.sqf"; // Event handler to process AI deaths
blck_EH_AHHit = "\q\addons\custom_server\Compiles\Units\GMS_EH_AIHit.sqf";
blck_EH_AIFiredNear = "\q\addons\custom_server\Compiles\Units\GMS_EH_AIFiredNear.sqf";
blck_EH_unitWeaponReloaded = "\q\addons\custom_server\Compiles\Units\GMS_EH_unitWeaponReloaded.sqf"; blck_EH_unitWeaponReloaded = "\q\addons\custom_server\Compiles\Units\GMS_EH_unitWeaponReloaded.sqf";
blck_fnc_processAIKill = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_processAIKill.sqf"; blck_fnc_processAIKill = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_processAIKill.sqf";
blck_fnc_removeLaunchers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_removeLaunchers.sqf"; blck_fnc_removeLaunchers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_removeLaunchers.sqf";

View File

@ -70,7 +70,7 @@ Last modified 8/1/15
blck_MinDistanceFromMission = 2000; blck_MinDistanceFromMission = 2000;
// global loot crate options // global loot crate options
// Options to spawn a smoking wreck near the mission. When the first parameter is true, a wreck or junk pile will be spawned. // Options to spawn a smoking wreck near the crate. When the first parameter is true, a wreck or junk pile will be spawned.
// It's position can be either "center" or "random". smoking wreck will be spawned at a random location between 15 and 50 m from the mission. // It's position can be either "center" or "random". smoking wreck will be spawned at a random location between 15 and 50 m from the mission.
blck_SmokeAtMissions = [false,"random"]; // set to [false,"anything here"] to disable this function altogether. blck_SmokeAtMissions = [false,"random"]; // set to [false,"anything here"] to disable this function altogether.
blck_useSignalEnd = true; // When true a smoke grenade/chemlight will appear at the loot crate for 2 min after mission completion. blck_useSignalEnd = true; // When true a smoke grenade/chemlight will appear at the loot crate for 2 min after mission completion.
@ -192,7 +192,7 @@ Last modified 8/1/15
//blck_AIAlertDistance = [150,225,400,500]; //blck_AIAlertDistance = [150,225,400,500];
// How precisely player locations will be revealed to AI after an AI kill // How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange]; // values are ordered as follows [blue, red, green, orange];
blck_AIIntelligence = [0.5, 1, 2, 4]; blck_AIIntelligence = [0.3, 0.5, 0.7, 0.9];
blck_baseSkill = 1.0; // The overal skill of the AI - range 0.1 to 1.0. blck_baseSkill = 1.0; // The overal skill of the AI - range 0.1 to 1.0.

View File

@ -196,7 +196,7 @@ Last modified 8/1/15
//blck_AIAlertDistance = [150,225,400,500]; //blck_AIAlertDistance = [150,225,400,500];
// How precisely player locations will be revealed to AI after an AI kill // How precisely player locations will be revealed to AI after an AI kill
// values are ordered as follows [blue, red, green, orange]; // values are ordered as follows [blue, red, green, orange];
blck_AIIntelligence = [0.5, 1, 2, 4]; blck_AIIntelligence = [0.3, 0.5, 0.7, 0.9];
blck_baseSkill = 1.0; // The overal skill of the AI - range 0.1 to 1.0. blck_baseSkill = 1.0; // The overal skill of the AI - range 0.1 to 1.0.

View File

@ -1,3 +1,3 @@
private ["_version","_versionDate"]; private ["_version","_versionDate"];
_blck_version = "6.56 Build 39"; _blck_version = "6.57 Build 40";
_blck_versionDate = "2-24-17 8:00 PM"; _blck_versionDate = "3-11-17 8:00 PM";