Bushwookie420
Well-Known Member
basically when the AI die after a few seconds they will play an animation were they wake up and die again if you shoot the AI in the head after they have done this it repeats the cycle they play the death animation after a few secs they wake up and die again you can repeat this forever now the way of fixing it is setting the AI to not being unconscious when they die and removing the damage handler from them so i added to dzai_functions.sqf inside of the DZAI_unitDeath function underneath
_victim setVariable ["deathhandled",true];
_victim setDamage 1;
i added
_victim setVariable ["unconscious",false];
_victim removeAllEventHandlers "HandleDamage";
_victim removeAllEventHandlers "Killed";
_victim removeAllEventHandlers "Fired";
so the full function is now
_victim setVariable ["deathhandled",true];
_victim setDamage 1;
i added
_victim setVariable ["unconscious",false];
_victim removeAllEventHandlers "HandleDamage";
_victim removeAllEventHandlers "Killed";
_victim removeAllEventHandlers "Fired";
so the full function is now
Code:
DZAI_unitDeath = {
private["_victim","_killer","_unitGroup","_unitType"];
_victim = _this select 0;
_killer = _this select 1;
if (_victim getVariable ["deathhandled",false]) exitWith {};
_victim setVariable ["deathhandled",true];
_victim setDamage 1;
_victim setVariable ["unconscious",false];
_victim removeAllEventHandlers "HandleDamage";
_victim removeAllEventHandlers "Killed";
_victim removeAllEventHandlers "Fired";
_unitGroup = (group _victim);
_unitType = _unitGroup getVariable ["unitType",""];
switch (_unitType) do {
case "static":
{
[_victim,_unitGroup] spawn DZAI_AI_killed_static;
};
case "dynamic":
{
[_victim,_unitGroup] spawn DZAI_AI_killed_dynamic;
};
case "air":
_victim setVariable ["DZAI_deathTime",time];
_victim removeWeapon "NVGoggles";
{
};
case default {
if (DZAI_debugMarkers > 0) then {
private ["_unitsAlive"];
if (({alive _x} count (units _unitGroup)) == 0) then {
{
deleteMarker (str _x);
} forEach (waypoints _unitGroup);
};
};
};
};
if (_unitType in ["static","dynamic"]) then {
0 = [_victim,_killer,_unitGroup] call DZAI_AI_killed_all;
};
//diag_log format ["DEBUG :: AI %1 (Group %2) killed by %3",_victim,_unitGroup,_killer];
true
};