Jump to content
alpha993

Force helicopter to stay on land while loading troops

Recommended Posts

I have run into a fairly frustrating problem involving AI helicopter pilots and squads attempting to board helicopters.

 

The situation is as follows: I have a helicopter with its engine on waiting on the ground. Then, I order my squad members to board that helicopter, but as soon as I do the helicopter takes off, goes to about fifty meters, and then lands again to allow my squad members to enter. This also occurs with editor-based waypoints. As soon as an AI squad activates a 'Get In' waypoint, the AI flying the helicopter shoots up into the air and then lands again.

 

Is there any way to force the AI helicopter to not do this, and stay on the ground instead?

 

I have tried everything from synchronizing load and get-in waypoints (with a condition to wait for the units to get in), using disableAI "ALL", disabling the simulation of the helicopter's pilot, placing an invisible helipad directly under the helicopter, etc., but nothing works.

 

Note that it is necessary for the helicopter's engine to be on to achieve the necessary effect as this takes place during a cutscene. Any suggestions would be greatly appreciated.

Share this post


Link to post
Share on other sites

Thanks, but that mission doesn't exactly solve my problem.

 

Here's a little video showcasing the unwanted behavior so it's easier to understand what I mean (not quite sure how to embed a video).

 

https://www.youtube.com/watch?v=MPyfFKYBmIE

 

  1. Helicopter starts out idle on the ground with its engine on.
  2. I order my AI to board it.
  3. Helicopter somehow reacts to this and takes off instead of staying grounded.
  4. Helicopter lands again and then allows my AI to board it.

Share this post


Link to post
Share on other sites

I'm having the same problem.

 

Also, once the helo lands so that my team and I can get out, instead of waiting on the ground for the Condition in its Land waypoint to be fulfilled, it immediately takes off and hovers dozens of meters above the ground - so there's no way for me to get back in later. Why doesn't the AI stay landed?

Share this post


Link to post
Share on other sites
34 minutes ago, Salty Bear said:

I'm having the same problem.

 

Also, once the helo lands so that my team and I can get out, instead of waiting on the ground for the Condition in its Land waypoint to be fulfilled, it immediately takes off and hovers dozens of meters above the ground - so there's no way for me to get back in later. Why doesn't the AI stay landed?

As far as I recall this behavior broke some time ago, this snippet usually worked fine, this is now no longer the case:

_test = [] spawn {

	_chopper = chopper;
	_infGroup = group player;
	doStop _chopper;
	_chopper land "Get In";

	waitUntil {crew _chopper arrayIntersect units _infGroup isEqualTo []};//players group left the chopper
	driver _chopper sideChat "Group left, ready to board";
	waitUntil {count (units _infGroup select {_x in crew _chopper}) isEqualTo count units _infGroup};//players group boarded the chopper
	driver _chopper sideChat "Group boarded, RTB";
	_chopper land "NONE";
	_chopper move [0,0,0];
	
};

Choppers usually take off after some units leave/board at random, never figured out what's needed to override this behavior, life's too short for trying to fix AI, heh.

 

Cheers

Share this post


Link to post
Share on other sites

So, what seems to work is to set up a disableAI command on the helicopter pilots to keep them from taking off. Something like:

waitUntil {helo getPosATL select 2 == 0}; //using isTouchingGround makes the helo hover low (but not low enough to get back in) instead of touch down - I haven't tested helo getPosATL select 2 == 0 to see if it works any better.

_heloDrivers = [heloD, heloCD]; //I named the helo's pilot and copilot heloD and heloCD in the editor.
{_x disableAI "ALL"} forEach _heloDrivers;

 

Share this post


Link to post
Share on other sites
1 hour ago, Salty Bear said:

So, what seems to work is to set up a disableAI command on the helicopter pilots to keep them from taking off. Something like:


waitUntil {helo getPosATL select 2 == 0}; //using isTouchingGround makes the helo hover low (but not low enough to get back in) instead of touch down - I haven't tested helo getPosATL select 2 == 0 to see if it works any better.

_heloDrivers = [heloD, heloCD]; //I named the helo's pilot and copilot heloD and heloCD in the editor.
{_x disableAI "ALL"} forEach _heloDrivers;

 

 

As rule of thumb, never use waitUntil "real parameter" == 0. It's too much precise and not evident to match in this case. To say the truth, it's "statistically near impossible". You'd better write something like < 0.2 in such case.

Share this post


Link to post
Share on other sites

I'm not sure why you're writing that. I just tested with a Goshawk:

 

- first waypoint move (on an helipad, preferably) . In its "on activation" field:  vehicle this land "get in"

- second waypoint, move also, close to the first one (just the condition to be completed). In its condition field: {_x in yourHelo} count units yourGroup == count units yourGroup

- third waypoint : destination.

 

No unwanted extra movement.

 

 

Now, for an AI group to board, you need to replace the first "move" waypoint of the helo by a "load" one. add also a "get in" waypoint for the AI group and sync this one with the "load" one, of helo. You can add a similar synced couple of waypoints "Transport unload" and "get out" at destination.

 

Each time you need a specific condition to make helo go on its path, just add a close waypoint (distance completed by proximity) with your condition.

  • Like 2

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

×