Jump to content
Sign in to follow this  
fildred13

Force units to leave group and stay in helicopter?

Recommended Posts

I have a group of POW's that join the player's group. They then leave the player's group when they board one of the evac helicopters.

But, when they leave the group, they get out of the helicopters. I don't know why they're doing this, and if you could solve this part in an easier way than what I'm about to describe, let me know.

My solution was to first disable their move AI, then remove them from the player's group. Unfortunately, apparently the movement section of their AI isn't responsible for getting into and out of vehicles, because they get out then don't move anywhere.

How do I lock the POWS into the choppers, bearing in mind that any number of POWS could be in any of the evac choppers - i.e. all 3 in 1 chopper, 2 in 1 chopper and 1 in the other, or maybe 2 POWS died and now only 1 is in one of the choppers.

What I have so far, which isn't working:

hint "Hostages Secured.";
{_x disableAI "move"} forEach POWS;
{[_x] joinSilent grpNull} forEach POWS

Share this post


Link to post
Share on other sites

I'm not sure this will work 100% as details are a little light.

I wanted units to enter a chopper and wait for the pilot, however they get in the pilot seat so I used this to move them out.

Place in each vehicles init.

this addEventHandler ["getin",{
(_this select 2) assignAsCargo (_this select 0);
 [(_this select 2)] ordergetin true;
 null=_this spawn {sleep 1;
 (_this select 2) moveincargo (_this select 0);
 [_this select 2] join grpnull;} }];

If the pilot is already in the chopper it should still work.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Basically worked like a charm. I had to add a little conditional statement to the beginning to only execute for the hostages (otherwise I lose control of my squadmates when they get in.) Thanks for the help!

this addEventHandler [
"getin",{
	if ((_this select 2) == pow1 || (_this select 2) == pow2) then {
   			(_this select 2) assignAsCargo (_this select 0);
    			[(_this select 2)] ordergetin true;
    			null=_this spawn {sleep 1;
    			(_this select 2) moveincargo (_this select 0);
    			[_this select 2] join grpnull;}
	}
}
];  

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  

×