OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mr.BoDean on 02 Jan 2003, 13:56:44

Title: Completing obj with enemy 95% clear
Post by: Mr.BoDean on 02 Jan 2003, 13:56:44
Is there an easy way to condition a trigger whereby MOST of the enemy ...say 95% ...are dead ?  I seem to keep having a stray soldier screw up my "East"  Not Present condition of an objective trigger, which prevents an informational trigger from activating and leads to mission confusion.  :-\
     Thanks!   ;)
Title: Re:Completing obj with enemy 95% clear
Post by: KTottE on 02 Jan 2003, 14:50:02
Count the number of east units at the beginning of a mission, save into a variable.

Then have a trigger check for:

?(enemyUnits < 95)

then use that to end the mission.

(95 was assuming you had 100 enemy soldiers, change as appropriate)
Title: Re:Completing obj with enemy 95% clear
Post by: Ranger on 02 Jan 2003, 19:07:16
Count the number of east units at the beginning of a mission, save into a variable.

Then have a trigger check for:

?(enemyUnits < 95)

then use that to end the mission.

(95 was assuming you had 100 enemy soldiers, change as appropriate)

I think this is a little ambiguous.  To be more clear, in the trigger's Condition field, put the following code:

Code: [Select]
count (list this) <= x
Where x is the number of remaining East soldiers that would be only 5% remaining (i.e., 95% are dead).

Thus, if you had 20 east soldiers, x would be 1 in order to check if 95% are dead.  Your code would thus be as follows:

Code: [Select]
count (list this) <= 1
The list command provides an array of every unit in the trigger's area that would activate the trigger.  Thus, this code counts how many units would activate the trigger, and if there is less than or equal to 1 (95% dead), the trigger will be activated.

Good luck!  8)
Title: Re:Completing obj with enemy 95% clear
Post by: Padiimiite on 07 Jan 2003, 11:18:31
What? Isn't their more to that?
Title: Re:Completing obj with enemy 95% clear
Post by: dmakatra on 07 Jan 2003, 11:31:52
Thx mates, that really si great info for missions that often ends with yourself running around screaming for help to know where the last soldier is.

They should use that system in beachhead assault in red hammer. If think it took me 1 and a half hour to find that last soldier!
Title: Re:Completing obj with enemy 95% clear
Post by: Padiimiite on 08 Jan 2003, 01:15:14
ok, so how do I get this to work? How do I count the enemy units? Im guessing you use the CountEnemy command or countside or something, but I'm still lost on how this comes together. I keep doing diffrent things and Im having no luck.