Home   Help Search Login Register  

Author Topic: groups and units actions  (Read 369 times)

0 Members and 1 Guest are viewing this topic.

Offline ryankaplan

  • Members
  • *
  • yeah...
groups and units actions
« on: 13 Jul 2004, 16:53:43 »
i am ashamed to post this here but i am stuck on how to make a whole group eject or do anything.

in the leaders init field i put alpha = group this which is supposed to group those units. now when i try  to eject them from a heli i put
alpha action ["eject","heli1"] and they don't do it and it comes up with a error message. i am supposing i need to put something else insted of just alpha. the comref isn't so clear about it. so what do i need to put? or am i doing it completly wrong?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:groups and units actions
« Reply #1 on: 13 Jul 2004, 17:35:35 »
You're not doing it completely wrong, just wrong enough.

The first thing to get clear in your head is that, in scripting terms, a group is nothing like a unit.   (In the same way that a banana is nothing like photocopier.)    Some scripting commands work on groups, and some on units.    A few clever ones can work on both, but they are the exception not the rule.

In this case you have it basically right except that you are trying to make group do an action.   This is like ordering a banana to make a copy of your CV.  Actions are done by units.

You have named the group correctly, but you need to order the units to eject individually.    There are several ways to do this, here's one cut and pasted from a script file one of my working missions.

_group=units alpha

_i=0

#lop

_loon= _group select _i

_loon action ["eject",chopper1]

unAssignVehicle _loon

_i=_i+1

? _i >=8 : exit

~0.5

goto "lop"

exit


This makes them jump at half second intervals so they don't get tangled up.   Make sure they are high enough for the chutes to deploy.  If you don't unassign them from the vehicle they try to get back in it.

There are various paradrop scripts in the Ed Depot, mostly for HALO and other fancy stuff.  
Plenty of reviewed ArmA missions for you to play