OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Thomas G Vorm on 15 Nov 2007, 19:40:35

Title: All aboard?
Post by: Thomas G Vorm 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
Title: Re: All aboard?
Post by: Mandoble 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";

Title: Re: All aboard?
Post by: Trexian 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:
Title: Re: All aboard?
Post by: Thomas G Vorm on 15 Nov 2007, 22:15:08
Great, thanks guys, just what I needed

Python1
Title: Re: All aboard?
Post by: Mandoble 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.
Title: Re: All aboard?
Post by: Trexian 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.