Home   Help Search Login Register  

Author Topic: Count Units command  (Read 904 times)

0 Members and 3 Guests are viewing this topic.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Count Units command
« on: 22 Jan 2009, 07:13:15 »
HI all, I generated a small script using the count units command. here is the code I generated in a trigger:

Quote
Conditon: (count units group1) < 4
Onactivation: E1 Setdammage 1

basically what I did is inserted a group:

group1 = group this

inserted another soldier, naamed it E1, but it's a west soldier. (purposes of not being shot at)

the group has 5 soldiers..basicall what i did, was once there was less then 4 soldiers in group1, E1 would die.lo but hey I tested it and it worked only when I shot all the soldiers in the group.

If I used a grenade the game didnt' recognize the command when I blew up 4 soldiers up at once, why is this? Is it because the game cannot respond that fast with that command?

But it works fine if I shoot the soldiers but not if I blow them up with a grenade...

 :)

« Last Edit: 22 Jan 2009, 16:53:51 by NightJay0044 »
Who's hyped for Arma4, long live Arma!

Walter_E_Kurtz

  • Guest
Re: Count Units command
« Reply #1 on: 22 Jan 2009, 17:29:05 »
I think it's to do with dead units still being considered part of a group, until a team-mate says "Oh no, number is down." At which point they are removed from the group, and the count drops correspondingly.

Try using an alternative format for the Count command:

Code: [Select]
({alive _x} count units group1) < 4


Edit: corrected syntax (it is necessary to use units group1 to create an array) and tested.
« Last Edit: 22 Jan 2009, 17:42:44 by Walter_E_Kurtz »