Arma 3 Scripting

Arma 3: Missile flight profiles

  • Also known as Arma 3 Missile flight profiles

Topic · Markdown · JSON · original wiki page

Since Arma 1.82 it is possible for precision guided munitions to utilize different flight profiles or acquire targets after being launched. You can do that by adding an flightProfiles array to the ammo config and creating classes for specific profiles. Each profile has different properties which should be specified in order to avoid the usage of default values, which are usually just fallback values.

The flight profile also needs to be specified as a weapon's fire mode - paired by using the same name in both ammo and weapon configuration. Otherwise the weapon won't be able to utilize the munition's flight profile mode.

Flight phases

FSM-like system is used to control different phases of missiles and the transitions between them

Profiles

Direct

This is the default mode. It is automatically added when the ammo config does not specify any flight profile. It is also added if the weapon fire modes contain more fire modes (usable by the player) than those that are linked to specific missile flight profiles.

There are no special properties.

TopDown

Flight profile that imitates top attack. The missile initially gains desired flight level and keeps it till it’s close enough to the target, then performs a dive and strikes the target from the top

minDistance

Minimal distance from the target to perform top-down attack; if the target is closer, Direct flight mode is chosen instead

minDistance = 180.0;

ascendHeight

Desired flight level used to approach the target

ascendHeight = 150; // missile won't try to reach this altitude once it passes the descendDistance

ascendAngle

Angle used to gain the desired flight level

ascendAngle = 30.0; // missile won't keep climbing once it passes the descendDistance

descendDistance

When reached, the missile will enter last phase of the flight - attack from the top

descendDistance = 180; // have some headroom for the missile turning down, the missiles won't be able to do much more than 45° descend angle

LoalDistance

Lock-on After Launch mode, where a munition (missile) fired without a lock will start autonomously looking for available targets once it reaches a defined distance from parent object. It is intended to use this mode together with the auto seek ability, otherwise the missile gets lost after reaching the desired distance from parent and just flies straight forward. With the autoSeekTarget enabled the missile will search for a target in its (configured) lock cone area.

lockSeekDistanceFromParent

The desired distance from parent when the missile should start to seek a target

lockSeekDistanceFromParent = 500;

LoalAltitude

Lock-on After Launch mode, where a munition (bomb) fired without a lock will start autonomously looking for available targets once it reaches a defined altitude. This flight mode is designed mainly for bombs. It is intended to use this mode together with the auto seek ability, otherwise the bomb gets lost after reaching the desired altitude and simply drops to the ground.

The bomb searches for a target in lockSeekRadius around the initially computed impact point (CCIP)

lockSeekAltitude

The desired altitude upon which the bomb starts to seek a target

lockSeekAltitude = 300;

Overfly

Flight profile that imitates an overfly top attack mode. Intended to be used together with submunition (an explosive formed projectile) that is created after reaching specified point above the target and strikes the target from the top.

Because this flight profile is so far intended only for missiles with submunition, no other phases are interesting in this case and the submunition should be created after reaching the point above the target)

overflyElevation

Elevation above the target when the missile is actually heading

overflyElevation = 2.5; // use with same or bigger triggerDistance of the submunition

Cruise

Flight mode that in a simple manner imitates the behaviour of a terrain following missile. The missile uses sea-skimming/terrain-hugging in specified altitude while approaching the target.

preferredFlightAltitude

Altitude above terrain/sea that the missile is trying to keep during the flight; this is not actually altitude above sea-level, this is just the vertical distance from ground/sea

preferredFlightAltitude = 50;

lockDistanceToTarget

Distance to the target that triggers target visibility checks (only against terrain, objects are ignored)

lockDistanceToTarget = 500;

Diagnostics

Ref Arma_3_Diagnostics_Exe

Example Configuration

cfgWeapons.hpp

class my_launcher : MissileLauncher
{
  modes[] = { "Direct", "TopDown" };
  class Direct : Mode_SemiAuto
  {
    …
    textureType = "direct";
    displayName = "Direct";
    ...
  };
  class TopDown : Direct
  {
    textureType = "topdown";
    displayName = "Top-down";
  };
};

cfgAmmo.hpp

class my_missile : MissileBase
{
  ...
  lockSeekRadius = 100;
  flightProfiles[] = { "Direct", "TopDown", "LoalDistance", "LoalAltitude", "Overfly", "Cruise" };
  class Direct
  {
  };
  class TopDown : Direct
  {
    ascendHeight = 150.0;
    descendDistance = 200.0;
    minDistance = 150.0;
    ascendAngle = 70.0;
  };
  class LoalDistance : Direct
  {
    lockSeekDistanceFromParent = 300.0;
  };
  class LoalAltitude : Direct
  {
    lockSeekAltitude = 100.0;
  };
  class Overfly : Direct
  {
    overflyElevation = 4.0;
  };
  class Cruise : Direct
  {
    preferredFlightAltitude = 50.0;
  };
};

In this case, the launcher is capable of using Direct and TopDown flight profiles and the missile is capable of all the flight profiles. Thus - in the game - the player/AI will only be capable of switching between Direct and TopDown flight profile. If there will be another flight profile declared in the launcher - let’s call it XY - it would not be available to player/AI, because the ammunition does not support it.