OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: pazuzu on 07 Apr 2005, 03:30:05

Title: Counting deaths
Post by: pazuzu on 07 Apr 2005, 03:30:05
I'm making a mission in which I have several civilians. I want the mission to end if a certain number of civilians die but I dont want it to be any specific units just a certain number of any civ deaths to end mission.

How would I count how many civilians have died?

Thanks.
Title: Re:Counting deaths
Post by: Blanco on 07 Apr 2005, 07:21:04
This can be done via a killed EH and a variable.

In your init.sqs put :

Code: [Select]
Civdied = 0
Give all civilians a "killed" eventhandler

Code: [Select]
this addeventhandler ["killed",{civdied = civdied + 1}]
Then your End# trigger

Condition
Code: [Select]
civdied >= 10
When 10 civilians got killed the mission ends.  :)








Title: Re:Counting deaths
Post by: pazuzu on 12 Apr 2005, 23:23:57
Hey thanks...

This worked perfectly.