1
air
Bruno Carneiro edited this page 2026-02-13 18:25:50 -03:00

Air Actors and Groups

AiAircraft extends AiCart and adds aircraft-specific state (regiment, fuel, weapons, damage). AiAirGroup represents a group of aircraft with waypoints and tasks. AiAirWayPoint and related enums define waypoint behavior. AiAirEnemyElement and EnemyAirInterf describe air enemies. Use IGamePlay.gpAirGroups, gpMakeAirGroup, gpAiAirGroup to get or create air groups.


AiAircraft

Kind: interface (extends AiCart)

Aircraft unit: regiment, fuel, rearm/refuel, limb and named damage, parameters.

Identity and regiment

Member Type Description
bool IsKilled() bool True if aircraft is killed.
Regiment Regiment() Regiment Regiment info.
string HullNumber() string Hull number.
string CallSign() string Call sign.
int CallSignNumber() int Call sign number.
string TypedName() string Type name.
string VariantName() string Variant name.
AircraftType Type() AircraftType Aircraft type (fighter, bomber, etc.).
bool IsAirborne() bool True if in the air.
AiAirGroup AirGroup() AiAirGroup Air group this aircraft belongs to.

Fuel and weapons

Member Type Description
void RearmPlane(bool gunsOnly) Rearm; if gunsOnly, only guns.
void RefuelPlane(int percentage) Refuel to given percentage.
int GetMinimumFuelInPercent() int Minimum fuel (from aircraft.ini).
double GetFuelCapacity() double Total fuel capacity (liters).
double GetCurrentFuelQuantity() double Current fuel (liters).
int GetCurrentFuelQuantityInPercent() int Current fuel (percent).

Damage (limbs and named)

Member Type Description
void hitLimb(LimbNames limb, double value) Modify limb integrity (negative = damage, positive = set).
void cutLimb(LimbNames limb) Detach limb.
void hitNamed(NamedDamageTypes type) Activate named damage.
void hitSelfNamed(NamedDamageTypes type) Activate self named damage.
double getParameter(ParameterTypes type, int subtype) double Get parameter; subtype -1 for generic.

Communication

Member Type Description
void SayToGroup(AiAirGroup group, string msg) Send message to group.

AiAirGroup

Kind: interface (extends AiGroup)
Air group: ID, army, aircraft count, task, waypoints, and enemy/friendly group relations.

Identity and counts

Member Type Description
int ID() int Group ID.
int getArmy() int Army.
NOfAirc int Current number of aircraft.
DiedAircrafts int Number of dead aircraft.
InitNOfAirc int Initial number of aircraft.

Hierarchy and relations

Member Type Description
AiAirGroup motherGroup() AiAirGroup Mother group.
AiAirGroup clientGroup() AiAirGroup Client group.
AiAirGroup leaderGroup() AiAirGroup Leader group.
AiAirGroup[] candidates() AiAirGroup[] Candidate groups.
AiAirGroup[] enemies() AiAirGroup[] Enemy groups.
AiAirGroup[] attachedGroups() AiAirGroup[] Attached groups.
AiAirGroup[] daughterGroups() AiAirGroup[] Daughter groups.
Vector3d Vwld() Vector3d World velocity.

Type and weapons

Member Type Description
bool isAircraftType(AircraftType t) bool True if group has this aircraft type.
int aircraftEnginesNum() int Number of engines.
bool hasBombs() bool Has bombs.
bool hasRockets() bool Has rockets.
bool hasCourseCannon() bool Has course cannon.
bool hasCourseWeapon() bool Has course weapon.
bool hasCourseTracers() bool Has course tracers.
bool hasPayload() bool Has payload.
bool hasBombsInInternalBays() bool Has bombs in internal bays.
bool hasTorpedos() bool Has torpedoes.

Task and targets

Member Type Description
void calcDangerType(double[] dt) Compute danger type array.
AiAirGroupTask getTask() AiAirGroupTask Current task.
void setTask(AiAirGroupTask task, AiAirGroup taskArg) Set task and optional target group.
void changeGoalTarget(AiActor taskArg) Change goal target actor.

Enemy reporting

Member Type Description
void SayNewEnemyGroup(EnemyAirInterf EE) Report new enemy group.
void SayEnemyGroupChangedCourse(EnemyAirInterf EE) Report enemy course change.
void SayEnemyGroupChangedHeight(EnemyAirInterf EE) Report enemy height change.
void SayEnemyGroupChangedIdent(EnemyAirInterf EE) Report enemy identification change.

AiAirWayPoint

Kind: class (extends AiWayPoint)
Air waypoint with action type, target, and attack/loiter options.

Member Type Description
Action AiAirWayPointType Waypoint action.
Target AiActor Target actor (for attack waypoints).
GAttackType AiAirWayPointGAttackType Ground attack type.
GAttackPasses AiAirWayPointGAttackPasses Number of passes.
LoiterBegin bool Loiter at start.
LoiterEnd bool Loiter at end.
LoiterTime int Loiter time.

Inherits P (Point3d) and Speed from AiWayPoint.


AiAirWayPointType

Kind: enum

Value Description
NORMFLY Normal fly.
TAKEOFF Take off (e.g. carrier).
LANDING Landing.
GATTACK_TARG Ground attack target.
GATTACK_POINT Ground attack point.
AATTACK_BOMBERS Attack bombers.
AATTACK_FIGHTERS Attack fighters.
HUNTING Hunting.
FOLLOW Follow friendly group.
ESCORT Escort.
COVER Cover friendly ground.
RECON Recon.

AiAirWayPointGAttackType / AiAirWayPointGAttackPasses

Kind: enum

  • AiAirWayPointGAttackType: AUTO, LEVEL, DIVE, TOP_MAST, SHALLOW_DIVE.
  • AiAirWayPointGAttackPasses: AUTO, _1, _2, _3, _4, ALL_OUT.

AiAirGroupTask

Kind: enum

Value Description
UNKNOWN 0
FLY_WAYPOINT Flying waypoints.
ATTACH Attach.
DEFENDING Defending.
ATTACK_AIR Attack air.
ATTACK_GROUND Attack ground.
PURSUIT Pursuit.
TAKEOFF Takeoff.
RETURN Return.
LANDING Landing.
DO_NOTHING Idle.

AiAirEnemyElement

Kind: class
Passed to OnAiAirNewEnemy. Describes an air enemy element.

Member Type Description
agID int Air group ID.
army int Army.
state int State.

EnemyAirInterf

Kind: interface
Snapshot of an enemy air entity (position, velocity, identification).

Member Type Description
ID_ int ID.
army_ int Army.
ident_ IDState Identification state.
P_ Point3d Position.
V_ Vector2d Velocity.
nOfAirc_ int Number of aircraft.

IDState

Kind: enum

Value Description
NONE No identification.
TYPE Type known.
MARK Mark known.
ALL Full identification.

AircraftType

Kind: enum (Flags)
Fighter, bomber, transport, etc. (e.g. Fighter, Bomber, DiveBomber, TorpedoBomber, Scout, Transport, Glider, SailPlane, Sturmovik, JaBo, HeavyFighter, Blenheim, …). Used with AiAircraft.Type() and AiAirGroup.isAircraftType().


DangerType

Kind: enum

Value Description
VAL Valid.
BOMB Bomb.
STORM Storm.
FIGHT Fight.
RECON Recon.