Home   Help Search Login Register  

Author Topic: Our chopper got shot down, how can we script in a back up plan?  (Read 1095 times)

0 Members and 1 Guest are viewing this topic.

Offline Bennet

  • Members
  • *
I've been through COMREF and I'm using ArmA Edit (though I'm not real good with it), in this mission I have 3 special forces teams that are surrounding the runway in which I'm rescuing a CIA agent.  They're all independent of one another (due to the fact the Hinds only hold eight) 

What I'm wanting to do is have a script in which when it's activated the SF's guys are extracted by the very hinds that provided them aircover, however, during the course of the mission often one or two of them are shot down leaving them no transport out.  I've attempted to assign them into groups, as in: 
Code: [Select]
alphaGroup = group this

Also.........they don't respond to commands in the format I have listed below, when I specify specific members of the group they will board the chopper though.   :dunno:   :scratch:

Code: [Select]
alpha assignAsCargo mi; [alpha] orderGetIn true; mi land "get in"
What I'm really trying to do is run a script with a fallback plan, something along the lines of "if mi1 is shotdown, 3 of the men get into mi2, 2 get into mi3", or if two of the choppers are shot down and there isn't room activate another one, or two more to come and save the day.

Any idea?   :)   :dunno:
Bennet

"Mr. President, I'm not saying we won't get our hair mussed. I do say, no more than ten to twenty million killed, tops! Depending on the breaks."

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
You have made some odd assumptions:
- Variables with different names are not the same. alphaGroup is not, in any way, associated with alpha.
- A group is not a list of soldiers. Use units command to get an array containing all the members of the group.
- assignAsCargo requires a single soldier before the command and a vehicle after it (_soldier assignAsCargo _vehicle).
- orderGetIn requires an array of soldiers before the command and a boolean after it (_arrayOfSoldiers orderGetIn true).

Code: (init on each member of the group) [Select]
alphaGroup = group this

Code: (When you want the group to get in the chopper) [Select]
_soldiers = units alphaGroup; // Get the array of soldiers in the group.
{ _x assignAsCargo mi } forEach _soldiers ; // Tell each soldier individually that they have a place in the hind.
_soldiers orderGetIn true; // Tell every solder at once to get into their assigned place.
mi land "get in"

Remember, the COMREF is your best resource for working out how the commands should be used. Also look at tutorials, such as Cheetah's SQF tutorial, to get a better idea of how to code.
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)