Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Get chopper to land and stay with engine on.

Hybrid View

  1. #1

    Get chopper to land and stay with engine on.

    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:
    Code:
    // 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.

  2. #2
    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.

  3. #3
    First Sergeant Tophe's Avatar
    Join Date
    Jun 4 2004
    Location
    Örebro/Sweden
    Posts
    925
    Author of the Thread
    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?
    Code:
    ...
    ..
    chopper flyinHeight 0;
    // drop off and go home
    waitUntil {!allAboard};
    chopper forgetWeEverSaidFlyInHeight;
    chopper doMove (position h1);

  4. #4
    Quote Originally Posted by Tophe View Post
    Is there someway to just release the flyInHeight command like this?
    Code:
    ...
    ..
    chopper flyinHeight 0;
    // drop off and go home
    waitUntil {!allAboard};
    chopper forgetWeEverSaidFlyInHeight;
    chopper doMove (position h1);
    Yeah, the command is 'chopper flyInHeight whateverTheDefaultFlyingHeightIs'

  5. #5
    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_e....Chernarus.rar

    Regards,

    Sander

  6. #6
    First Sergeant Tophe's Avatar
    Join Date
    Jun 4 2004
    Location
    Örebro/Sweden
    Posts
    925
    Author of the Thread
    @ 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.

  7. #7
    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...

  8. #8
    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.
    Last edited by Nephris1; Jul 14 2010 at 01:15.

  9. #9
    Why not waypoijnts?
    It would work a lot better.

    _neo_
    Proud community admin/member of The Tour of Teamrespawn

  10. #10
    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.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •