Home   Help Search Login Register  

Author Topic: faster  (Read 1089 times)

0 Members and 2 Guests are viewing this topic.

GI-YO

  • Guest
faster
« 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

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:faster
« Reply #1 on: 07 Jun 2005, 12:12:20 »
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

Code: [Select]
not (alive gen1) and not (alive gen2) and not (alive gen3) and not (alive gen4)

Franksie86

  • Guest
Re:faster
« Reply #2 on: 07 Jun 2005, 12:14:09 »
I think if u use East count units gen1 == 0 it works faster, im not sure tho - I will go test it myself

Offline Blanco

  • Former Staff
  • ****
Re:faster
« Reply #3 on: 07 Jun 2005, 12:15:24 »
Try :

Code: [Select]
("alive _x" count units gen1 <= 0 && "alive _x" count units gen2 <= 0 && "alive _x" count units gen3 <= 0 && "alive _x" count units gen4 <= 0)
Quote
...four enemy loons


Are these 4 groups or 4 units?
If those are 4 individual units, use bedges method.

« Last Edit: 07 Jun 2005, 12:18:07 by Blanco »
Search or search or search before you ask.

Offline MrN

  • Contributing Member
  • **
  • Pffff
Re:faster
« Reply #4 on: 07 Jun 2005, 22:18:00 »
==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.
In the 60's, people took acid to make the world weird. Now the world is weird and people take Prozac to make it normal.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:faster
« Reply #5 on: 08 Jun 2005, 07:31:42 »
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 ;)

GI-YO

  • Guest
Re:faster
« Reply #6 on: 08 Jun 2005, 12:04:44 »
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