Getting The Arma II AI To Takeoff And Land.

A10 Takeoff Arma II AI

How To Get AI Pilots to Use The Airport.

A while back I was chatting with a reader of this blog (Robert) about AI pilots and how to get them to take off and land from the airports. Robert suggested other people may be interested and that I should write up a post. So I did.

In this post I’m going to take a look at fixed wing aircraft and how the AI uses them with the stock Arma II airports. Note that nothing in this post applies to helicopters, as the Arma 2 AI treats helicopters completely different than planes.

AI Taking Off From An Airport

Getting an AI piloted aircraft to take off from an airport is straight forward. All that is required is to insert an occupied aircraft near the taxiway. At the mission start the AI will taxi to the end of the runway and take off; no waypoint or scripting required.

Grishno air traffic patterns

Grishno Air Traffic Patterns

Each airport will have its own unchanging traffic pattern for taxiing, take off and landing. As an example, see the figure to the right for the traffic patterns of the Grishno airport in Chernarus. The only thing you as a mission builder have to be concerned with is the placement of the aircraft and any other units near the taxiway.  If you place the plane too far from the taxiway the plane may collide with buildings as the AI pilot tries to get to the taxiway. If there are any editor placed units too close to the taxiway the AI pilot will stop and start repeatedly until it taxies past the nearby unit. Ideally the AI should be placed on the taxiway faceing the same direction as the traffic pattern with no other units near the taxiway. Another alternative is to place the plane near the taxiway perbendicular to the trafic pattern. See figure below.

Aircraft Placement on Taxiway

Aircraft Placement on Taxiway

AI Landing At An Airport

Depending on what your mission requires, you have three options to get the AI to land a fixed wing aircraft at an Arma II Airport. The Get Out waypoint type, the landAt script command or the “land” action script command.

Get Out Waypoint Type

When a flying aircraft has a Get Out waypoint placed on the map, the AI will:

  1. land at the airport closest to the Get Out waypoint, following the airport’s air traffic pattern
  2. taxi the aircraft
  3. stop the aircraft on the taxiway
  4. stop the engines and disembark

landAt Script command

The landAt script command will cause the AI pilot to:

  1. fly towards the airfield specified by the landAt command
  2. land at the airport, following the airport’s air traffic pattern
  3. taxi the aircraft
  4. take off again.

Syntax for the landAt command is:

plane_name landAt airport_id

“land” Action Script command

The “land” Action script command will cause the AI pilot to:

  1. fly towards the nearest airfield
  2. land at the airport, following the airport’s air traffic pattern
  3. taxi the aircraft
  4. take off again.

Syntax for the “land” Action command is:

plane_name action ["Land", plane_name]

The two script commands could be used anywhere; inside a larger script, in a radio trigger, in a waypoint etc. so it’s a bit difficult to come up with an example of their uses. To keep things simple I’ve created an example mission where I inserted an A-10 and an F-35 near Grishno.

For the F-35 I set the following:
Name: my_f35
Special: Flying

For the F-35 I inserted a waypoint with
my_f35 action ["Land", my_f35]
in the On Act. field.

When I inserted the A-10 I set the following options:
Name:
my_a10
Special:
Flying

For the A-10 I inserted a waypoint with
mya10 landAt 0
in the On Act. field. (0 is the airport ID of the Grishno airport)

When I preview the example mission the F-35 finds the nearest airport (Grishno), lands, taxis and takes off again. The A-10 flies directly to Grishno, lands and takes off like the F-35. Grab the example mission below and try it out.

Reference

landAt command reference

action command reference

Example mission ai_landing.Chernarus