Results 1 to 10 of 10

Thread: Wont stay out of the airplane

  1. #1

    Wont stay out of the airplane

    Made a script so when AI aircraft are low on fuel they'll land.
    It works ...... except when they land and jump out, they turn around, get back in and take-off !!

    Please suggest how to make them stay OUT !

    PHP Code:
    _plane _this select 0;

    sleep 15;
    waitUntil {((fuel _plane) < 0.1)};
    if ((
    alive _plane) and (isengineon _plane) and ((getpos _plane select 2) > 1) and ((speed _plane) > 2)) then
    {
        
    _plane land "GET OUT";
        
    dogetout (driver _plane);
        
    unassignvehicle (driver _plane);
    }; 

  2. #2
    Quote Originally Posted by [APS]Gnat View Post
    Made a script so when AI aircraft are low on fuel they'll land.
    It works ...... except when they land and jump out, they turn around, get back in and take-off !!

    Please suggest how to make them stay OUT !

    Try "leavevehicle".

    WW1 ArmA:CWA Mod || Romans and Barbarians ArmA:CWA Mod
    Goodbye W0lle, we'll miss you

  3. #3
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    _plane land "GET OUT"; is for helicopters,
    use landat for planes, or getOut waypoints or unassignVehicle near the airport of choise.
    landat number is different on many maps, test in editor to find correct one.

    also i find using actions instead of dogetout work better in other scripts in the past, and i use unassignVehicle before the getout command.

    Code:
    _plane = _this select 0;
    
    sleep 15;
    waitUntil {((fuel _plane) < 0.1)};
    if ((alive _plane) and (isengineon _plane) and ((getpos _plane select 2) > 1) and ((speed _plane) > 2)) then
    {
    	_plane landat 1;
    	waitUntil {!canmove _plane OR (speed _plane) < 2};
    	unassignvehicle (driver _plane);
    	(driver _plane) action ["getOut", _plane];
    };
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  4. #4
    First Lieutenant [APS]Gnat's Avatar
    Join Date
    Jun 28 2003
    Location
    Australia
    Posts
    5,769
    Author of the Thread
    Thanks ProfT ! Nearly ..... but not quite.
    Independant AI land and stay out, but members of your group simply ignore the (silent) command and stay flying

    Thanks Demonized, but from memory I think that Action version means they JUMP out mid-air !
    Its addon scripting so I wont be doing waypoints and I'm not going to get picky about what airport is available.
    Last edited by [APS]Gnat; Jun 21 2011 at 16:49.

  5. #5
    Quote Originally Posted by [APS]Gnat View Post
    Thanks ProfT ! Nearly ..... but not quite.
    Independant AI land and stay out, but members of your group simply ignore the (silent) command and stay flying

    Thanks Demonized, but from memory I think that Action version means they JUMP out mid-air !
    Its addon scripting so I wont be doing waypoints and I'm not going to get picky about what airport is available.
    And adding :

    Code:
    [driver _plane] orderGetIn false
    after the unassign command ?

  6. #6
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    getOut = stop and exit. (edit: this action did nothing witout unassignVehicle first.)
    eject = .......... you know.

    and since you dont care where he lands, just use
    Code:
    unassignVehicle (driver _plane);
    tested in editor, he lands at nearest airport, taxes away from runway, then exits, and stands still, not getting in.
    if i have waypoints on him, he continues on foot after landing.

    so no need for fancy dogetouts or anything.

  7. #7
    Code:
    unassignvehicle (driver _plane);
    (driver _plane) action ["getOut", _plane];
    Try switching these 2 commands around, sometimes the code order makes a difference..

    Code:
    (driver _plane) action ["getOut", _plane];
    unassignvehicle (driver _plane);
    maybe add a very quick sleep command between the codes to ensure that the codes activate seperately.

    Code:
    (driver _plane) action ["getOut", _plane];
    sleep 0.1;
    unassignvehicle (driver _plane);

  8. #8
    First Lieutenant [APS]Gnat's Avatar
    Join Date
    Jun 28 2003
    Location
    Australia
    Posts
    5,769
    Author of the Thread
    Quote Originally Posted by Demonized View Post
    getOut = stop and exit. (edit: this action did nothing witout unassignVehicle first.)
    eject = .......... you know.
    No, I just tested it again. Just watched 2 pilots jump to their death.
    This could of course be an issue with the current beta patch.
    i.e. with this code;
    unassignvehicle (driver _plane);
    (driver _plane) action ["getOut", _plane];
    @ProfT
    That work. And there seems to be no side-effect, you can order AI back into the plane. Thanks!
    _plane land "GET OUT";
    dogetout (driver _plane);
    unassignvehicle (driver _plane);
    [(driver _plane)] orderGetIn false;
    *Commanding Officer yelling at his pilot* "How many times have I got to tell you to get the F%$# out of that plane ...... 4! ..... Where is your F#%$&^% brain soldier!?"

    @ ArmASalt3 and Demonized
    Thanks for pitchin in.
    Last edited by [APS]Gnat; Jun 22 2011 at 16:38.

  9. #9
    Are you running Zeus AI? They do seem to like to get in any nearby vehicle, even if it's enemy.
    Documentation is not a dirty word.
    : TeamSPAFF : PRACS : RKSL : Stella Artois : Creme Eggs : GITS :

  10. #10
    First Lieutenant [APS]Gnat's Avatar
    Join Date
    Jun 28 2003
    Location
    Australia
    Posts
    5,769
    Author of the Thread
    No, I don't run mods while making Addons ..... thats just asking for trouble.
    ...... bad enough running betas

Posting Permissions

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