OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: GI-YO on 07 Jun 2005, 12:04:00
-
Hi i'm making an assanation mission, im using this line of code at the moment and it works but it takes about a minute to go off which is way too slow, heres the code (count units gen1 == 0) and (count units gen2 == 0) and (count units gen3 == 0) and (count units gen4 == 0) .
Does anyone know of any script which is faster than this which detects when all the four enemy loons are dead? Thanks in advance
GI-YO
-
i would have thought a count is needed only if they're groups?
assuming all four 'gens' are not going to be offed simultaneously, why not set up a variable count? when one of them is killed, add 1 to number_offed. use a trigger to fire if number_offed is equal to 4.
that or modify the condition to read
not (alive gen1) and not (alive gen2) and not (alive gen3) and not (alive gen4)
-
I think if u use East count units gen1 == 0 it works faster, im not sure tho - I will go test it myself
-
Try :
("alive _x" count units gen1 <= 0 && "alive _x" count units gen2 <= 0 && "alive _x" count units gen3 <= 0 && "alive _x" count units gen4 <= 0)
...four enemy loons
Are these 4 groups or 4 units?
If those are 4 individual units, use bedges method.
-
==0 seems to misbehave sometimes.
any of the above should work or:
!alive gen1 && !alive gen2 && !alive gen3 && !alive gen4
No idea which one is quicker though.
-
The count command will still count dead units as being alive until the groups leader knows that they're dead. (Think "Oh no, 2 is down).
If the leader is the last one left in the group (as in your situation GI YO), it can takes aaaages before OFP registers the unit as dead using the count command.
If you were counting a group I'd suggest using countside, but in this case (counting four individuals in different groups) you probably want to use the previous not (alive) solutions ;)
-
Thanks for all the response guys, to clarify the loons are NOT in a group, but they are all in one room (so grouping them might be simpler). I'll re read and test all the different methods provided and post back with the best one. Thanks again
GI-YO