OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: polvy on 10 Jan 2005, 23:05:46

Title: Alive Check
Post by: polvy on 10 Jan 2005, 23:05:46
Would someone be able to provide and example of what text would be nessesary to end a mission once a list of named Soldiers were dead. I have a multiple assasination mission in mind. Thank you.

~Polvy
Title: Re:Alive Check
Post by: Triggerhappy on 10 Jan 2005, 23:25:13
"alive _x" count listoftargetunits == 0
Title: Re:Alive Check
Post by: THobson on 10 Jan 2005, 23:25:19
By text do you want it for a script or a trigger?

For a trigger try this in the condition field
({alive _x} count [unit1,unit2,....]) < 1

For a script try
if ({alive _x} count [unit1,unit2,unit3,...] < 1) then {end1 = true}

Syntax not tested.

There are other ways.  You could give all your guys a "killed" event handler that runs a script whenever  any of them get killed that checks how many are now dead.
Title: Re:Alive Check
Post by: polvy on 11 Jan 2005, 00:02:07
Thank you so much fellas, it worked beautifully.  :)

~Polvy