Okay folks. My brain hurts so I am going to make you all think for me before I pull out my last grey hair. I am writing missions for a Vietnam campaign using SEB's MOST excellent Nam v2.0 addon. I am putting the finishing touches on perhaps my greatest mission to date. A lot going on here. I decided while I was sitting there that there was just thing missing, MEDIVAC. So I started building a script that is activated on a radio call from the unit leader. This is what it looks like so far:
; Start a Green Smoke Shell
_counter = 0
_leader = leader sqd2
_leader SideRadio "Medivac"
~4
MashPilot SideRadio "Mash32"
~30
_sx = getpos smoke select 0
_sy = getpos smoke select 1
_smokeit = "SmokeShellGreen" camcreate [_sx, _sy, getpos smoke select 2]
; Check to see who has greater than 50 pct damage to them and is still alive.
#Check
_man = [man1, man2, man3, man4, man5, man6, man7, man8, man9, man10, man11, man12]
_wounded = _man select _counter
_woundlvl = getdammage _wounded
? (_woundlvl >= .5) : _wounded AssignAsCargo Mash32
_counter = _counter+1
? (_counter == 11) : goto "End"
goto "Check"
#End
exit
The smoke pops, the medivac chopper zooms in, lands and hovers at the LZ and won't leave until every unit that is injured in your unit has been put aboard the chopper. Once that happens the chopper lifts off and flies back to base with your wounded units on board while you stay and fight on.
This is what I cannot figure out. I need to know WHO is in the cargo space of the Medivac chopper so that I can unassign them from your squad and then delete them out of the game since they won't be coming back. There is another problem too. The UH-1 Medivac choppers can only carry 4 people in the cargo area. So if there are more than 4 injured guys in your unit well... they run after the chopper after it dustoffs and heads back to base.. Which admittedly was DAMN funny to watch..
So In summary. 2 Questions:
1. How do I get an array of WHO is in the chopper EASILY. I know about the Unit IN Vehicle command but I don't think that is it. There should be way to ask a vehicle WHO is in your cargo space and what are their names so they can be handed off to a script snippet that removes them from the game.
2. More than 4 injured guys Equals a really funny display of stupidity. How do we get the chopper to come back for the rest once it removes the first batch from its cargo?
Yours Truly, Captain P.J. Smitty served with a white win under glass.