Jump to content
Sign in to follow this  
Freebie

vehicle check group MP

Recommended Posts

Hi all I tried searching but didn't quite find what I needed or just didn't seem to work.

I have a 4 player MP mission with a heli insertion/extraction working fine and what I'm using to check all units in/out of the heli is this code in a move waypoint right next to the load/unload land waypoint...

((!alive u1) or (u1 in mh9)) and ((!alive u2) or (u2 in mh9)) and ((!alive u4) or (u4 in mh9)) and ((!alive u6) or (u6 in mh9)) and  ((!alive alpha4) or (alpha4 in mh9));

alpha4 is an AI unit that we rescue and that joins our group. I've called our group 'bravo'.

Now ^ all this works fine if all 4 human player slots are filled but say if we had only 3 human players then the condition doesn't get met and the helicopter won't take off.

Is there another code that I can use which will just count the group (bravo) regardless if all 4 human slots are filled or not and when they are all in the helicopter... it then does it's thing and takes off?

Thanks.

Share this post


Link to post
Share on other sites

something like

({!(alive _x) || _x in mh9} count (units (group bravo))) == count (units (group bravo))

should do the job for you.

(count the number of units from group bravo that are either dead or are in the vehicle) is equal to (the number of units in group bravo)

Edited by Larrow

Share this post


Link to post
Share on other sites
something like
({!(alive _x) || _x in mh9} count (units (group bravo))) == count (units (group bravo))

should do the job for you.

(count the number of units from group bravo that are either dead or are in the vehicle) is equal to (the number of units in group bravo)

Hi mate I tried that in the move waypoint instead of the alive1 etc and it didn't work. I tried it in a trigger synced to the move waypoint too but same thing.

Heli landed and everyone got in but heli didn't take off. Plus I got this error....

http://members.westnet.com.au/scott_k/not%20much/bravo.png (1952 kB)

Any ideas?

Share this post


Link to post
Share on other sites

Yer sorry my bad, was copy & pasting from one of my test scripts for something else and adjusting to fit your needs.

Anyway try

({!(alive _x) || _x in mh9} count (units bravo)) == count (units bravo)

the units of bravo , not the units of the group that bravo is a member of.

Share this post


Link to post
Share on other sites
shouldn't the _x in mh9 be _x in (crew mh9)?

Both will work

IN is fine to know if they are in the vehicle.

CREW will return a list in order of positions, something like [driver,gunner,commander,turrets,cargo] if you need to know where they are sitting

Share this post


Link to post
Share on other sites
Yer sorry my bad, was copy & pasting from one of my test scripts for something else and adjusting to fit your needs.

Anyway try

({!(alive _x) || _x in mh9} count (units bravo)) == count (units bravo)

the units of bravo , not the units of the group that bravo is a member of.

THANK YOU! It works a treat. Much appreciated :D

While I've got you is there something similar for if it was an infiltration and you needed the mh9 to wait until all the group disembarked before it dusted off?

Share this post


Link to post
Share on other sites

Heres a clue !(_x in mh9)

Share this post


Link to post
Share on other sites
Both will work

IN is fine to know if they are in the vehicle.

CREW will return a list in order of positions, something like [driver,gunner,commander,turrets,cargo] if you need to know where they are sitting

You're right, damn arma every day learn something new :) http://community.bistudio.com/wiki/in_vehicle

Share this post


Link to post
Share on other sites
Heres a clue !(_x in mh9)

haha I guess change 'in' to 'out'.

Because I know jack about scripting I often think the answer will be pretty complicated. But is seems not always :p

I'll give that a go tomorrow. Thanks Larrow.

Share this post


Link to post
Share on other sites

OK it wasn't 'out'. Shows how much I know lol but did a bit more digging and finally got the group disembark to work as well...

({!(alive _x) || _x in mh9} count (units bravo)) == 0;

All done!

Share this post


Link to post
Share on other sites

Aye that looks good. Was not even what i was getting at with the clue but looks alot cleaner :D

!(_x in mh9) = not unit in mh9 = unit must be out side the vehicle

({!(alive _x) || !(_x in mh9)} count (units bravo)) == count (units bravo);

Glad you got it sorted

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×