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

Triggers, Spawns, Airports, Targets, and Regiments

AiTrigger and AiAction represent mission triggers and actions (get via GamePlay.gpGetTrigger, gpGetAction). AiBirthPlace is a spawn point; AiAirport is an airfield or carrier. AiTarget represents a mission target; AiTargetType and AiTargetGoal are constants. Regiment provides regiment metadata (army, name, country, etc.).


AiTrigger

Kind: interface
Mission trigger. Get with GamePlay.gpGetTrigger(string name). When a trigger fires, OnTrigger is called; you can also get the associated AiAction and call Do().

Member Type Description
Name string Trigger name.
Enable bool Get/set enabled state.
Active bool True when trigger is active.
Multiple bool True if trigger can fire multiple times.

AiAction

Kind: interface
Action linked to a trigger or callable by name. Get with GamePlay.gpGetAction(string name).

Member Type Description
Name string Action name.
void Do() Execute the action.
CounterOperations int Counter of operations.

AiBirthPlace

Kind: interface
Spawn point (airfield, carrier, etc.). Get array from GamePlay.gpBirthPlaces().

Member Type Description
Tag object Get/set; custom data.
bool IsValid() bool True if spawn is valid.
string Name() string Spawn name.
int Army() int Army.
string Country() string Country.
string Hierarchy() string Hierarchy.
Regiment Regiment() Regiment Regiment.
Point3d Pos() Point3d Position.
int MaxPlanes() int Max planes.
bool IsParachute() bool Parachute spawn.
bool IsSetOnPark() bool Set on park.
bool IsScramble() bool Scramble spawn.
string[] GetAircraftTypes() string[] Available aircraft types.
BitArray GetWeaponsMask(string aircraft) BitArray Weapons mask for aircraft.
string CheckWeapons(string aircraft, string weapons) string Validate weapons for aircraft.
void destroy() Destroy the birth place.

AiAirport

Kind: interface (extends AiActor)
Airfield or carrier. Get array from GamePlay.gpAirports().

Member Type Description
int Type() int AiAirportType flags (GROUND, MARITIME, CARRIER).
double FieldR() double Field radius.
double CoverageR() double Coverage radius.
int StripCount() int Number of strips.
int StripState(int indxStrip) int AiAirportStripState for strip.
double StripWidth(int indxStrip) double Strip width.
double StripLength(int indxStrip) double Strip length.
double StripDirection(int indxStrip) double Strip direction.
int ParkCountAll() int Total park count.
int ParkCountFree() int Free park count.
AiActor[] QueueTakeoff() AiActor[] Takeoff queue.
AiActor[] QueueLanding() AiActor[] Landing queue.

AiAirportType

Kind: static class

Constant Value Description
GROUND 0x01 Ground airfield.
MARITIME 0x02 Maritime.
CARRIER 0x04 Carrier.

AiAirportStripState

Kind: static class

Constant Value Description
EMPTY 0 Empty.
TAKEOFF 1 Takeoff.
LANDING 2 Landing.
BLOCKED 3 Blocked.
DAMAGED 4 Damaged.

AiTarget

Kind: interface (extends AiActor)
Mission target (primary/secondary/secret, destroy/escort/etc.).

Member Type Description
int Type() int AiTargetType (PRIMARY, SECONDARY, SECRET).
int Goal() int AiTargetGoal (DESTROY, ESCORT, etc.).
int AppliesArmy() int Army the target applies to.
AiActor TargetActor() AiActor Target actor.
void Destroy() Destroy the target.

AiTargetType

Kind: static class

Constant Value Description
PRIMARY 0 Primary target.
SECONDARY 1 Secondary target.
SECRET 2 Secret target.

AiTargetGoal

Kind: static class

Constant Value Description
DESTROY 0 Destroy (e.g. aircraft).
DESTROY_COLUMN 1 Destroy column (e.g. tanks).
DESTROY_GROUND 2 Destroy ground.
DESTROY_BRIDGE 3 Destroy bridge.
INSPECT 4 Inspect.
ESCORT 5 Escort (e.g. aircraft).
DEFENCE_COLUMN 6 Defence column.
DEFENCE_GROUND 7 Defence ground.
DEFENCE_BRIDGE 8 Defence bridge.

Regiment

Kind: interface
Regiment info (from AiBirthPlace.Regiment() or AiAircraft.Regiment()).

Member Type Description
int army() int Army.
string name() string Regiment name.
string fileNameEmblem() string Emblem file name.
string country() string Country.
string speech() string Speech.
string id() string Id.
int gruppeNumber() int Gruppe number.