Home   Help Search Login Register  

Author Topic: count units  (Read 702 times)

0 Members and 1 Guest are viewing this topic.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
count units
« on: 24 Aug 2004, 15:36:22 »
this is driving me nuts again. I've had problems like this in th past but now its returning to haunt me.

any one know why this isn't working?
(count units squad_1) < 2 && (count units squad_2) < 2

the trigger won't activate, even if they are dead. Its an array so I can't do the ! (canMove squad_1)

i've also tried:
(count units squad_1 < 2) && (count units squad_2 < 2)
count units squad_1 < 2 && count units squad_2 < 2

anyone help?
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:count units
« Reply #1 on: 24 Aug 2004, 15:41:27 »
the squad_1 was defined as group ?

squad = group soldier name ?

if not u shud do somin like

(count units group squad_1) < 2 && (count units group squad_2) < 2

donno :P mess w/ da () som more ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

bored_onion

  • Guest
Re:count units
« Reply #2 on: 24 Aug 2004, 15:46:30 »
if you are writing this in a trigger condition field try using "AND" to separate the two conditions. also try using <= instead of <

failing that you could put in the player init:

Code: [Select]
men1 = []; men2 = []
and then in the init of each man in the groups
Code: [Select]
men1 = men1 + [this] or
Code: [Select]
men2 = men2 +[this]
then make the condition:
Code: [Select]
(men1 <= 2) AND (men2 <= 2)
no guarantees on the syntax but something like that... :P

ppl, feel free to correct me

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:count units
« Reply #3 on: 24 Aug 2004, 17:07:14 »
i'll try fleeing squad_1 etc.
that might be more realistic anyway. Thanks for the help thought

Cheers :cheers:
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:count units
« Reply #4 on: 24 Aug 2004, 17:41:33 »
Quote
try using "AND" to separate the two conditions.
as was used...
&& means AND
|| means OR...
Both work with triggers just fine... (if that's what you meant...)

I believe count units group squad_1 < 2 should work...
Worked for me...
There must be something hairy somewheres else...

Also, it can take a while until the group leader realises some of his group is dead... The dead stay in the group until the group leader knows they are dead...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:count units
« Reply #5 on: 24 Aug 2004, 17:53:58 »
hater kint just remind me somin

u can use the not alive command 4 that :P

"alive _X" count units groupname < 2

or

"alive _X" count units group soldiername < 2

2 check how meny of em were alive nd not wait till da count refreshes ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline James Venturi

  • Members
  • *
  • "I'm the bad guy"
Re:count units
« Reply #6 on: 24 Aug 2004, 17:57:34 »
it LOOKS like lcd's idea might work i'll check it myself later on guys.
 :gunman:
 :moon:    
myspace.com/djjamesventuriofficial

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:count units
« Reply #7 on: 24 Aug 2004, 18:10:35 »
Quote
2 check how meny of em were alive nd not wait till da count refreshes
Of course...
I was just trying to keep the Tygers syntaxes :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:count units
« Reply #8 on: 24 Aug 2004, 18:16:52 »
yea right :P

u just forgot ;) ;D

now ill take this place 2 spam ;D  :-X

test me mision or ill kill a pinguin :gunman:
LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:count units
« Reply #9 on: 24 Aug 2004, 19:23:04 »
Count units GrpName seems to return the number of units the leader of the group thinks he has, so if some have been killed and he has not realised it yet count will give you a higher number than you might expect.  If the whole squad gets wipped out it can take several minutes for count units GrpName to become zero.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:count units
« Reply #10 on: 24 Aug 2004, 19:33:16 »
@ THobson

wich is y i stated da oder method ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:count units
« Reply #11 on: 24 Aug 2004, 20:18:47 »
I can see your method works.  I only mentioned it because I am not sure how many people realise it can take minutes for count to adjust to the correct number, especially if the all the units in the group are dead.
« Last Edit: 24 Aug 2004, 20:23:35 by THobson »