Home   Help Search Login Register  

Author Topic: All aboard?  (Read 1540 times)

0 Members and 3 Guests are viewing this topic.

Offline Thomas G Vorm

  • Members
  • *
All aboard?
« on: 15 Nov 2007, 19:40:35 »
Hey everyone, I'm trying to think about how to write this code but I can't come up with anything so I thought I'd just ask. Pretty easy I'm sure, I'd like to check when all units group player are on board heli1. But I don't know the code. Basically I'm having a chopper land, then once myself and team mates are on board the chopper takes off to another destination ~15 mission ends. Any suggestions?

Python1

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: All aboard?
« Reply #1 on: 15 Nov 2007, 20:58:51 »
Code: [Select]
// SQF
if (({alive _x} count units group player) == ({_x in heli1} count units group player)) then
{
   hint "all aboard";
};

Code: [Select]
// SQS
? ({alive _x} count units group player) == ({_x in heli1} count units group player):hint "all aboard";


Offline Trexian

  • Members
  • *
Re: All aboard?
« Reply #2 on: 15 Nov 2007, 21:52:43 »
Looking at the sqf...

You could use the same technique to determine if all the live units on one side (blufor, for instance) were in helos, eh?  Even if they were in different groups?

Or even, to set a destination for all live groups on one side.

 :good:
Sic semper tyrannosauro.

Offline Thomas G Vorm

  • Members
  • *
Re: All aboard?
« Reply #3 on: 15 Nov 2007, 22:15:08 »
Great, thanks guys, just what I needed

Python1

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: All aboard?
« Reply #4 on: 15 Nov 2007, 22:58:45 »
Trexian, as long as you get the list of units of a particular side. And for that purpose you will need to use a trigger covering all the map.

Offline Trexian

  • Members
  • *
Re: All aboard?
« Reply #5 on: 16 Nov 2007, 02:23:48 »
Hmmmm... could your (I think it's yours) :) out-of-bounds script be tweaked to keep a bunch of guys in one particular area?

The basic idea is an assault on an area, then a withdrawal, so the right groups would be in a relatively small, well-defined area.
Sic semper tyrannosauro.