Jump to content
Sign in to follow this  
Saltoperator

AI pilot taking over after unitPlay is a pain - any remedies?

Recommended Posts

Since the Arma 3 AI pilots tend to flare more than RuPaul when landing, even when in stealth mode, I decided to use unitCapture and unitPlay for the insertion in one of my scenarios.

 

After a very smooth, low-approach landing by me, if I may say so 😊, I kept the recording of me touching ground going for about 5-6 seconds before ending it.

 

When the recording is over, I want to pass control back to the AI and have him fly away after every player inside has disembarked. This has proven difficult to achieve.

 

Setup:

 

  • heli1 is its variable
  • My heli has this setFuel 0; this flyInHeight 0; in its init field to 100% prevent engine start in MP
  • It has a Hold waypoint in front of it as its first waypoint 
    • A Skip Waypoint trigger is set as Waypoint Activation
      • UnitPlay is triggered when all playable units present in the scenario are inside the heli via  (AI is disabled in description.ext)
      • this setFuel 1; is part of the trigger to have engine turned on when AI is supposed to take over. flyInHeight is still 0;
  • pilot disableAI "ALL" in pilot's init field

     

    Methods attempted:

     

    • Place a second Hold waypoint close to where the heli lands in unitPlay
      • A Skip Waypoint trigger is set as Waypoint Activation
        • { _x in heli1 } count allPlayers == 0 in Condition field
        • pilot enableAI "ALL" in On Act field in second Hold waypoint trigger.
        • Next waypoint is MOVE, then LAND for AI to land back at the ship.
    • Attached an invisible helipad to the heli
      • I tried using a Land waypoint as the second waypoint, as I had a helipad close to where I landed in unitPlay that the AI pilot insisted on landing on after assuming control again when testing

     

Share this post


Link to post
Share on other sites

I ended up solving this issue by simply adding an action after the unitPlay is done playing:

 

_heli1movedata = [LOTS OF COORDINATES OMITTED TO MAKE THIS POST SHORT];
_heli1playback = [heli1, _heli1movedata] spawn BIS_fnc_UnitPlay;
sleep 55;
player action ["Eject", vehicle player];

 

The playback itself lasts ~60 seconds, where ~5 seconds are spent on ground. I therefore eject the player 5 seconds before the playback ends (and the helicopter starts moving on its own).

 

I hope this can be helpful for others stuck with this problem, instead of trying to fiddle too much with the questionable helicopter AI.

  • Thanks 1

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  

×