OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Diepvriezer on 13 Jan 2003, 19:21:37

Title: Check if everyone died
Post by: Diepvriezer on 13 Jan 2003, 19:21:37
How can you check in a condition if all soldiers from east are dead???
Like when there are 50 east soldiers, and 20 west soldiers, the 20 west soldiers kill all the 50 east soldiers. And then you have won

I`m not going to get every soldier a name and then put them all in a condition

maybe something like:

NOT(alive _x) forEach soldier commanderA

commanderA = name of the leader from group A
Title: Re:Check if everyone died
Post by: Chris Death on 13 Jan 2003, 19:39:44
"alive _x" count (units commanderA) == 0

~S~ CD
Title: Re:Check if everyone died
Post by: Diepvriezer on 13 Jan 2003, 20:10:54
but then I check or all the units are alive, or not???
Title: Re:Check if everyone died
Post by: Wolfrug on 13 Jan 2003, 21:14:28
well, the easiest way is to create a huge trigger, condition "East Not Present" and put it about the area. Then when east is no longer present...ta-daa... :D

chris' suggestion also works, but you have to use AND arguments and all of the group leaders, obviously.

g'luck!

Wolfrug out.
Title: Re:Check if everyone died
Post by: Diepvriezer on 13 Jan 2003, 22:58:01
lol, why condition East Not Present

I just set it on Not Present, and activation East ;)

And condition on this :P
Title: Re:Check if everyone died
Post by: Chris Death on 14 Jan 2003, 02:14:29
Well, that's what Wolfrug was telling you.
East not present = activation: east - not present  ;)

But for the reason that he might have been telling this
dozens of times to others aswell now, he may have been
thinking, that you should understand this too.

My solution above belonged to your idea in your first
question. It checks, how many soldiers of that group
are still alive. And if the number of alive soldiers has
reached "0", it means that all are no more alive.

~S~ CD
Title: Re:Check if everyone died
Post by: Ottie on 15 Jan 2003, 09:03:42

The only problem with this solution is that if you have a large trigger area for example 500 X 500 and you have a not present then it is difficult to search the complete area (big area) and there are always some soldiers who hide.

Better is to use it in combination with a trigger of the type

East / West Present and in the condition field write:

count thislist == "fleeing _x" count thislist

In this way the trigger will set of if there are no more enemies in the area that have the guts to attack you, and you can consider the battle won.
Title: Re:Check if everyone died
Post by: Diepvriezer on 16 Jan 2003, 16:15:12
 ;D, I`m kinda stupid :P

And my english is fucked up :D

But thanks for the reactions, I know how to check it now, thanks!