OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Doc on 21 Feb 2018, 18:15:10

Title: Force out of helicopter
Post by: Doc on 21 Feb 2018, 18:15:10
I have a mission beginning, where I want a helicopter to land, then have the player and his squad get out of the helicopter. I've got the player and his squad into the copter using

"_x moveIncargo nighthawk" foreach units group this;

Problem is I get no option to Eject/Getout of the heli when it lands. Any ideas on how to do this? :hmmm:
Title: Re: Force out of helicopter
Post by: h- on 22 Feb 2018, 07:30:39
Try assignAsCargo (http://www.ofpec.com/COMREF/index.php?action=details&id=25&game=All) before moving them in :dunno:

Don't recall  ever hearing about not having the getout/eject action available ???
Title: Re: Force out of helicopter
Post by: Gruntage on 23 Feb 2018, 08:39:40
I don't recall ever having this issue and I used that command alot. I never had the need to assign them as cargo beforehand. Is the helicopter locked perhaps?

Is it one of the standard choppers in the game or is it an addon? Wouldn't have thought this would be a factor but it could well be.
Title: Re: Force out of helicopter
Post by: Doc on 23 Feb 2018, 17:23:39
Gruntage you nailed the problem right on the head. I had the helicopter locked... :good: haha oh well my bad. Now I got a new issue how do I get my units into an empty unassigned boat?
Title: Re: Force out of helicopter
Post by: h- on 23 Feb 2018, 18:00:39
Did not even cross my mind to suspect vehicle lock  :D
Title: Re: Force out of helicopter
Post by: Gruntage on 23 Feb 2018, 19:54:26
Quote
Now I got a new issue how do I get my units into an empty unassigned boat?

Are the units under your command?

If not, then you will need to assign one of them as a driver, one of as a gunner (if applicable) and the rest as cargo. The syntax is:

Code: [Select]
_soldier assignAsCargo _boat

Where _soldier and _boat are the names of the units. For the units being assigned as driver and gunner, use assignAsDriver & assignAsGunner. As a sidenote, if you're dealing with a vehicle with a commander spot (ie tank), you can use assignAsCommander.

After you've assigned your units, providing that the units are NOT under direct control of the player, you use the orderGetIn command:

Code: [Select]
[_soldier] orderGetIn true
If you have all of your units getting in as cargo, you can simplify matters by using this:

Code: [Select]
{[_x] OrderGetIn true} foreach units _groupname

However if you have one of your units getting in as a driver then you can't use this, and I think you will have to name each unit and have a line of code for each unit...not sure if there is an easier way of doing this.

Hope that helps.

PS. Next time open a new thread for a new question  :)
Title: Re: Force out of helicopter
Post by: h- on 25 Feb 2018, 09:03:11
Quote
If you have all of your units getting in as cargo, you can simplify matters by using this
Considering the command takes an array as argument, no need for a looped method
Code: [Select]
(units _groupname) orderGetIn trueshould suffice..
Assuming of course that the command actually works as advertised  :P