Search the Community
Showing results for tags 'casualty'.
Found 1 result
-
Script is mis-identifying dead units
olegreyghost posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I was using the civilian casualty counter script posted by the Grumpy Old Man. The purpose is to end the mission if there are too many civilian casualties and notify the player with a debriefing screen. MyCivKillCounter = 0; addMissionEventHandler ["EntityKilled",{ params ["_killedUnit","_killer","_triggerMan"]; if (side _killedUnit isEqualTo civilian AND side _triggerMan isEqualTo west) then { MyCivKillCounter = MyCivKillCounter + 1; if (MyCivKillCounter >= 3) then {endMission "End4"}; }; }]; The problem is it ended the mission when the enemy units were killed. The debriefing screen showed opfor units killed, but not any civilians. This was a recurring problem so I switched to a similar script posted by Kylania. Both are used in the init.sqf. if (isServer) then { FNH_civilians_killed = 0; addMissionEventHandler ["EntityKilled", { _killed = _this select 0; if (side group _killed == civilian) then { FNH_civilians_killed = FNH_civilians_killed + 1; if (FNH_civilians_killed > 2) then { ["End6", true, 4] call BIS_fnc_endMission }; }; }]; }; This worked fine thru a month of testing and adding other things to the mission. After I made a change to some triggers for text communications, the error popped up again. The triggers are separate & not related in any way to the civilians. I am using the islamic state guerilla units from project OpFor as the enemy units. LOP_ISTS_OPF_Infantry_Rifleman_2 & _3 LOP_ISTS_OPF_Infantry_SL. Any help in resolving the problem will be greatly appreciated....