Jump to content
Sign in to follow this  
tophe

Get chopper to land and stay with engine on.

Recommended Posts

I've given up the task of syncing and messing with waypoint for a AI controlled chopper insertion/extraction.

I'm just going to script it instead.... it's a bit more predictable.

My problem now is that if I give a doMove command to a position and then do land "GET OUT".

The chopper will only go down, touch the ground and then go back to hovering.

It doesn't matter if I put another landing mode - same result.

If I give the doStop command after land the chopper will turn it's engines off and I don't want that.

So here's how I did it:

// go there
chopper doMove (position h2);
waitUntil {moveToCompleted chopper};
chopper land "GET OUT";
chopper flyinHeight 0;
// drop off and go home
waitUntil {!allAboard};
chopper flyinHeight 5;
chopper doMove (position h1);
waitUntil {moveToCompleted chopper};
chopper land "LAND";
doStop chopper;

This does the job... A bit ugly code, but at least the chopper will follow it.

But I wonder if there is some better way to do it.

Especially the land and flyInHeight thingy... not so pretty. I really don't want to spawn waypoints.

Share this post


Link to post
Share on other sites

I was just working on a script to do this last night, trying all kinds of stuff, and what I ended up with is pretty much exactly what you have. Scripting proper chopper landings has been an eternal struggle even since OFP.

Share this post


Link to post
Share on other sites

I tried this out a bit and I think it will do the trick for me.

I just wish I didn't have to use flyInHeight, I want the chopper to take off and fly with it's default height (whatever that is)

Is there someway to just release the flyInHeight command like this?

...
..
chopper flyinHeight 0;
// drop off and go home
waitUntil {!allAboard};
chopper forgetWeEverSaidFlyInHeight;
chopper doMove (position h1);

Share this post


Link to post
Share on other sites

It is possible to perform a helicopter extraction where the aircraft stays on the ground till everybody is aboard without any scripting. Below is a link to a mission demonstrating an extraction method. It uses a transport unload waypoint to drop off an AI (representing a loadmaster providing security for the heli) and the heli will stay on the ground till the player squad is on board.

http://www.xs4all.nl/~svdorst/co06_extraction_demo.Chernarus.rar

Regards,

Sander

Share this post


Link to post
Share on other sites
Is there someway to just release the flyInHeight command like this?

...
..
chopper flyinHeight 0;
// drop off and go home
waitUntil {!allAboard};
chopper forgetWeEverSaidFlyInHeight;
chopper doMove (position h1);

Yeah, the command is 'chopper flyInHeight whateverTheDefaultFlyingHeightIs' :D

Share this post


Link to post
Share on other sites

@ Northstar: Touché :) I was thinking more like the choppers default behaviour more than flyInHeight, since height seems to vary depending on the terrain.

@ Sander: Thank you for the demo mission. I did do it like that before (except that I put the condition in triggers and synced them with waypoints). However... it ended up a real mess on the extraction. And some waypoint are performed before the condition is met and some after. So I just wanted to keep it simple.

To simply tell the chopper to wait for the player group, go from a to b, wait for them to get out and then go back home. Then when the extraction trigger is m´fired the chopper goes from a to b and wait until all are aboard and then goes back home.

Using a short extraction script and a insertion script was actually much easier. It looks a bit bulky though.

Share this post


Link to post
Share on other sites

Hi Tophe

This sounds interesting - could you post a demo mission of this in action? (sorry kinda a newb when it comes to all the syntax). Plus I want to make this work so that the chopper takes off after a radio command (to simulate the squad leader loading a cargo (non human) into the chopper then giving the chopper the all clear to depart).

Any ideas? The usual linking radio bravo to the waypoint doesnt work for me for some reason...

Share this post


Link to post
Share on other sites

Well the problem with waypoint landing of choppers in editor, is imho the step before the "unload" wp.As the chopper needs time to get the correct position (even with empty helipad) and, even if u make it fly in 10m , the chopper gets higher awhile he drops down speed.

