Home   Help Search Login Register  

Author Topic: Detecting groups in trucks.  (Read 426 times)

0 Members and 1 Guest are viewing this topic.

Knut Erik

  • Guest
Detecting groups in trucks.
« on: 17 Aug 2003, 12:15:01 »
Is there a way to detect if a whole group is in a truck...
Here is my script...

_Truck = _this select 0
_Group = _this select 1
_Gl = _this select 2

_Truck doMove getPos (Leader _Group)
   ~1
@unitReady _Truck
"_x assignAsCargo _Truck" forEach units _Group
"[_x] orderGetin True" forEach units _Group
@"_x in _Truck" forEach units _Group  <==========  I can't get this right
_Truck doMove getPos _Gl


Anybody of you experts have a clue ??

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Detecting groups in trucks.
« Reply #1 on: 17 Aug 2003, 13:27:00 »
The way i'm always using is:

@"vehicle _x == _truck" count (units _group) == count (units _group)


Also should work:

@"_x in _truck" count (units _group) == count (units _group)

Another way:

@"vehicle _x == _x" count (units _group) == 0


But you should use the count in combination with a specific
side aswell, so that the condition can become true, even
if there would be dead soldiers in the group, who were
not detected to be dead by the groupleader. In this case
it could happen that the condition would wait forever, even
if all alive soldiers were already onboard.

So best to use then:

count (units _group) == WEST countSide (units _group)

:note - off course you need to take care about the side
of the group you want to wait for (the example above
deals about a WEST group)

The whole condition in case of a west group would then be:

@"vehicle _x == _truck" count (units _group) == WEST countSide (units _group)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Knut Erik

  • Guest
Re:Detecting groups in trucks.
« Reply #2 on: 18 Aug 2003, 12:30:34 »
Whoa!!  :o

That was kinda complicaded  ;)
Anyway, thanks a lot for your help!

OFPEC once again solved my problem (with a little help from Chris Death )

*Topic solved n' locked*