Jump to content
Sign in to follow this  
combat-agent

Tracking kills and casualties

Recommended Posts

Im making a CTI mission. I want to track all the kills for each indivual unit on the players side. I know it can be done by the hit or killed event handler. There was a script on OFPEC but their scripts section is limited at the moment. I also want to track the casualties of the players side. Can someone point me in the right direction.

Thanks

Share this post


Link to post
Share on other sites

If you are happy to put it together yourself here are some pointers:

To count the kills:

Create an array of all the enemy soldiers on the map see Reply #6 here:

http://www.ofpec.com/index.p....27814.0

Then run a script that adds a killed event handler to each one:

eg:

{_x addEventHandler["killed",{_this exec"countKill.sqs"}]} forEach East_Units

countKills.sqs should have something like:

_killer = _this select 1

if (_killer == unit1) then {Unit1Kills = Unit1Kills + 1}

if (_killer == unit2) then {Unit2Kills = Unit2Kills + 1}

etc.

Where unit1, unit2 etc are the names you have given to the units in the player's team

Unit1Kills etc should be set to 0 in the file init.sqs

To track casualties on the player's side:

Have a look at:

http://www.ofpec.com/index.p....28059.0

The key points are:

In init.sqs put the line:

Casualties = 0

in the player's init field put:

{_x AddEventHandler ["killed",{Casualties = Casualties + 1}]} forEach units group this

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×