Very annoying if u try to make a scenario with a fast insertion.

So do u think u will be able to get that issue cracked with the scripted version?

edit: did u already tested the unitplay & unitcapture function?

I dont kow if u r goin for a generic script or just for private use.

So perhabs this is what ya was looking for.

I was amazed by it to be honest, as all AI faults and issues in flying canbe handled with that quiet comfortable imho .... like landing on roofs...fast insertion etc.

Edited by Nephris1

Share this post


Link to post
Share on other sites

Why not waypoijnts?

It would work a lot better.

_neo_

Share this post


Link to post
Share on other sites

UnitPlay and UnitCapture sound all well and good as long as you have a static LZ, but won't work if you want a dynamic pickup or dropoff location. Same with waypoints, unless you move the waypoints around via script, which is as much or more code than what he has already.

Share this post


Link to post
Share on other sites

Why you not place a trigger on your H with timeout approximately "5-7-10"

condition

chopper in thislist

on activation

Chopper engineOn true; doStop Chopper;

So after the land "land" order, the chopper is landing and waiting with running engine.

Regards Intruder

Share this post


Link to post
Share on other sites

Or just let the pilot eject when height = 0. The engine stays on.

Edit: Understood the question wrong...nvm.

Edited by Egosa-U
Missunderstanding question

Share this post


Link to post
Share on other sites
UnitPlay and UnitCapture sound all well and good as long as you have a static LZ, but won't work if you want a dynamic pickup or dropoff location. Same with waypoints, unless you move the waypoints around via script, which is as much or more code than what he has already.

No it wouldnt.

This:

// go there

chopper doMove (position h2);

waitUntil {moveToCompleted chopper};

chopper land "GET OUT";

chopper flyinHeight 0;

// drop off and go home

waitUntil {!allAboard};

chopper flyinHeight 5;

chopper doMove (position h1);

waitUntil {moveToCompleted chopper};

chopper land "LAND";

doStop chopper;

Would become this:

_grp = group chopper;

_wp1 = _grp addWaypoint [position h2, 0];

[_grp, 1] setWaypointStatements ["true", " chopper land 'GET OUT' "];

[_grp, 1] setWaypointType "MOVE";

waitUntil {!allAboard};

_wp2 = _grp addWaypoint [position h1, 0];

[_grp, 2] setWaypointStatements ["true", " chopper land 'LAND' "];

[_grp, 2] setWaypointType "MOVE";

And it will work a lot better for sure.

_neo_

Share this post


Link to post
Share on other sites

WORKS FOR ARMA 2 - UNTESTED IN OPERATION ARROWHEAD!

This should work. It requires waypoints but it works, I'm using it in my mission.

INITIALIZE (Put this in the waypoints activation box):

nul = [NAME_OF_HELO] execVM "engineon.sqf";

And the script itself (put this in your mission folder and call it "engineon.sqf"):

_unit = _this select 0;
  waitUntil {!(isengineon _unit)};
_unit engineon true;

This will wait until the helo has landed and as soon as he turns his engines off (thinking everything's fine and dandy) he turns them on again.

Like I say, you need a waypoint that the chopper will fly to and land on:

ON ACTIVATION:

NAME_OF_HELO land INVISIBLE_H_PAD_NAME; nul = [NAME_OF_HELO] execVM "engineon.sqf";

And another waypoint that it will fly to when everyone is picked up. You can give that a timer so the helo takes off after a certain ammount of time or you can put this in the condition box on the next waypoint:

CONDITION:

{alive _x} count (units group GROUP_LEADER_NAME) == {_x in HELO_NAME} count (units group GROUP_LEADER_NAME);

GROUP_LEADER_NAME would be the name of the unit in control of the group (obviously), not the actual group name (like RAZOR, it'd be something like Cooper because Cooper is in charge of Razor).

If you need anymore help on this then don't hessitate to send me a PM.

Edited by Bashkire

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  

×