Home   Help Search Login Register  

Author Topic: Checking if a group is fleeing?  (Read 1209 times)

0 Members and 1 Guest are viewing this topic.

Thaatu

  • Guest
Checking if a group is fleeing?
« on: 16 Dec 2005, 00:10:55 »
Checking if a unit is fleeing is simple with "Fleeing"-command on condition field, but how to check if a whole group is fleeing?

Offline Pilot

  • Contributing Member
  • **
Re:Checking if a group is fleeing?
« Reply #1 on: 16 Dec 2005, 05:09:03 »
I think a simple check of the leader should provide you with what the group is doing.  If the group leader is fleeing, chances are the whole group is. ;)  Try this:

fleeing leader GroupName

I could be wrong...but I don't think so in this case. ;D

-Pilot

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Checking if a group is fleeing?
« Reply #2 on: 16 Dec 2005, 11:18:09 »
I have a feeling that fleeing is a group property anyway, so if one member is fleeing then by definition they all must be.  However Pilot is right:  the leader is (almost always) the bravest member of the group, so if he is on the run the rest should be too.
Plenty of reviewed ArmA missions for you to play

Thaatu

  • Guest
Re:Checking if a group is fleeing?
« Reply #3 on: 18 Dec 2005, 02:32:08 »
Yeah, BUT what if the group leader is dead? Command reference says that dead or empty unit returns false. So lets say the leader is the first to die, then doesn't it after that assume the group is not fleeing if it only checks the leader?

BTW, solved this by making it check every unit independently in the groups (thank god there were ONLY 36 units)... But is there any way to use Foreach command in condition field?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Checking if a group is fleeing?
« Reply #4 on: 18 Dec 2005, 02:41:55 »
No no no no no no no no no no no no no.

Read the comref again.   And this time read it properly.   ;)

(Never, ever, under any circumstances whatsoever, make a post in the forum or indeed read a post in the forum without looking up ALL commands in the online comref.   You may use other versions of the comref for quick reference, but not using the online version in the Editors Depot the first time you encounter a command is merely stupid.   In fact it is the ONLY version of the comref I ever use, because you never know what help somebody may have added since the last time you looked.)

Done that?  Good.  Now you understand that it is impossible for the group leader to be dead.     If the group leader is dead, then by definition everybody in the group is dead.     You MUST understand what a group is, and the difference between a unit and a group (which are barely even related) otherwise you are never going to get anywhere in OFP editing.   Ask if you are unsure:  that is what the forum is for.

Oh and yes of course you can use forEach in the Condition field of a trigger, in the same way that you can use virtually any command in virtually any circumstance where a command can be put.
« Last Edit: 18 Dec 2005, 02:46:05 by macguba »
Plenty of reviewed ArmA missions for you to play

Thaatu

  • Guest
Re:Checking if a group is fleeing?
« Reply #5 on: 18 Dec 2005, 03:06:59 »
Sorry about that, my brain melt for a second there (I haven't used "leader Group" much and used unit names instead, but I should have realized that). Thanks for clearing this up for me.

But I have tried using foreach in condition, but I can't seem to construct the whole litany correctly. Let's say:
 "alive _x" foreach units group player ; Now this obviously doesn't work but what's the correct version of it?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Checking if a group is fleeing?
« Reply #6 on: 18 Dec 2005, 03:30:28 »
"alive _x" foreach units group player

Read up on the count command.    In general forEach is for making things happen:  count is for checking things.   In other words, in triggers, count tends to turn up in the condition field and forEach tends to turn up in the On Activation field.

You probably mean something like

"alive _x" count units group player > 4

You're doing fine btw, keep up the good work:  OFP scripting is like poking knitting needles in your eyes at first but that phase doesn't last long once you get in to it.
« Last Edit: 18 Dec 2005, 03:33:22 by macguba »
Plenty of reviewed ArmA missions for you to play

Thaatu

  • Guest
Re:Checking if a group is fleeing?
« Reply #7 on: 18 Dec 2005, 03:52:38 »
I've been in that phase for a few years now. I'm still sticking needles in my eye, but now I'm used to the pain :)

Maybe I'll start making complete missions, not just fool around with the editor...


Solved.