Banner Image

Module Ops.Airwing

Ops - Airwing Warehouse.

Main Features:

  • Manage squadrons.

Author: funkyfranky

Global(s)

Global AIRWING

Be surprised!


Banner Image

The AIRWING Concept

An AIRWING consists of multiple SQUADRONS.

#AIRWING AIRWING

Be surprised!


Banner Image

The AIRWING Concept

An AIRWING consists of multiple SQUADRONS.

These squadrons "live" in a WAREHOUSE, i.e. a physical structure that is connected to an airbase (airdrome, FRAP or ship). For an airwing to be operational, it needs airframes, weapons/fuel and an airbase.

Create an Airwing

Constructing the Airwing

airwing=AIRWING:New("Warehouse Batumi", "8th Fighter Wing")
airwing:Start()

The first parameter specified the warehouse, i.e. the static building housing the airwing (or the name of the aircraft carrier). The second parameter is optional and sets an alias.

Adding Squadrons

At this point the airwing does not have any assets (aircraft). In order to add these, one needs to first define SQUADRONS.

VFA151=SQUADRON:New("F-14 Group", 8, "VFA-151 (Vigilantes)")
VFA151:AddMissonCapability({AUFTRAG.Type.PATROL, AUFTRAG.Type.INTERCEPT})

airwing:AddSquadron(VFA151)

This adds eight Tomcat groups beloning to VFA-151 to the airwing. This squadron has the ability to perform combat air patrols and intercepts.

Adding Payloads

Adding pure airframes is not enough. The aircraft also need weapons (and fuel) for certain missions. These must be given to the airwing from template groups defined in the Mission Editor.

-- F-14 payloads for CAP and INTERCEPT. Phoenix are first, sparrows are second choice.
airwing:NewPayload(GROUP:FindByName("F-14 Payload AIM-54C"), 2, {AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.PATROL}, 80)
airwing:NewPayload(GROUP:FindByName("F-14 Payload AIM-7M"), 20, {AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.PATROL})

This will add two AIM-54C and 20 AIM-7M payloads.

If the airwing gets an intercept or patrol mission assigned, it will first use the AIM-54s. Once these are consumed, the AIM-7s are attached to the aircraft.

When an airwing does not have a payload for a certain mission type, the mission cannot be carried out.

You can set the number of payloads to "unlimited" by setting its quantity to -1.

Adding Missions

Various mission types can be added easily via the AUFTRAG class.

Once you created an AUFTRAG you can add it to the AIRWING with the :AddMission(mission) function.

This mission will be put into the AIRWING queue. Once the mission start time is reached and all resources (airframes and pylons) are available, the mission is started. If the mission stop time is over (and the mission is not finished), it will be cancelled and removed from the queue. This applies also to mission that were not even started.

Command an Airwing

An airwing can receive missions from a WINGCOMMANDER. See docs of that class for details.

However, you are still free to add missions at anytime.

Type(s)

Fields and Methods inherited from AIRWING Description

AIRWING:AddAssetToSquadron(Squadron, Nassets)

Add asset group(s) to squadron.

AIRWING:AddMission(Mission)

Add mission to queue.

AIRWING:AddPatrolPointAWACS(Coordinate, Altitude, Speed, Heading, LegLength)

Add a patrol Point for AWACS missions.

AIRWING:AddPatrolPointCAP(Coordinate, Altitude, Speed, Heading, LegLength)

Add a patrol Point for CAP missions.

AIRWING:AddPatrolPointTANKER(Coordinate, Altitude, Speed, Heading, LegLength)

Add a patrol Point for TANKER missions.

AIRWING:AddPayloadCapability(Payload, MissionTypes, Performance)

Add a mission capability to an existing payload.

AIRWING:AddSquadron(Squadron)

Add a squadron to the air wing.

AIRWING:CalculateAssetMissionScore(asset, Mission, includePayload)

Calculate the mission score of an asset.

AIRWING:CanMission(Mission)

Check if assets for a given mission type are available.

AIRWING:CheckAWACS()

Check how many AWACS missions are assigned and add number of missing missions.

AIRWING:CheckCAP()

Check how many CAP missions are assigned and add number of missing missions.

AIRWING:CheckMissionCapability(MissionType, Capabilities)

Check if a mission type is contained in a list of possible capabilities.

AIRWING:CheckMissionType(MissionType, PossibleTypes)

Check if a mission type is contained in a list of possible types.

AIRWING:CheckRescuhelo()

Check how many Rescue helos are currently in the air.

AIRWING:CheckTANKER()

Check how many TANKER missions are assigned and add number of missing missions.

AIRWING.ClassName

Name of the class.

AIRWING:CountAssetsOnMission(MissionTypes)

Count assets on mission.

AIRWING:CountMissionsInQueue(MissionTypes)

Count missions in mission queue.

AIRWING:CountPayloadsInStock(MissionTypes, UnitTypes)

Count payloads in stock.

AIRWING.Debug

Debug mode. Messages to all about status.

AIRWING:FetchPayloadFromStock(UnitType, MissionType)

Fetch a payload from the airwing resources for a given unit and mission type.

AIRWING:GetAircraftTypes(onlyactive, squadrons)

Get the aircraft types of this airwing.

AIRWING:GetAssetCurrentMission(asset)

Get the current mission of the asset.

AIRWING:GetAssetsOnMission(MissionTypes, IncludeQueued)

Count assets on mission.

AIRWING:GetMissionByID(mid)

Returns the mission for a given mission ID (Autragsnummer).

AIRWING:GetMissionFromRequest(Request)

Returns the mission for a given request.

AIRWING:GetMissionFromRequestID(RequestID)

Returns the mission for a given request ID.

AIRWING:GetPayloadMissionTypes(Payload)

Get mission types a payload can perform.

AIRWING:GetPayloadPeformance(Payload, MissionType)

Get payload performance for a given type of misson type.

AIRWING:GetSquadron(SquadronName)

Get squadron by name.

AIRWING:GetSquadronOfAsset(Asset)

Get squadron of an asset.

AIRWING:GetTankerForFlight(flightgroup)

Check how many AWACS missions are assigned and add number of missing missions.

AIRWING:IsAssetOnMission(asset, MissionTypes)

Check if an asset is currently on a mission (STARTED or EXECUTING).

AIRWING:New(warehousename, airwingname)

Create a new AIRWING class object for a specific aircraft carrier unit.

AIRWING:NewPatrolPoint(Type, Coordinate, Altitude, Heading, LegLength, Speed)

Create a new generic patrol point.

AIRWING:NewPayload(Unit, Npayloads, MissionTypes, Performance)

Add a new payload to the airwing resources.

AIRWING:RecruitAssets(Mission)

Check if assets for a given mission type are available.

AIRWING:RemoveAssetFromSquadron(Asset)

Remove asset from squadron.

AIRWING:RemoveMission(Mission)

Remove mission from queue.

AIRWING.Report

AIRWING:ReportSquadrons()

Report squadron status.

AIRWING:ReportWarehouseStock()

Report warehouse stock.

AIRWING:ReturnPayloadFromAsset(asset)

Return payload from asset back to stock.

AIRWING:SetNumberAWACS(n)

Set number of AWACS flights constantly in the air.

AIRWING:SetNumberCAP(n)

Set number of CAP flights constantly carried out.

AIRWING:SetNumberRescuehelo(n)

Set number of Rescue helo flights constantly in the air.

AIRWING:SetNumberTANKER(Nboom, Nprobe)

Set number of TANKER flights constantly in the air.

AIRWING:Start()

Triggers the FSM event "Start".

AIRWING.UpdatePatrolPointMarker(point)

Update marker of the patrol point.

AIRWING:WarehouseReportsToggle()

Warehouse reports on/off.

AIRWING:_AddSquadonMenu(squadron)

Add sub menu for this intruder.

AIRWING:_CheckMissions()

Get next mission.

AIRWING:_CheckSquads(onlyactive)

Check

AIRWING:_CreateFlightGroup(asset)

Create a new flight group after an asset was spawned.

AIRWING:_GetNextMission()

Get next mission.

AIRWING:_GetPatrolData(PatrolPoints)

Get patrol data

AIRWING:_OptimizeAssetSelection(assets, Mission, includePayload)

Optimize chosen assets for the mission at hand.

AIRWING:_PatrolPointMarkerText(point)

AIRWING:_ReportSq(squadron)

Report squadron status.

AIRWING:_SetMenuCoalition()

Patrol carrier.

AIRWING:__Start(delay)

Triggers the FSM event "Start" after a delay.

AIRWING:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

AIRWING.lid

Class id string for output to DCS log file.

AIRWING.menu

Table of menu items.

AIRWING.missionqueue

Mission queue table.

AIRWING.nflightsAWACS

Number of AWACS flights constantly in the air.

AIRWING.nflightsCAP

Number of CAP flights constantly in the air.

AIRWING.nflightsRecoveryTanker

AIRWING.nflightsRescueHelo

Number of Rescue helo flights constantly in the air.

AIRWING.nflightsTANKERboom

Number of TANKER flights with BOOM constantly in the air.

AIRWING.nflightsTANKERprobe

Number of TANKER flights with PROBE constantly in the air.

AIRWING:onafterAssetDead(From, Event, To, asset, request)

On after "AssetDead" event triggered when an asset group died.

AIRWING:onafterAssetSpawned(From, Event, To, group, asset, request)

On after "AssetSpawned" event triggered when an asset group is spawned into the cruel world.

AIRWING:onafterDestroyed(From, Event, To)

On after "Destroyed" event.

AIRWING:onafterMissionCancel(From, Event, To, Mission)

On after "MissionCancel" event.

AIRWING:onafterMissionRequest(From, Event, To, Mission)

On after "MissionRequest" event.

AIRWING:onafterNewAsset(From, Event, To, asset, assignment)

On after "NewAsset" event.

AIRWING:onafterRequest(From, Event, To, Request)

On after "Request" event.

AIRWING:onafterSelfRequest(From, Event, To, groupset, request)

On after "SelfRequest" event.

AIRWING:onafterStart(From, Event, To)

Start AIRWING FSM.

AIRWING:onafterStatus(From, Event, To)

Update status.

AIRWING.payloadcounter

Running index of payloads.

AIRWING.payloads

Playloads for specific aircraft and mission types.

AIRWING.pointsAWACS

Table of AWACS points.

AIRWING.pointsCAP

Table of CAP points.

AIRWING.pointsTANKER

Table of Tanker points.

AIRWING.recoverytanker

The recoverytanker.

AIRWING.requestID

AIRWING.rescuehelo

The rescue helo.

AIRWING.squadrons

Table of squadrons.

AIRWING.verbose

Verbosity of output.

AIRWING.version

AIRWING class version.

AIRWING.wingcommander

The wing commander responsible for this airwing.

AIRWING.zonesetAWACS

Set of AWACS zones.

AIRWING.zonesetCAP

Set of CAP zones.

AIRWING.zonesetTANKER

Set of TANKER zones.

Fields and Methods inherited from WAREHOUSE Description

AIRWING:AddAsset(group, ngroups, forceattribute, forcecargobay, forceweight, loadradius, skill, liveries, assignment)

Trigger the FSM event "AddAsset".

AIRWING:AddOffRoadPath(remotewarehouse, group, oneway)

Add an off-road path from this warehouse to another and back.

AIRWING:AddRequest(warehouse, AssetDescriptor, AssetDescriptorValue, nAsset, TransportType, nTransport, Prio, Assignment)

Triggers the FSM event "AddRequest".

AIRWING:AddShippingLane(remotewarehouse, group, oneway)

Add a shipping lane from this warehouse to another remote warehouse.

AIRWING:AirbaseCaptured(Coalition)

Triggers the FSM event "AirbaseCaptured" when the airbase of the warehouse has been captured by another coalition.

AIRWING:AirbaseRecaptured(Coalition)

Triggers the FSM event "AirbaseRecaptured" when the airbase of the warehouse has been re-captured from the other coalition.

AIRWING:Arrived(group)

Triggers the FSM event "Arrived" when a group has arrived at the destination warehouse.

AIRWING:AssetDead(asset, request)

Triggers the FSM event "AssetDead" when an asset group has died.

AIRWING:AssetLowFuel(asset, request)

Triggers the FSM event "AssetLowFuel" when an asset runs low on fuel

AIRWING:AssetSpawned(group, asset, request)

Triggers the FSM event "AssetSpawned" when the warehouse has spawned an asset.

AIRWING:Attacked(Coalition, Country)

Triggers the FSM event "Attacked" when a warehouse is under attack by an another coalition.

AIRWING.Attribute

AIRWING:Captured(Coalition, Country)

Triggers the FSM event "Captured" when a warehouse has been captured by another coalition.

AIRWING:ChangeCountry(Country)

Triggers the FSM event "ChangeCountry" so the warehouse is respawned with the new country.

AIRWING.ClassName

Name of the class.

AIRWING.Debug

If true, send debug messages to all.

AIRWING:Defeated()

Triggers the FSM event "Defeated" when an attack from an enemy was defeated.

AIRWING:Delivered(request)

Triggers the FSM event "Delivered".

AIRWING.Descriptor

AIRWING:Destroyed()

Triggers the FSM event "Destroyed" when the warehouse was destroyed.

AIRWING:FilterStock(descriptor, attribute, nmax, mobile)

Filter stock assets by descriptor and attribute.

AIRWING:FindAssetInDB(group)

Find an asset in the the global warehouse data base.

AIRWING:FindNearestWarehouse(MinAssets, Descriptor, DescriptorValue, Coalition, RefCoordinate)

Find nearest warehouse in service, i.e.

AIRWING:FindWarehouseInDB(uid)

Find a warehouse in the global warehouse data base.

AIRWING:GetAirbase()

Get airbase associated to the warehouse.

AIRWING:GetAirbaseCategory()

Get category of airbase associated to the warehouse.

AIRWING:GetAirbaseName()

Get name airbase associated to the warehouse.

AIRWING:GetAssetByID(id)

Get a warehouse asset from its unique id.

AIRWING:GetAssetByName(GroupName)

Get a warehouse asset from its name.

AIRWING:GetAssignment(request)

Get assignment of a request.

AIRWING:GetCoalition()

Get coalition side of warehouse static.

AIRWING:GetCoalitionName()

Get coalition name of warehouse static.

AIRWING:GetCoordinate()

Get coordinate of warehouse static.

AIRWING:GetCountry()

Get country id of warehouse static.

AIRWING:GetCountryName()

Get country name of warehouse static.

AIRWING:GetNumberOfAssets(Descriptor, DescriptorValue, OnlyMobile)

Get number of assets in warehouse stock.

AIRWING:GetRequestByID(id)

Get a warehouse request from its unique id.

AIRWING:GetStockInfo(stock)

Returns the number of assets for each generalized attribute.

AIRWING:HasConnectionNaval(warehouse, markpath, smokepath)

Check if the warehouse has a shipping lane defined to another warehouse.

AIRWING:HasConnectionOffRoad(warehouse, markpath, smokepath)

Check if the warehouse has an off road path defined to another warehouse.

AIRWING:HasConnectionRail(warehouse, markpath, smokepath)

Check if the warehouse has a railroad connection to another warehouse.

AIRWING:HasConnectionRoad(warehouse, markpath, smokepath)

Check if the warehouse has a road connection to another warehouse.

AIRWING:IsAttacked()

Check if the warehouse is under attack by another coalition.

AIRWING:IsDestroyed()

Check if the warehouse has been destroyed.

AIRWING:IsLoaded()

Check if the warehouse has been loaded from disk via the "Load" event.

AIRWING:IsNotReadyYet()

Check if the warehouse has not been started yet, i.e.

AIRWING:IsPaused()

Check if the warehouse is paused.

AIRWING:IsRunning()

Check if the warehouse is running.

AIRWING:IsStopped()

Check if the warehouse is stopped.

AIRWING:Load(path, filename)

Triggers the FSM event "Load" when the warehouse is loaded from a file on disk.

AIRWING:New(warehouse, alias)

The WAREHOUSE constructor.

AIRWING:NewAsset(asset, assignment)

Triggers the FSM delayed event "NewAsset" when a new asset has been added to the warehouse stock.

AIRWING:OnAfterAirbaseCaptured(From, Event, To, Coalition)

On after "AirbaseCaptured" even user function.

AIRWING:OnAfterAirbaseRecaptured(From, Event, To, Coalition)

On after "AirbaseRecaptured" event user function.

AIRWING:OnAfterArrived(From, Event, To, group)

On after "Arrived" event user function.

AIRWING:OnAfterAssetDead(From, Event, To, asset, request)

On after "AssetDead" event user function.

AIRWING:OnAfterAssetLowFuel(From, Event, To, asset, request)

On after "AssetLowFuel" event user function.

AIRWING:OnAfterAssetSpawned(From, Event, To, group, asset, request)

On after "AssetSpawned" event user function.

AIRWING:OnAfterAttacked(From, Event, To, Coalition, Country)

On after "Attacked" event user function.

AIRWING:OnAfterCaptured(From, Event, To, Coalition, Country)

On after "Captured" event user function.

AIRWING:OnAfterChangeCountry(From, Event, To, Country)

On after "ChangeCountry" event user function.

AIRWING:OnAfterDefeate(From, Event, To)

On after "Defeated" event user function.

AIRWING:OnAfterDelivered(From, Event, To, request)

On after "Delivered" event user function.

AIRWING:OnAfterDestroyed(From, Event, To)

On after "Destroyed" event user function.

AIRWING:OnAfterLoad(From, Event, To, path, filename)

On after "Load" event user function.

AIRWING:OnAfterNewAsset(From, Event, To, asset, assignment)

On after "NewAsset" event user function.

AIRWING:OnAfterRequest(From, Event, To, Request)

On after "Request" user function.

AIRWING:OnAfterRespawn(From, Event, To)

On after "Respawn" event user function.

AIRWING:OnAfterSave(From, Event, To, path, filename)

On after "Save" event user function.

AIRWING:OnAfterSelfRequest(From, Event, To, groupset, request)

On after "SelfRequest" event.

AIRWING:OnBeforeRequest(From, Event, To, Request)

On before "Request" user function.

AIRWING:Pause()

Triggers the FSM event "Pause".

AIRWING.Quantity

AIRWING.Report

If true, send status messages to coalition.

AIRWING:Request(Request)

Triggers the FSM event "Request".

AIRWING:Respawn()

Triggers the FSM event "Respawn".

AIRWING:Restart()

Triggers the FSM event "Restart".

AIRWING:Save(path, filename)

Triggers the FSM event "Save" when the warehouse assets are saved to file on disk.

AIRWING:SelfRequest(groupset, request)

Triggers the FSM event "SelfRequest".

AIRWING:SetAirbase(airbase)

Set the airbase belonging to this warehouse.

AIRWING:SetAutoDefenceOff()

Set auto defence off.

AIRWING:SetAutoDefenceOn()

Set auto defence on.

AIRWING:SetDebugOff()

Set debug mode off.

AIRWING:SetDebugOn()

Set debug mode on.

AIRWING:SetLowFuelThreshold(threshold)

Set low fuel threshold.

AIRWING:SetMarker(switch)

Show or don't show markers on the F10 map displaying the Warehouse stock and road/rail connections.

AIRWING:SetParkingIDs(ParkingIDs)

Set valid parking spot IDs.

AIRWING:SetPortZone(zone)

Set the port zone for this warehouse.

AIRWING:SetRailConnection(coordinate)

Set the connection of the warehouse to the railroad.

AIRWING:SetReportOff()

Set report off.

AIRWING:SetReportOn()

Set report on.

AIRWING:SetRespawnAfterDestroyed(delay)

Set respawn after destroy.

AIRWING:SetRoadConnection(coordinate)

Set the connection of the warehouse to the road.

AIRWING:SetSafeParkingOff()

Disable safe parking option.

AIRWING:SetSafeParkingOn()

Enable safe parking option, i.e.

AIRWING:SetSaveOnMissionEnd(path, filename)

Enable auto save of warehouse assets at mission end event.

AIRWING:SetSpawnZone(zone, maxdist)

Set a zone where the (ground) assets of the warehouse are spawned once requested.

AIRWING:SetStatusUpdate(timeinterval)

Set interval of status updates.

AIRWING:SetWarehouseZone(zone)

Set a warehouse zone.

AIRWING:Start()

Triggers the FSM event "Start".

AIRWING:Status()

Triggers the FSM event "Status".

AIRWING:Stop()

Triggers the FSM event "Stop".

AIRWING.TransportType

AIRWING:UnPause()

Triggers the FSM event "Unpause".

AIRWING:_Arrived(group)

Task function for last waypoint.

AIRWING:_AssetItemInfo(asset)

Asset item characteristics.

AIRWING:_CheckAirbaseOwner()

Checks if the associated airbase still belongs to the warehouse.

AIRWING:_CheckAssetStatus()

Function that checks if an asset group is still okay.

AIRWING:_CheckConquered()

Checks if the warehouse zone was conquered by antoher coalition.

AIRWING:_CheckFuel()

Checks fuel on all pening assets.

AIRWING:_CheckParkingValid(spot)

Check parking ID.

AIRWING:_CheckQueue()

Sorts the queue and checks if the request can be fulfilled.

AIRWING:_CheckRequestConsistancy(queue)

Checks if the request can be fulfilled in general.

AIRWING:_CheckRequestNow(request)

Checks if the request can be fulfilled right now.

AIRWING:_CheckRequestValid(request)

Check if a request is valid in general.

AIRWING:_DebugMessage(text, duration)

Debug message.

AIRWING:_DeleteQueueItem(qitem, queue)

Delete item from queue.

AIRWING:_DeleteQueueItemByID(qitemID, queue)

Delete item from queue.

AIRWING:_DeleteStockItem(stockitem)

Delete an asset item from stock.

AIRWING:_DisplayStatus()

Display status of warehouse.

AIRWING:_DisplayStockItems(stock)

Display stock items of warehouse.

AIRWING:_ErrorMessage(text, duration)

Error message.

AIRWING:_FilterStock(stock, descriptor, attribute, nmax, mobile)

Filter stock assets by table entry.

AIRWING:_FindParkingForAssets(airbase, assets)

Seach unoccupied parking spots at the airbase for a list of assets.

AIRWING:_Fireworks(coord)

Fireworks!

AIRWING:_GetAttribute(group)

Get the generalized attribute of a group.

AIRWING:_GetFlightplan(asset, departure, destination)

Make a flight plan from a departure to a destination airport.

AIRWING:_GetIDsFromGroup(group)

Get warehouse id, asset id and request id from group name (alias).

AIRWING:_GetIDsFromGroupOLD(group)

Get warehouse id, asset id and request id from group name (alias).

AIRWING:_GetMaxHeight(D, alphaC, alphaD, Hdep, Hdest, Deltahhold)

Calculate the maximum height an aircraft can reach for the given parameters.

AIRWING:_GetNameWithOut(group)

Get group name without any spawn or cargo suffix #CARGO etc.

AIRWING:_GetObjectSize(DCSobject)

Size of the bounding box of a DCS object derived from the DCS descriptor table.

AIRWING:_GetRequestOfGroup(group, queue)

Get the request belonging to a group.

AIRWING:_GetStockAssetsText(messagetoall)

Get text about warehouse stock.

AIRWING:_GetTerminal(_attribute, _category)

Get the proper terminal type based on generalized attribute of the group.

AIRWING:_GetTransportsForAssets(Chosen, request)

Get (optimized) transport carriers for the given assets to be transported.

AIRWING:_GroupIsTransport(group, request)

Is the group a used as transporter for a given request?

AIRWING:_HasAttribute(group, attribute)

Check if a group has a generalized attribute.

AIRWING:_InfoMessage(text, duration)

Info Message.

AIRWING:_JobDone()

Function that checks if a pending job is done and can be removed from queue.

AIRWING:_NewLane(group, startcoord, finalcoord)

Create a new path from a template group.

AIRWING:_OnEventArrived(EventData)

Arrived event if an air unit/group arrived at its destination.

AIRWING:_OnEventBaseCaptured(EventData)

Warehouse event handling function.

AIRWING:_OnEventBirth(EventData)

Warehouse event function, handling the birth of a unit.

AIRWING:_OnEventCrashOrDead(EventData)

Warehouse event handling function.

AIRWING:_OnEventEngineShutdown(EventData)

Function handling the event when a (warehouse) unit shuts down its engines.

AIRWING:_OnEventEngineStartup(EventData)

Function handling the event when a (warehouse) unit starts its engines.

AIRWING:_OnEventLanding(EventData)

Function handling the event when a (warehouse) unit lands.

AIRWING:_OnEventMissionEnd(EventData)

Warehouse event handling function.

AIRWING:_OnEventTakeOff(EventData)

Function handling the event when a (warehouse) unit takes off.

AIRWING:_PassingWaypoint(group, n, N)

Task function for when passing a waypoint.

AIRWING:_PrintQueue(queue, name)

Prints the queue to DCS.log file.

AIRWING:_QuantityRel2Abs(relative, ntot)

Relative to absolute quantity.

AIRWING:_RegisterAsset(group, ngroups, forceattribute, forcecargobay, forceweight, loadradius, liveries, skill, assignment)

Register new asset in globase warehouse data base.

AIRWING:_RouteAir(aircraft)

Route the airplane from one airbase another.

AIRWING:_RouteGround(group, request)

Route ground units to destination.

AIRWING:_RouteNaval(group, request)

Route naval units along user defined shipping lanes to destination warehouse.

AIRWING:_RouteTrain(Group, Coordinate, Speed)

Route trains to their destination - or at least to the closest point on rail of the desired final destination.

AIRWING:_SimpleTaskFunction(Function, group)

Simple task function.

AIRWING:_SimpleTaskFunctionWP(Function, group, n, N)

Simple task function.

AIRWING:_SortQueue()

Sort requests queue wrt prio and request uid.

AIRWING:_SpawnAssetAircraft(alias, asset, request, parking, uncontrolled, hotstart)

Spawn an aircraft asset (plane or helo) at the airbase associated with the warehouse.

AIRWING:_SpawnAssetGroundNaval(alias, asset, request, spawnzone, aioff)

Spawn a ground or naval asset in the corresponding spawn zone of the warehouse.

AIRWING:_SpawnAssetPrepareTemplate(asset, alias)

Prepare a spawn template for the asset.

AIRWING:_SpawnAssetRequest(Request)

Spawns requested assets at warehouse or associated airbase.

AIRWING:_UnitDead(deadunit, request)

A unit of a group just died.

AIRWING:_UpdateWarehouseMarkText()

Create or update mark text at warehouse, which is displayed in F10 map showing how many assets of each type are in stock.

AIRWING:__AddAsset(delay, group, ngroups, forceattribute, forcecargobay, forceweight, loadradius, skill, liveries, assignment)

Trigger the FSM event "AddAsset" with a delay.

AIRWING:__AddRequest(delay, warehouse, AssetDescriptor, AssetDescriptorValue, nAsset, TransportType, nTransport, Prio, Assignment)

Triggers the FSM event "AddRequest" with a delay.

AIRWING:__AirbaseCaptured(delay, Coalition)

Triggers the FSM event "AirbaseCaptured" with a delay when the airbase of the warehouse has been captured by another coalition.

AIRWING:__AirbaseRecaptured(delay, Coalition)

Triggers the FSM event "AirbaseRecaptured" with a delay when the airbase of the warehouse has been re-captured from the other coalition.

AIRWING:__Arrived(delay, group)

Triggers the FSM event "Arrived" after a delay when a group has arrived at the destination.

AIRWING:__AssetDead(delay, asset, request)

Triggers the delayed FSM event "AssetDead" when an asset group has died.

AIRWING:__AssetLowFuel(delay, asset, request)

Triggers the FSM event "AssetLowFuel" with a delay when an asset runs low on fuel.

AIRWING:__AssetSpawned(delay, group, asset, request)

Triggers the FSM event "AssetSpawned" with a delay when the warehouse has spawned an asset.

AIRWING:__Attacked(delay, Coalition, Country)

Triggers the FSM event "Attacked" with a delay when a warehouse is under attack by an another coalition.

AIRWING:__Captured(delay, Coalition, Country)

Triggers the FSM event "Captured" with a delay when a warehouse has been captured by another coalition.

AIRWING:__ChangeCountry(delay, Country)

Triggers the FSM event "ChangeCountry" after a delay so the warehouse is respawned with the new country.

AIRWING:__Defeated(delay)

Triggers the FSM event "Defeated" with a delay when an attack from an enemy was defeated.

AIRWING:__Delivered(delay, request)

Triggers the FSM event "Delivered" after a delay.

AIRWING:__Destroyed(delay)

Triggers the FSM event "Destroyed" with a delay when the warehouse was destroyed.

AIRWING:__Load(delay, path, filename)

Triggers the FSM event "Load" with a delay when the warehouse assets are loaded from disk.

AIRWING:__NewAsset(delay, asset, assignment)

Triggers the FSM delayed event "NewAsset" when a new asset has been added to the warehouse stock.

AIRWING:__Pause(delay)

Triggers the FSM event "Pause" after a delay.

AIRWING:__Request(Delay, Request)

Triggers the FSM event "Request" after a delay.

AIRWING:__Respawn(delay)

Triggers the FSM event "Respawn" after a delay.

AIRWING:__Restart(delay)

Triggers the FSM event "Restart" after a delay.

AIRWING:__Save(delay, path, filename)

Triggers the FSM event "Save" with a delay when the warehouse assets are saved to a file.

AIRWING:__SelfRequest(delay, groupset, request)

Triggers the FSM event "SelfRequest" with a delay.

AIRWING:__Start(delay)

Triggers the FSM event "Start" after a delay.

AIRWING:__Status(delay)

Triggers the FSM event "Status" after a delay.

AIRWING:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

AIRWING:__Unpause(delay)

Triggers the FSM event "Unpause" after a delay.

AIRWING.airbase

Airbase the warehouse belongs to.

AIRWING.airbasename

Name of the airbase associated to the warehouse.

AIRWING.alias

Alias of the warehouse. Name its called when sending messages.

AIRWING.autodefence

When the warehouse is under attack, automatically spawn assets to defend the warehouse.

AIRWING.autosave

Automatically save assets to file when mission ends.

AIRWING.autosavefile

File name of the auto asset save file. Default is auto generated from warehouse id and name.

AIRWING.autosavepath

Path where the asset file is saved on auto save.

AIRWING.coalition

AIRWING.countryid

AIRWING.dTstatus

Time interval in seconds of updating the warehouse status and processing new events. Default 30 seconds.

AIRWING.defending

Table holding all defending requests, i.e. self requests that were if the warehouse is under attack. Table elements are of type WAREHOUSE.Pendingitem.

AIRWING.delivered

Table holding all delivered requests. Table elements are #boolean. If true, all cargo has been delivered.

AIRWING.isunit

If true, warehouse is represented by a unit instead of a static.

AIRWING.lid

AIRWING.lowfuelthresh

Low fuel threshold. Triggers the event AssetLowFuel if for any unit fuel goes below this number.

AIRWING.markerOn

If true, markers are displayed on the F10 map.

AIRWING.markerid

ID of the warehouse marker at the airbase.

AIRWING.markrail

AIRWING.markroad

AIRWING.offroadpaths

Table holding user defined paths from one warehouse to another.

AIRWING:onafterAddAsset(From, Event, To, group, ngroups, forceattribute, forcecargobay, forceweight, loadradius, skill, liveries, assignment, other)

On after "AddAsset" event.

AIRWING:onafterAddRequest(From, Event, To, warehouse, AssetDescriptor, AssetDescriptorValue, nAsset, TransportType, nTransport, Prio, Assignment)

On after "AddRequest" event.

AIRWING:onafterAirbaseCaptured(From, Event, To, Coalition)

On after "AirbaseCaptured" event.

AIRWING:onafterAirbaseRecaptured(From, Event, To, Coalition)

On after "AirbaseRecaptured" event.

AIRWING:onafterArrived(From, Event, To, group)

On after "Arrived" event.

AIRWING:onafterAssetDead(From, Event, To, asset, request)

On after "AssetDead" event triggered when an asset group died.

AIRWING:onafterAssetSpawned(From, Event, To, group, asset, request)

On after "AssetSpawned" event triggered when an asset group is spawned into the cruel world.

AIRWING:onafterAttacked(From, Event, To, Coalition, Country)

On after "Attacked" event.

AIRWING:onafterCaptured(From, Event, To, Coalition, Country)

On after "Captured" event.

AIRWING:onafterChangeCountry(From, Event, To, Country)

On after "ChangeCountry" event.

AIRWING:onafterDefeated(From, Event, To)

On after "Defeated" event.

AIRWING:onafterDelivered(From, Event, To, request)

On after "Delivered" event.

AIRWING:onafterDestroyed(From, Event, To)

On after "Destroyed" event.

AIRWING:onafterLoad(From, Event, To, path, filename)

On after "Load" event.

AIRWING:onafterNewAsset(From, Event, To, asset, assignment)

On after "NewAsset" event.

AIRWING:onafterPause(From, Event, To)

On after "Pause" event.

AIRWING:onafterRequest(From, Event, To, Request)

On after "Request" event.

AIRWING:onafterRequestSpawned(From, Event, To, Request, CargoGroupSet, TransportGroupSet)

On after "RequestSpawned" event.

AIRWING:onafterRespawn(From, Event, To)

Respawn warehouse.

AIRWING:onafterRestart(From, Event, To)

On after "Restart" event.

AIRWING:onafterSave(From, Event, To, path, filename)

On after "Save" event.

AIRWING:onafterSelfRequest(From, Event, To, groupset, request)

On after "SelfRequest" event.

AIRWING:onafterStart(From, Event, To)

On after Start event.

AIRWING:onafterStatus(From, Event, To)

On after Status event.

AIRWING:onafterStop(From, Event, To)

On after "Stop" event.

AIRWING:onafterUnloaded(From, Event, To, group)

On after "Unloaded" event.

AIRWING:onafterUnpause(From, Event, To)

On after "Unpause" event.

AIRWING:onbeforeAddRequest(From, Event, To, warehouse, AssetDescriptor, AssetDescriptorValue, nAsset, TransportType, nTransport, Prio, Assignment)

On before "AddRequest" event.

AIRWING:onbeforeArrived(From, Event, To, group)

On before "Arrived" event.

AIRWING:onbeforeAssetSpawned(From, Event, To, group, asset, request)

On before "AssetSpawned" event.

AIRWING:onbeforeCaptured(From, Event, To, Coalition, Country)

On before "Captured" event.

AIRWING:onbeforeChangeCountry(From, Event, To, Country)

On before "ChangeCountry" event.

AIRWING:onbeforeLoad(From, Event, To, path, filename)

On before "Load" event.

AIRWING:onbeforeRequest(From, Event, To, Request)

On before "Request" event.

AIRWING.parkingIDs

AIRWING.pending

Table holding all pending requests, i.e. those that are currently in progress. Table elements are of type WAREHOUSE.Pendingitem.

AIRWING.portzone

Zone defining the port of a warehouse. This is where naval assets are spawned.

AIRWING.queue

Table holding all queued requests. Table entries are of type WAREHOUSE.Queueitem.

AIRWING.queueid

Unit id of each request in the queue. Essentially a running number starting at one and incremented when a new request is added.

AIRWING.rail

Closest point to warehouse on rail.

AIRWING.respawnafterdestroyed

If true, warehouse is respawned after it was destroyed. Assets are kept.

AIRWING.respawndelay

Delay before respawn in seconds.

AIRWING.road

Closest point to warehouse on road.

AIRWING.safeparking

If true, parking spots for aircraft are considered as occupied if e.g. a client aircraft is parked there. Default false.

AIRWING.shippinglanes

Table holding the user defined shipping between warehouses.

AIRWING.spawnzone

Zone in which assets are spawned.

AIRWING.spawnzonemaxdist

Max distance between warehouse and spawn zone. Default 5000 meters.

AIRWING.stock

Table holding all assets in stock. Table entries are of type WAREHOUSE.Assetitem.

AIRWING.transporting

Table holding assets currently transporting cargo assets.

AIRWING.uid

Unique ID of the warehouse.

AIRWING.version

Warehouse class version.

AIRWING.warehouse

The phyical warehouse structure.

AIRWING.wid

Identifier of the warehouse printed before other output to DCS.log file.

AIRWING.zone

Zone around the warehouse. If this zone is captured, the warehouse and all its assets goes to the capturing coaliton.

Fields and Methods inherited from FSM Description

AIRWING:AddEndState(State)

Adds an End state.

AIRWING:AddProcess(From, Event, Process, ReturnEvents)

Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

AIRWING:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

AIRWING:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

AIRWING:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

AIRWING.CallScheduler

AIRWING.Events

AIRWING:GetCurrentState()

AIRWING:GetEndStates()

Returns the End states.

AIRWING:GetProcess(From, Event)

AIRWING:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

AIRWING:GetScores()

Returns a table with the scores defined.

AIRWING:GetStartState()

Returns the start state of the FSM.

AIRWING:GetState()

AIRWING:GetSubs()

Returns a table with the Subs defined.

AIRWING:GetTransitions()

Returns a table of the transition rules defined within the FSM.

AIRWING:Is(State)

AIRWING:LoadCallBacks(CallBackTable)

AIRWING:New()

Creates a new FSM object.

AIRWING.Scores

AIRWING:SetProcess(From, Event, Fsm)

AIRWING:SetStartState(State)

Sets the start state of the FSM.

AIRWING._EndStates

AIRWING._EventSchedules

AIRWING._Processes

AIRWING._Scores

AIRWING._StartState

AIRWING._Transitions

AIRWING:_add_to_map(Map, Event)

AIRWING:_call_handler(step, trigger, params, EventName)

AIRWING:_create_transition(EventName)

AIRWING:_delayed_transition(EventName)

AIRWING:_eventmap(Events, EventStructure)

AIRWING:_gosub(ParentFrom, ParentEvent)

AIRWING:_handler(EventName, ...)

AIRWING:_isendstate(Current)

AIRWING:_submap(subs, sub, name)

AIRWING:can(e)

AIRWING:cannot(e)

AIRWING.current

AIRWING.endstates

AIRWING:is(state)

AIRWING.options

AIRWING.subs

Fields and Methods inherited from BASE Description

AIRWING.ClassID

The ID number of the class.

AIRWING.ClassName

The name of the class.

AIRWING.ClassNameAndID

The name of the class concatenated with the ID number of the class.

AIRWING:ClearState(Object, StateName)

Clear the state of an object.

AIRWING:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace)

Creation of a Birth Event.

AIRWING:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

AIRWING:CreateEventDead(EventTime, Initiator)

Creation of a Dead Event.

AIRWING:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

AIRWING:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

AIRWING:E(Arguments)

Log an exception which will be traced always.

AIRWING:EventDispatcher()

Returns the event dispatcher

AIRWING:EventRemoveAll()

Remove all subscribed events

AIRWING:F(Arguments)

Trace a function call.

AIRWING:F2(Arguments)

Trace a function call level 2.

AIRWING:F3(Arguments)

Trace a function call level 3.

AIRWING:GetClassID()

Get the ClassID of the class instance.

AIRWING:GetClassName()

Get the ClassName of the class instance.

AIRWING:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

AIRWING:GetEventPriority()

Get the Class Event processing Priority.

AIRWING:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

AIRWING:GetState(Object, Key)

Get a Value given a Key from the Object.

AIRWING:HandleEvent(Event, EventFunction)

Subscribe to a DCS Event.

AIRWING:I(Arguments)

Log an information which will be traced always.

AIRWING:Inherit(Child, Parent)

This is the worker method to inherit from a parent class.

AIRWING:IsInstanceOf(ClassName)

This is the worker method to check if an object is an (sub)instance of a class.

AIRWING:IsTrace()

Enquires if tracing is on (for the class).

AIRWING:New()

BASE constructor.

AIRWING:OnEvent(EventData)

Occurs when an object is completely destroyed.

AIRWING:OnEventBaseCaptured(EventData)

Occurs when a ground unit captures either an airbase or a farp.

AIRWING:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

AIRWING:OnEventCrash(EventData)

Occurs when any aircraft crashes into the ground and is completely destroyed.

AIRWING:OnEventDead(EventData)

Occurs when an object is dead.

AIRWING:OnEventDetailedFailure(EventData)

Unknown precisely what creates this event, likely tied into newer damage model.

AIRWING:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

AIRWING:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

AIRWING:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

AIRWING:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

AIRWING:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

AIRWING:OnEventKill(EventData)

Occurs on the death of a unit.

AIRWING:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

AIRWING:OnEventLandingAfterEjection(EventData)

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

AIRWING:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

AIRWING:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

AIRWING:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

AIRWING:OnEventMissionEnd(EventData)

Occurs when a mission ends

AIRWING:OnEventMissionStart(EventData)

Occurs when a mission starts

AIRWING:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

AIRWING:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

AIRWING:OnEventPlayerLeaveUnit(EventData)

Occurs when any player relieves control of a unit to the AI.

AIRWING:OnEventRefueling(EventData)

Occurs when an aircraft connects with a tanker and begins taking on fuel.

AIRWING:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

AIRWING:OnEventScore(EventData)

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

AIRWING:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

AIRWING:OnEventShootingStart(EventData)

Occurs when any unit begins firing a weapon that has a high rate of fire.

AIRWING:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

AIRWING:OnEventTakeoff(EventData)

Occurs when an aircraft takes off from an airbase, farp, or ship.

AIRWING:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

AIRWING:ScheduleOnce(Start, SchedulerFunction, ...)

Schedule a new time event.

AIRWING:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...)

Schedule a new time event.

AIRWING:ScheduleStop(SchedulerFunction)

Stops the Schedule.

AIRWING.Scheduler

AIRWING:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

AIRWING:SetState(Object, Key, Value)

Set a state or property of the Object given a Key and a Value.

AIRWING:T(Arguments)

Trace a function logic level 1.

AIRWING:T2(Arguments)

Trace a function logic level 2.

AIRWING:T3(Arguments)

Trace a function logic level 3.

AIRWING:TraceAll(TraceAll)

Trace all methods in MOOSE

AIRWING:TraceClass(Class)

Set tracing for a class

AIRWING:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

AIRWING:TraceLevel(Level)

Set trace level

AIRWING:TraceOff()

Set trace off.

AIRWING:TraceOn()

Set trace on.

AIRWING:TraceOnOff(TraceOnOff)

Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.

AIRWING:UnHandleEvent(Event)

UnSubscribe to a DCS event.

AIRWING._

AIRWING:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

AIRWING:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

AIRWING.__

AIRWING:onEvent(event)

Fields and Methods inherited from AIRWING.PatrolData Description

AIRWING.PatrolData.altitude

Altitude in feet.

AIRWING.PatrolData.coord

Patrol coordinate.

AIRWING.PatrolData.heading

Heading in degrees.

AIRWING.PatrolData.leg

Leg length in NM.

AIRWING.PatrolData.marker

F10 marker.

AIRWING.PatrolData.noccupied

Number of flights on this patrol point.

AIRWING.PatrolData.speed

Speed in knots.

AIRWING.PatrolData.type

Type name.

Fields and Methods inherited from AIRWING.Payload Description

AIRWING.Payload.aircrafttype

Type of aircraft, which can use this payload.

AIRWING.Payload.capabilities

Mission types and performances for which this payload can be used.

AIRWING.Payload.navail

Number of available payloads of this type.

AIRWING.Payload.pylons

Pylon data extracted for the unit template.

AIRWING.Payload.unitname

Name of the unit this pylon was extracted from.

AIRWING.Payload.unlimited

If true, this payload is unlimited and does not get consumed.

Fields and Methods inherited from AIRWING.SquadronAsset Description

AIRWING.SquadronAsset.dist

AIRWING.SquadronAsset.flightgroup

The flightgroup object.

AIRWING.SquadronAsset.missionTask

AIRWING.SquadronAsset.payload

The payload of the asset.

AIRWING.SquadronAsset.requested

AIRWING.SquadronAsset.score

AIRWING.SquadronAsset.squadname

Name of the squadron this asset belongs to.

Fields and Methods inherited from WAREHOUSE.Assetitem Description

AIRWING.SquadronAsset.DCSdesc

All DCS descriptors.

AIRWING.SquadronAsset.arrived

If true, asset arrived at its destination.

AIRWING.SquadronAsset.assignment

Assignment of the asset. This could, e.g., be used in the @{#WAREHOUSE.OnAfterNewAsset) function.

AIRWING.SquadronAsset.attribute

Generalized attribute of the group.

AIRWING.SquadronAsset.cargobay

Array of cargo bays of all units in an asset group.

AIRWING.SquadronAsset.cargobaymax

Largest cargo bay of all units in the group.

AIRWING.SquadronAsset.cargobaytot

Total weight in kg that fits in the cargo bay of all asset group units.

AIRWING.SquadronAsset.category

Category of the group.

AIRWING.SquadronAsset.iscargo

If true, asset is cargo. If false asset is transport. Nil if in stock.

AIRWING.SquadronAsset.livery

Livery of the asset.

AIRWING.SquadronAsset.loadradius

Distance when cargo is loaded into the carrier.

AIRWING.SquadronAsset.nunits

Number of units in the group.

AIRWING.SquadronAsset.range

Range of the unit in meters.

AIRWING.SquadronAsset.rid

The request ID of this asset.

AIRWING.SquadronAsset.size

Maximum size in length and with of the asset in meters.

AIRWING.SquadronAsset.skill

Skill of AI unit.

AIRWING.SquadronAsset.spawned

If true, asset was spawned into the cruel world. If false, it is still in stock.

AIRWING.SquadronAsset.spawngroupname

Name of the spawned group.

AIRWING.SquadronAsset.speedmax

Maximum speed in km/h the group can do.

AIRWING.SquadronAsset.task

AIRWING.SquadronAsset.template

The spawn template of the group.

AIRWING.SquadronAsset.templatename

Name of the template group.

AIRWING.SquadronAsset.uid

Unique id of the asset.

AIRWING.SquadronAsset.unittype

Type of the first unit of the group as obtained by the Object.getTypeName() DCS API function.

AIRWING.SquadronAsset.weight

The weight of the whole asset group in kilo gramms.

AIRWING class.

Field(s)

#string AIRWING.ClassName

Name of the class.

#boolean AIRWING.Debug

Debug mode. Messages to all about status.

#string AIRWING.lid

Class id string for output to DCS log file.

#table AIRWING.menu

Table of menu items.

#table AIRWING.missionqueue

Mission queue table.

#number AIRWING.nflightsAWACS

Number of AWACS flights constantly in the air.

#number AIRWING.nflightsCAP

Number of CAP flights constantly in the air.

#number AIRWING.nflightsRescueHelo

Number of Rescue helo flights constantly in the air.

#number AIRWING.nflightsTANKERboom

Number of TANKER flights with BOOM constantly in the air.

#number AIRWING.nflightsTANKERprobe

Number of TANKER flights with PROBE constantly in the air.

#number AIRWING.payloadcounter

Running index of payloads.

#table AIRWING.payloads

Playloads for specific aircraft and mission types.

#table AIRWING.pointsAWACS

Table of AWACS points.

#table AIRWING.pointsCAP

Table of CAP points.

#table AIRWING.pointsTANKER

Table of Tanker points.

AIRWING.requestID

The queueid has been increased in the onafterAddRequest function. So we can simply use it here.

#table AIRWING.squadrons

Table of squadrons.

#number AIRWING.verbose

Verbosity of output.

#string AIRWING.version

AIRWING class version.

Ops.WingCommander#WINGCOMMANDER AIRWING.wingcommander

The wing commander responsible for this airwing.

Function(s)

Add asset group(s) to squadron.

Defined in:

AIRWING

Parameters:

The squadron object.

#number Nassets

Number of asset groups to add.

Return value:

self

Add mission to queue.

Defined in:

AIRWING

Parameter:

for this group.

Return value:

self

Add a patrol Point for AWACS missions.

Defined in:

AIRWING

Parameters:

Coordinate of the patrol point.

#number Altitude

Orbit altitude in feet.

#number Speed

Orbit speed in knots.

#number Heading

Heading in degrees.

#number LegLength

Length of race-track orbit in NM.

Return value:

self

Add a patrol Point for CAP missions.

Defined in:

AIRWING

Parameters:

Coordinate of the patrol point.

#number Altitude

Orbit altitude in feet.

#number Speed

Orbit speed in knots.

#number Heading

Heading in degrees.

#number LegLength

Length of race-track orbit in NM.

Return value:

self

Add a patrol Point for TANKER missions.

Defined in:

AIRWING

Parameters:

Coordinate of the patrol point.

#number Altitude

Orbit altitude in feet.

#number Speed

Orbit speed in knots.

#number Heading

Heading in degrees.

#number LegLength

Length of race-track orbit in NM.

Return value:

self

Add a mission capability to an existing payload.

Defined in:

AIRWING

Parameters:

The payload table to which the capability should be added.

#table MissionTypes

Mission types to be added.

#number Performance

A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50.

Return value:

self

Add a squadron to the air wing.

Defined in:

AIRWING

Parameter:

The squadron object.

Return value:

self

Calculate the mission score of an asset.

Defined in:

AIRWING

Parameters:

Mission for which the best assets are desired.

#boolean includePayload

If true, include the payload in the calulation if the asset has one attached.

Return value:

#number:

Mission score.

Check if assets for a given mission type are available.

Defined in:

AIRWING

Parameter:

The mission.

Return values:

#boolean:

If true, enough assets are available.

#table:

Assets that can do the required mission.

Check how many AWACS missions are assigned and add number of missing missions.

Defined in:

AIRWING

Return value:

self

Check how many CAP missions are assigned and add number of missing missions.

Defined in:

AIRWING

Return value:

self

Check if a mission type is contained in a list of possible capabilities.

Defined in:

AIRWING

Parameters:

#string MissionType

The requested mission type.

#table Capabilities

A table with possible capabilities.

Return value:

#boolean:

If true, the requested mission type is part of the possible mission types.

Check if a mission type is contained in a list of possible types.

Defined in:

AIRWING

Parameters:

#string MissionType

The requested mission type.

#table PossibleTypes

A table with possible mission types.

Return value:

#boolean:

If true, the requested mission type is part of the possible mission types.

Check how many Rescue helos are currently in the air.

Defined in:

AIRWING

Return value:

self

Check how many TANKER missions are assigned and add number of missing missions.

Defined in:

AIRWING

Return value:

self

Count assets on mission.

Defined in:

AIRWING

Parameter:

#table MissionTypes

Types on mission to be checked. Default all.

Return values:

#number:

Number of pending and queued assets.

#number:

Number of pending assets.

#number:

Number of queued assets.

Count missions in mission queue.

Defined in:

AIRWING

Parameter:

#table MissionTypes

Types on mission to be checked. Default all possible types AUFTRAG.Type.

Return value:

#number:

Number of missions that are not over yet.

Count payloads in stock.

Defined in:

AIRWING

Parameters:

#table MissionTypes

Types on mission to be checked. Default all possible types AUFTRAG.Type.

#table UnitTypes

Types of units.

Return value:

#number:

Count of available payloads in stock.

Fetch a payload from the airwing resources for a given unit and mission type.

The payload with the highest priority is preferred.

Defined in:

AIRWING

Parameters:

#string UnitType

The type of the unit.

#string MissionType

The mission type.

Return value:

Payload table or nil.

Get the aircraft types of this airwing.

Defined in:

AIRWING

Parameters:

#boolean onlyactive

Count only the active ones.

#table squadrons

Table of squadrons. Default all.

Return value:

#table:

Table of unit types.

Get the current mission of the asset.

Defined in:

AIRWING

Parameter:

The asset.

Return value:

Current mission or nil.

Count assets on mission.

Defined in:

AIRWING

Parameters:

#table MissionTypes

Types on mission to be checked. Default all.

IncludeQueued

Return value:

#table:

Assets on pending requests.

Returns the mission for a given mission ID (Autragsnummer).

Defined in:

AIRWING

Parameter:

#number mid

Mission ID (Auftragsnummer).

Return value:

Mission table.

Returns the mission for a given request.

Defined in:

AIRWING

Parameter:

The warehouse request.

Return value:

Mission table or nil.

Returns the mission for a given request ID.

Defined in:

AIRWING

Parameter:

#number RequestID

Unique ID of the request.

Return value:

Mission table or nil.

Get mission types a payload can perform.

Defined in:

AIRWING

Parameter:

The payload table.

Return value:

#table:

Mission types.

Get payload performance for a given type of misson type.

Defined in:

AIRWING

Parameters:

The payload table.

#string MissionType

Type of mission.

Return value:

#number:

Performance or -1.

Get squadron by name.

Defined in:

AIRWING

Parameter:

#string SquadronName

Name of the squadron, e.g. "VFA-37".

Return value:

The squadron object.

Get squadron of an asset.

Defined in:

AIRWING

Parameter:

The squadron asset.

Return value:

The squadron object.

Check how many AWACS missions are assigned and add number of missing missions.

Defined in:

AIRWING

Parameter:

The flightgroup.

Return value:

The tanker asset.

Check if an asset is currently on a mission (STARTED or EXECUTING).

Defined in:

AIRWING

Parameters:

The asset.

#table MissionTypes

Types on mission to be checked. Default all.

Return value:

#boolean:

If true, asset has at least one mission of that type in the queue.

Create a new AIRWING class object for a specific aircraft carrier unit.

Defined in:

AIRWING

Parameters:

#string warehousename

Name of the warehouse static or unit object representing the warehouse.

#string airwingname

Name of the air wing, e.g. "AIRWING-8".

Return value:

self

Create a new generic patrol point.

Defined in:

AIRWING

Parameters:

#string Type

Patrol point type, e.g. "CAP" or "AWACS". Default "Unknown".

Coordinate of the patrol point. Default 10-15 NM away from the location of the airwing.

#number Altitude

Orbit altitude in feet. Default random between Angels 10 and 20.

#number Heading

Heading in degrees. Default random (0, 360] degrees.

#number LegLength

Length of race-track orbit in NM. Default 15 NM.

#number Speed

Orbit speed in knots. Default 350 knots.

Return value:

Patrol point table.

Add a new payload to the airwing resources.

Defined in:

AIRWING

Parameters:

The unit, the payload is extracted from. Can also be given as #string name of the unit.

#number Npayloads

Number of payloads to add to the airwing resources. Default 99 (which should be enough for most scenarios). Set to -1 for unlimited.

#table MissionTypes

Mission types this payload can be used for.

#number Performance

A number between 0 (worst) and 100 (best) to describe the performance of the loadout for the given mission types. Default is 50.

Return value:

The payload table or nil if the unit does not exist.

Check if assets for a given mission type are available.

Defined in:

AIRWING

Parameter:

The mission.

Return value:

#table:

Assets that can do the required mission.

Remove asset from squadron.

Defined in:

AIRWING

Parameter:

Remove mission from queue.

Defined in:

AIRWING

Parameter:

Mission to be removed.

Return value:

self

Report squadron status.

Defined in:

AIRWING

Report warehouse stock.

Defined in:

AIRWING

Return payload from asset back to stock.

Defined in:

AIRWING

Parameter:

The squadron asset.

Set number of AWACS flights constantly in the air.

Defined in:

AIRWING

Parameter:

#number n

Number of flights. Default 1.

Return value:

self

Set number of CAP flights constantly carried out.

Defined in:

AIRWING

Parameter:

#number n

Number of flights. Default 1.

Return value:

self

Set number of Rescue helo flights constantly in the air.

Defined in:

AIRWING

Parameter:

#number n

Number of flights. Default 1.

Return value:

self

Set number of TANKER flights constantly in the air.

Defined in:

AIRWING

Parameters:

#number Nboom

Number of flights. Default 1.

#number Nprobe

Number of flights. Default 1.

Return value:

self

Triggers the FSM event "Start".

Starts the AIRWING. Initializes parameters and starts event handlers.

Defined in:

AIRWING

Update marker of the patrol point.

Defined in:

AIRWING

Parameter:

Patrol point table.

Warehouse reports on/off.

Defined in:

AIRWING

Add sub menu for this intruder.

Defined in:

AIRWING

Parameter:

The squadron data.

Get next mission.

Defined in:

AIRWING

Check

Defined in:

AIRWING

Parameter:

#boolean onlyactive

Count only the active ones.

Return value:

#table:

Table of unit types.

Create a new flight group after an asset was spawned.

Defined in:

AIRWING

Parameter:

The asset.

Return value:

The created flightgroup object.

Get next mission.

Defined in:

AIRWING

Return value:

Next mission or nil.

Get patrol data

Defined in:

AIRWING

Parameter:

#table PatrolPoints

Patrol data points.

Return value:

Optimize chosen assets for the mission at hand.

Defined in:

AIRWING

Parameters:

#table assets

Table of (unoptimized) assets.

Mission for which the best assets are desired.

#boolean includePayload

If true, include the payload in the calulation if the asset has one attached.

Defined in:

AIRWING

Parameter:

Patrol point table.

Return value:

#string:

Marker text.

Report squadron status.

Defined in:

AIRWING

Parameter:

The squadron object.

Patrol carrier.

Defined in:

AIRWING

Return value:

self

Triggers the FSM event "Start" after a delay.

Starts the AIRWING. Initializes parameters and starts event handlers.

Defined in:

AIRWING

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Stop" after a delay.

Stops the AIRWING and all its event handlers.

Defined in:

AIRWING

Parameter:

#number delay

Delay in seconds.

On after "AssetDead" event triggered when an asset group died.

Defined in:

AIRWING

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The asset that is dead.

The request of the dead asset.

On after "AssetSpawned" event triggered when an asset group is spawned into the cruel world.

Creates a new flightgroup element and adds the mission to the flightgroup queue.

Defined in:

AIRWING

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The group spawned.

The asset that was spawned.

The request of the dead asset.

On after "Destroyed" event.

Remove assets from squadrons. Stop squadrons. Remove airwing from wingcommander.

Defined in:

AIRWING

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "MissionCancel" event.

Cancels the missions of all flightgroups. Deletes request from warehouse queue.

Defined in:

AIRWING

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The mission to be cancelled.

On after "MissionRequest" event.

Performs a self request to the warehouse for the mission assets. Sets mission status to REQUESTED.

Defined in:

AIRWING

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The requested mission.

On after "NewAsset" event.

Asset is added to the given squadron (asset assignment).

Defined in:

AIRWING

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The asset that has just been added.

#string assignment

The (optional) assignment for the asset.

On after "Request" event.

Defined in:

AIRWING

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Information table of the request.

On after "SelfRequest" event.

Defined in:

AIRWING

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The set of asset groups that was delivered to the warehouse itself.

Pending self request.

Start AIRWING FSM.

Defined in:

AIRWING

Parameters:

From

Event

To

Update status.

Defined in:

AIRWING

Parameters:

From

Event

To

Field(s)

#string AIRWING.ClassName

Name of the class.

#boolean AIRWING.Debug

Debug mode. Messages to all about status.

#string AIRWING.lid

Class id string for output to DCS log file.

#table AIRWING.menu

Table of menu items.

#table AIRWING.missionqueue

Mission queue table.

#number AIRWING.nflightsAWACS

Number of AWACS flights constantly in the air.

#number AIRWING.nflightsCAP

Number of CAP flights constantly in the air.

#number AIRWING.nflightsRescueHelo

Number of Rescue helo flights constantly in the air.

#number AIRWING.nflightsTANKERboom

Number of TANKER flights with BOOM constantly in the air.

#number AIRWING.nflightsTANKERprobe

Number of TANKER flights with PROBE constantly in the air.

#number AIRWING.payloadcounter

Running index of payloads.

#table AIRWING.payloads

Playloads for specific aircraft and mission types.

#table AIRWING.pointsAWACS

Table of AWACS points.

#table AIRWING.pointsCAP

Table of CAP points.

#table AIRWING.pointsTANKER

Table of Tanker points.

AIRWING.requestID

The queueid has been increased in the onafterAddRequest function. So we can simply use it here.

#table AIRWING.squadrons

Table of squadrons.

#number AIRWING.verbose

Verbosity of output.

#string AIRWING.version

AIRWING class version.

Ops.WingCommander#WINGCOMMANDER AIRWING.wingcommander

The wing commander responsible for this airwing.

Function(s)

Trigger the FSM event "AddAsset".

Add a group to the warehouse stock.

Defined in:

Parameters:

Group to be added as new asset.

#number ngroups

(Optional) Number of groups to add to the warehouse stock. Default is 1.

#WAREHOUSE.Attribute forceattribute

(Optional) Explicitly force a generalized attribute for the asset. This has to be an WAREHOUSE.Attribute.

#number forcecargobay

(Optional) Explicitly force cargobay weight limit in kg for cargo carriers. This is for each unit of the group.

#number forceweight

(Optional) Explicitly force weight in kg of each unit in the group.

#number loadradius

(Optional) The distance in meters when the cargo is loaded into the carrier. Default is the bounding box size of the carrier.

DCS#AI.Skill skill

Skill of the asset.

#table liveries

Table of livery names. When the asset is spawned one livery is chosen randomly.

#string assignment

A free to choose string specifying an assignment for the asset. This can be used with the WAREHOUSE.OnAfterNewAsset function.

Add an off-road path from this warehouse to another and back.

The start and end points are automatically set to one random point in the respective spawn zones of the two warehouses. By default, the reverse path is also added as path from the remote warehouse to this warehouse.

Defined in:

Parameters:

#WAREHOUSE remotewarehouse

The remote warehouse to which the path leads.

Waypoints of this group will define the path between to warehouses.

#boolean oneway

(Optional) If true, the path can only be used from this warehouse to the other but not other way around. Default false.

Return value:

self

Triggers the FSM event "AddRequest".

Add a request to the warehouse queue, which is processed when possible.

Defined in:

Parameters:

#WAREHOUSE warehouse

The warehouse requesting supply.

#WAREHOUSE.Descriptor AssetDescriptor

Descriptor describing the asset that is requested.

AssetDescriptorValue

Value of the asset descriptor. Type depends on descriptor, i.e. could be a string, etc.

#number nAsset

Number of groups requested that match the asset specification.

#WAREHOUSE.TransportType TransportType

Type of transport.

#number nTransport

Number of transport units requested.

#number Prio

Priority of the request. Number ranging from 1=high to 100=low.

#string Assignment

A keyword or text that later be used to identify this request and postprocess the assets.

Add a shipping lane from this warehouse to another remote warehouse.

Note that both warehouses must have a port zone defined before a shipping lane can be added! Shipping lane is taken from the waypoints of a (late activated) template group. So set up a group, e.g. a ship or a helicopter, and place its waypoints along the shipping lane you want to add.

Defined in:

Parameters:

#WAREHOUSE remotewarehouse

The remote warehouse to where the shipping lane is added

Waypoints of this group will define the shipping lane between to warehouses.

#boolean oneway

(Optional) If true, the lane can only be used from this warehouse to the other but not other way around. Default false.

Return value:

self

Triggers the FSM event "AirbaseCaptured" when the airbase of the warehouse has been captured by another coalition.

Defined in:

Parameter:

DCS#coalition.side Coalition

Coalition side which captured the airbase, i.e. a number of DCS#coalition.side enumerator.

Triggers the FSM event "AirbaseRecaptured" when the airbase of the warehouse has been re-captured from the other coalition.

Defined in:

Parameter:

DCS#coalition.side Coalition

Coalition which re-captured the airbase, i.e. the same as the current warehouse owner coalition.

Triggers the FSM event "Arrived" when a group has arrived at the destination warehouse.

This function should always be called from the sending and not the receiving warehouse. If the group is a cargo asset, it is added to the receiving warehouse. If the group is a transporter it is added to the sending warehouse since carriers are supposed to return to their home warehouse once all cargo was delivered.

Defined in:

Parameter:

Group that has arrived.

Triggers the FSM event "AssetDead" when an asset group has died.

Defined in:

Parameters:

The asset that is dead.

The request of the dead asset.

Triggers the FSM event "AssetLowFuel" when an asset runs low on fuel

Defined in:

Parameters:

The asset that is low on fuel.

The request of the asset that is low on fuel.

Triggers the FSM event "AssetSpawned" when the warehouse has spawned an asset.

Defined in:

Parameters:

the group that was spawned.

The asset that was spawned.

The request of the spawned asset.

Triggers the FSM event "Attacked" when a warehouse is under attack by an another coalition.

Defined in:

Parameters:

DCS#coalition.side Coalition

Coalition side which is attacking the warehouse, i.e. a number of DCS#coalition.side enumerator.

DCS#country.id Country

Country ID, which is attacking the warehouse, i.e. a number DCS#country.id enumerator.

Triggers the FSM event "Captured" when a warehouse has been captured by another coalition.

Defined in:

Parameters:

DCS#coalition.side Coalition

Coalition side which captured the warehouse.

DCS#country.id Country

Country id which has captured the warehouse.

Triggers the FSM event "ChangeCountry" so the warehouse is respawned with the new country.

Defined in:

Parameter:

DCS#country.id Country

New country id of the warehouse.

Triggers the FSM event "Defeated" when an attack from an enemy was defeated.

Triggers the FSM event "Delivered".

All (cargo) assets of a request have been delivered to the receiving warehouse.

Defined in:

Parameter:

Pending request that was now delivered.

Triggers the FSM event "Destroyed" when the warehouse was destroyed.

Services are stopped.

Filter stock assets by descriptor and attribute.

Defined in:

Parameters:

#string descriptor

Descriptor describing the filtered assets.

attribute

Value of the descriptor.

#number nmax

(Optional) Maximum number of items that will be returned. Default nmax=nil is all matching items are returned.

#boolean mobile

(Optional) If true, filter only mobile assets.

Return values:

#table:

Filtered assets in stock with the specified descriptor value.

#number:

Total number of (requested) assets available.

#boolean:

If true, enough assets are available.

Find an asset in the the global warehouse data base.

Parameter is the MOOSE group object. Note that the group name must contain they "AID" keyword.

Defined in:

Parameter:

The group from which it is assumed that it has a registered asset.

Return value:

The asset from the data base or nil if it could not be found.

Find nearest warehouse in service, i.e.

warehouses which are not started, stopped or destroyed are not considered. Optionally, only warehouses with (specific) assets can be included in the search or warehouses of a certain coalition.

Defined in:

Parameters:

MinAssets

(Optional) Minimum number of assets the warehouse should have. Default 0.

#string Descriptor

(Optional) Descriptor describing the selected assets which should be in stock. See WAREHOUSE.Descriptor for possible values.

DescriptorValue

(Optional) Descriptor value selecting the type of assets which should be in stock.

DCS#Coalition.side Coalition

(Optional) Coalition side of the warehouse. Default is the same coaliton as the present warehouse. Set to false for any coalition.

Core.Point#COORDINATE RefCoordinate

(Optional) Coordinate to which the closest warehouse is searched. Default is the warehouse calling this function.

Return values:

The the nearest warehouse object. Or nil if no warehouse is found.

#number:

The distance to the nearest warehouse in meters. Or nil if no warehouse is found.

Find a warehouse in the global warehouse data base.

Defined in:

Parameter:

#number uid

The unique ID of the warehouse.

Return value:

The warehouse object or nil if no warehouse exists.

Get airbase associated to the warehouse.

Defined in:

Return value:

Airbase object or nil if warehouse has no airbase connection.

Get category of airbase associated to the warehouse.

Defined in:

Return value:

#number:

Category of airbase or -1 if warehouse has (currently) no airbase.

Get name airbase associated to the warehouse.

Defined in:

Return value:

#string:

name of the airbase assosicated to the warehouse or "none" if the airbase has not airbase connection currently.

Get a warehouse asset from its unique id.

Defined in:

Parameter:

#number id

Asset ID.

Return value:

The warehouse asset.

Get a warehouse asset from its name.

Defined in:

Parameter:

#string GroupName

Spawn group name.

Return value:

The warehouse asset.

Get assignment of a request.

Defined in:

Parameter:

The request from which the assignment is extracted.

Return value:

#string:

The assignment text.

Get coalition side of warehouse static.

Defined in:

Return value:

#number:

Coalition side, i.e. number of DCS#coalition.side.

Get coalition name of warehouse static.

Defined in:

Return value:

#number:

Coalition side, i.e. number of DCS#coalition.side.

Get coordinate of warehouse static.

Defined in:

Return value:

The coordinate of the warehouse.

Get country id of warehouse static.

Defined in:

Return value:

#number:

Country id, i.e. number of DCS#country.id.

Get country name of warehouse static.

Defined in:

Return value:

#number:

Country id, i.e. number of DCS#coalition.side.

Get number of assets in warehouse stock.

Optionally, only specific assets can be counted.

Defined in:

Parameters:

#string Descriptor

(Optional) Descriptor return the number of a specifc asset type. See WAREHOUSE.Descriptor for possible values.

DescriptorValue

(Optional) Descriptor value selecting the type of assets.

#boolean OnlyMobile

(Optional) If true only mobile units are considered.

Return value:

#number:

Number of assets in stock.

Get a warehouse request from its unique id.

Defined in:

Parameter:

#number id

Request ID.

Return values:

The warehouse requested - either queued or pending.

#boolean:

If true, request is queued, if false, request is pending, if nil, request could not be found.

Returns the number of assets for each generalized attribute.

Defined in:

Parameter:

#table stock

The stock of the warehouse.

Return value:

#table:

Data table holding the numbers, i.e. data[attibute]=n.

Check if the warehouse has a shipping lane defined to another warehouse.

Defined in:

Parameters:

#WAREHOUSE warehouse

The remote warehouse to where the connection is checked.

#boolean markpath

If true, place markers of path segments on the F10 map.

#boolean smokepath

If true, put green smoke on path segments.

Return values:

#boolean:

If true, the two warehouses are connected by road.

#number:

Path length in meters. Negative distance -1 meter indicates no connection.

Check if the warehouse has an off road path defined to another warehouse.

Defined in:

Parameters:

#WAREHOUSE warehouse

The remote warehouse to where the connection is checked.

#boolean markpath

If true, place markers of path segments on the F10 map.

#boolean smokepath

If true, put green smoke on path segments.

Return values:

#boolean:

If true, the two warehouses are connected by road.

#number:

Path length in meters. Negative distance -1 meter indicates no connection.

Check if the warehouse has a railroad connection to another warehouse.

Both warehouses need to be started!

Defined in:

Parameters:

#WAREHOUSE warehouse

The remote warehouse to where the connection is checked.

#boolean markpath

If true, place markers of path segments on the F10 map.

#boolean smokepath

If true, put green smoke on path segments.

Return values:

#boolean:

If true, the two warehouses are connected by road.

#number:

Path length in meters. Negative distance -1 meter indicates no connection.

Check if the warehouse has a road connection to another warehouse.

Both warehouses need to be started!

Defined in:

Parameters:

#WAREHOUSE warehouse

The remote warehouse to where the connection is checked.

#boolean markpath

If true, place markers of path segments on the F10 map.

#boolean smokepath

If true, put green smoke on path segments.

Return values:

#boolean:

If true, the two warehouses are connected by road.

#number:

Path length in meters. Negative distance -1 meter indicates no connection.

Check if the warehouse is under attack by another coalition.

Defined in:

Return value:

#boolean:

If true, the warehouse is attacked.

Check if the warehouse has been destroyed.

Defined in:

Return value:

#boolean:

If true, the warehouse had been destroyed.

Check if the warehouse has been loaded from disk via the "Load" event.

Defined in:

Return value:

#boolean:

If true, the warehouse was loaded from disk.

Check if the warehouse has not been started yet, i.e.

is in the state "NotReadyYet".

Defined in:

Return value:

#boolean:

If true, the warehouse object has been created but the warehouse has not been started yet.

Check if the warehouse is paused.

In this state, requests are not processed.

Defined in:

Return value:

#boolean:

If true, the warehouse is paused.

Check if the warehouse is running.

Defined in:

Return value:

#boolean:

If true, the warehouse is running and requests are processed.

Check if the warehouse is stopped.

Defined in:

Return value:

#boolean:

If true, the warehouse is stopped.

Triggers the FSM event "Load" when the warehouse is loaded from a file on disk.

Defined in:

Parameters:

#string path

Path where the file is located. Default is the DCS installation root directory.

#string filename

(Optional) File name. Default is WAREHOUSE-_.txt.

The WAREHOUSE constructor.

Creates a new WAREHOUSE object from a static object. Parameters like the coalition and country are taken from the static object structure.

Defined in:

Parameters:

The physical structure representing the warehouse.

#string alias

(Optional) Alias of the warehouse, i.e. the name it will be called when sending messages etc. Default is the name of the static

Return value:

self

Triggers the FSM delayed event "NewAsset" when a new asset has been added to the warehouse stock.

Defined in:

Parameters:

The new asset.

#string assignment

(Optional) Assignment text for the asset.

On after "AirbaseCaptured" even user function.

Called when the airbase of the warehouse has been captured by another coalition.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

Coalition side which captured the airbase, i.e. a number of DCS#coalition.side enumerator.

On after "AirbaseRecaptured" event user function.

Called when the airbase of the warehouse has been re-captured from the other coalition.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

Coalition which re-captured the airbase, i.e. the same as the current warehouse owner coalition.

On after "Arrived" event user function.

Called when a group has arrived at its destination.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Group that has arrived.

On after "AssetDead" event user function.

Called when an asset group died.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The asset that is dead.

The request of the dead asset.

On after "AssetLowFuel" event user function.

Called when the an asset is low on fuel.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The asset that is low on fuel.

The request of the asset that is low on fuel.

On after "AssetSpawned" event user function.

Called when the warehouse has spawned an asset.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

the group that was spawned.

The asset that was spawned.

The request of the spawned asset.

On after "Attacked" event user function.

Called when a warehouse (zone) is under attack by an enemy.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

Coalition side which is attacking the warehouse, i.e. a number of DCS#coalition.side enumerator.

DCS#country.id Country

Country ID, which is attacking the warehouse, i.e. a number DCS#country.id enumerator.

On after "Captured" event user function.

Called when the warehouse has been captured by an enemy coalition.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

Coalition side which captured the warehouse, i.e. a number of DCS#coalition.side enumerator.

DCS#country.id Country

Country id which has captured the warehouse, i.e. a number DCS#country.id enumerator.

On after "ChangeCountry" event user function.

Called when the warehouse has changed its country.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#country.id Country

New country id of the warehouse, i.e. a number DCS#country.id enumerator.

On after "Defeated" event user function.

Called when an enemy attack was defeated.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Delivered" event user function.

Called when a group has been delivered from the warehouse to another warehouse.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Pending request that was now delivered.

On after "Destroyed" event user function.

Called when the warehouse was destroyed. Services are stopped.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Load" event user function.

Called when the warehouse assets are loaded from disk.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

#string path

Path where the file is located. Default is the DCS installation root directory.

#string filename

(Optional) File name. Default is WAREHOUSE-_.txt.

On after "NewAsset" event user function.

A new asset has been added to the warehouse stock.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The asset that has just been added.

#string assignment

(Optional) Assignment text for the asset.

On after "Request" user function.

The necessary cargo and transport assets were spawned.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Information table of the request.

On after "Respawn" event user function.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Save" event user function.

Called when the warehouse assets are saved to disk.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

#string path

Path where the file is saved. Default is the DCS installation root directory.

#string filename

(Optional) File name. Default is WAREHOUSE-_.txt.

On after "SelfRequest" event.

Request was initiated from the warehouse to itself. Groups are simply spawned at the warehouse or the associated airbase. All requested assets are passed as a Core.Set#SET_GROUP and can be used for further tasks or in other MOOSE classes. Note that airborne assets are spawned in uncontrolled state so they do not simply "fly away" after spawning.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The set of (cargo) groups that was delivered to the warehouse itself.

Pending self request.

Usage:

--- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase.
function mywarehouse:OnAfterSelfRequest(From, Event, To, groupset, request)
  local groupset=groupset --Core.Set#SET_GROUP

  -- Loop over all groups spawned from that request.
  for _,group in pairs(groupset:GetSetObjects()) do
    local group=group --Wrapper.Group#GROUP

    -- Gree smoke on spawned group.
    group:SmokeGreen()

    -- Activate uncontrolled airborne group if necessary.
    group:StartUncontrolled()
  end
end

On before "Request" user function.

The necessary cargo and transport assets will be spawned. Time to set some additional asset parameters.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Information table of the request.

Triggers the FSM event "Pause".

Pauses the warehouse. Assets can still be added and requests be made. However, requests are not processed.

Triggers the FSM event "Request".

Executes a request from the queue if possible.

Defined in:

Parameter:

Information table of the request.

Triggers the FSM event "Respawn".

Triggers the FSM event "Restart".

Restarts the warehouse from stopped state by reactivating the event handlers only.

Triggers the FSM event "Save" when the warehouse assets are saved to file on disk.

Defined in:

Parameters:

#string path

Path where the file is saved. Default is the DCS installation root directory.

#string filename

(Optional) File name. Default is WAREHOUSE-_.txt.

Triggers the FSM event "SelfRequest".

Request was initiated from the warehouse to itself. Groups are just spawned at the warehouse or the associated airbase. If the warehouse is currently under attack when the self request is made, the self request is added to the defending table. One the attack is defeated, this request is used to put the groups back into the warehouse stock.

Defined in:

Parameters:

The set of cargo groups that was delivered to the warehouse itself.

Pending self request.

Set the airbase belonging to this warehouse.

Note that it has to be of the same coalition as the warehouse. Also, be reasonable and do not put it too far from the phyiscal warehouse structure because you troops might have a long way to get to their transports.

Defined in:

Parameter:

The airbase object associated to this warehouse.

Return value:

self

Set auto defence off.

This is the default.

Defined in:

Return value:

self

Set auto defence on.

When the warehouse is under attack, all ground assets are spawned automatically and will defend the warehouse zone.

Defined in:

Return value:

self

Set debug mode off.

This is the default

Defined in:

Return value:

self

Set debug mode on.

Error messages will be displayed on screen, units will be smoked at some events.

Defined in:

Return value:

self

Set low fuel threshold.

If one unit of an asset has less fuel than this number, the event AssetLowFuel will be fired.

Defined in:

Parameter:

#number threshold

Relative low fuel threshold, i.e. a number in [0,1]. Default 0.15 (15%).

Return value:

self

Show or don't show markers on the F10 map displaying the Warehouse stock and road/rail connections.

Defined in:

Parameter:

#boolean switch

If true (or nil), markers are on. If false, markers are not displayed.

Return value:

self

Set valid parking spot IDs.

Defined in:

Parameter:

#table ParkingIDs

Table of numbers.

Return value:

self

Set the port zone for this warehouse.

The port zone is the zone, where all naval assets of the warehouse are spawned.

Defined in:

Parameter:

The zone defining the naval port of the warehouse.

Return value:

self

Set the connection of the warehouse to the railroad.

This is the place where train assets or transports will be spawned.

Defined in:

Parameter:

The railroad connection. Technically, the closest point on rails from this coordinate is determined by DCS API function. So this point must not be exactly on the a railroad connection.

Return value:

self

Set report off.

Warehouse does not report about its status and at certain events.

Defined in:

Return value:

self

Set report on.

Messages at events will be displayed on screen to the coalition owning the warehouse.

Defined in:

Return value:

self

Set respawn after destroy.

Defined in:

Parameter:

delay

Return value:

self

Set the connection of the warehouse to the road.

Ground assets spawned in the warehouse spawn zone will first go to this point and from there travel on road to the requesting warehouse. Note that by default the road connection is set to the closest point on road from the center of the spawn zone if it is withing 3000 meters. Also note, that if the parameter "coordinate" is passed as nil, any road connection is disabled and ground assets cannot travel of be transportet on the ground.

Defined in:

Parameter:

The road connection. Technically, the closest point on road from this coordinate is determined by DCS API function. So this point must not be exactly on the road.

Return value:

self

Disable safe parking option.

Note that is the default setting.

Defined in:

Return value:

self

Enable safe parking option, i.e.

parking spots at an airbase will be considered as occupied when a client aircraft is parked there (even if the client slot is not taken by a player yet). Note that also incoming aircraft can reserve/occupie parking spaces.

Defined in:

Return value:

self

Enable auto save of warehouse assets at mission end event.

Defined in:

Parameters:

#string path

Path where to save the asset data file.

#string filename

File name. Default is generated automatically from warehouse id.

Return value:

self

Set a zone where the (ground) assets of the warehouse are spawned once requested.

Defined in:

Parameters:

The spawn zone.

#number maxdist

(Optional) Maximum distance in meters between spawn zone and warehouse. Units are not spawned if distance is larger. Default is 5000 m.

Return value:

self

Set interval of status updates.

Note that normally only one request can be processed per time interval.

Defined in:

Parameter:

#number timeinterval

Time interval in seconds.

Return value:

self

Set a warehouse zone.

If this zone is captured, the warehouse and all its assets fall into the hands of the enemy.

Defined in:

Parameter:

The warehouse zone. Note that this cannot be a polygon zone!

Return value:

self

Triggers the FSM event "Start".

Starts the warehouse. Initializes parameters and starts event handlers.

Triggers the FSM event "Status".

Queue is updated and requests are executed.

Triggers the FSM event "Stop".

Stops the warehouse and all its event handlers. All waiting and pending queue items are deleted as well and all assets are removed from stock.

Triggers the FSM event "Unpause".

Unpauses the warehouse. Processing of queued requests is resumed.

Task function for last waypoint.

Triggering the "Arrived" event.

Defined in:

Parameter:

The group that arrived.

Asset item characteristics.

Defined in:

Parameter:

The asset for which info in printed in trace mode.

Checks if the associated airbase still belongs to the warehouse.

Function that checks if an asset group is still okay.

Checks if the warehouse zone was conquered by antoher coalition.

Checks fuel on all pening assets.

Check parking ID.

Defined in:

Parameter:

Return value:

#boolean:

If true, parking is valid.

Sorts the queue and checks if the request can be fulfilled.

Defined in:

Return value:

Chosen request.

Checks if the request can be fulfilled in general.

If not, it is removed from the queue. Check if departure and destination bases are of the right type.

Defined in:

Parameter:

#table queue

The queue which is holding the requests to check.

Return value:

#boolean:

If true, request can be executed. If false, something is not right.

Checks if the request can be fulfilled right now.

Check for current parking situation, number of assets and transports currently in stock.

Defined in:

Parameter:

The request to be checked.

Return value:

#boolean:

If true, request can be executed. If false, something is not right.

Check if a request is valid in general.

If not, it will be removed from the queue. This routine needs to have at least one asset in stock that matches the request descriptor in order to determine whether the request category of troops. If no asset is in stock, the request will remain in the queue but cannot be executed.

Defined in:

Parameter:

The request to be checked.

Return value:

#boolean:

If true, request can be executed. If false, something is not right.

Debug message.

Message send to all if debug mode is activated (and duration > 0). Text self:T(text) added to DCS.log file.

Defined in:

Parameters:

#string text

The text of the error message.

#number duration

Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.

Delete item from queue.

Defined in:

Parameters:

Item of queue to be removed.

#table queue

The queue from which the item should be deleted.

Delete item from queue.

Defined in:

Parameters:

#number qitemID

ID of queue item to be removed.

#table queue

The queue from which the item should be deleted.

Delete an asset item from stock.

Defined in:

Parameter:

Asset item to delete from stock table.

Display status of warehouse.

Display stock items of warehouse.

Defined in:

Parameter:

#table stock

Table holding all assets in stock of the warehouse. Each entry is of type WAREHOUSE.Assetitem.

Error message.

Message send to all (if duration > 0). Text self:E(text) added to DCS.log file.

Defined in:

Parameters:

#string text

The text of the error message.

#number duration

Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.

Filter stock assets by table entry.

Defined in:

Parameters:

#table stock

Table holding all assets in stock of the warehouse. Each entry is of type WAREHOUSE.Assetitem.

#string descriptor

Descriptor describing the filtered assets.

attribute

Value of the descriptor.

#number nmax

(Optional) Maximum number of items that will be returned. Default nmax=nil is all matching items are returned.

#boolean mobile

(Optional) If true, filter only mobile assets.

Return values:

#table:

Filtered stock items table.

#number:

Total number of (requested) assets available.

#boolean:

If true, enough assets are available.

Seach unoccupied parking spots at the airbase for a list of assets.

For each asset group a list of parking spots is returned. During the search also the not yet spawned asset aircraft are considered. If not enough spots for all asset units could be found, the routine returns nil!

Defined in:

Parameters:

The airbase where we search for parking spots.

#table assets

A table of assets for which the parking spots are needed.

Return value:

#table:

Table of coordinates and terminal IDs of free parking spots. Each table entry has the elements .Coordinate and .TerminalID.

Get the generalized attribute of a group.

Note that for a heterogenious group, the attribute is determined from the attribute of the first unit!

Defined in:

Parameter:

MOOSE group object.

Return value:

Generalized attribute of the group.

Make a flight plan from a departure to a destination airport.

Defined in:

Parameters:

Departure airbase.

Destination airbase.

Return values:

#table:

Table of flightplan waypoints.

#table:

Table of flightplan coordinates.

Get warehouse id, asset id and request id from group name (alias).

Defined in:

Parameter:

The group from which the info is gathered.

Return values:

#number:

Warehouse ID.

#number:

Asset ID.

#number:

Request ID.

Get warehouse id, asset id and request id from group name (alias).

Defined in:

Parameter:

The group from which the info is gathered.

Return values:

#number:

Warehouse ID.

#number:

Asset ID.

#number:

Request ID.

Calculate the maximum height an aircraft can reach for the given parameters.

Defined in:

Parameters:

#number D

Total distance in meters from Departure to holding point at destination.

#number alphaC

Climb angle in rad.

#number alphaD

Descent angle in rad.

#number Hdep

AGL altitude of departure point.

#number Hdest

AGL altitude of destination point.

#number Deltahhold

Relative altitude of holding point above destination.

Return value:

#number:

Maximum height the aircraft can reach.

Get group name without any spawn or cargo suffix #CARGO etc.

Defined in:

Parameter:

The group from which the info is gathered.

Return value:

#string:

Name of the object without trailing #...

Size of the bounding box of a DCS object derived from the DCS descriptor table.

If boundinb box is nil, a size of zero is returned.

Defined in:

Parameter:

DCS#Object DCSobject

The DCS object for which the size is needed.

Return values:

#number:

Max size of object in meters (length (x) or width (z) components not including height (y)).

#number:

Length (x component) of size.

#number:

Height (y component) of size.

#number:

Width (z component) of size.

Get the request belonging to a group.

Defined in:

Parameters:

The group from which the info is gathered.

#table queue

Queue holding all requests.

Return value:

The request belonging to this group.

Get text about warehouse stock.

Defined in:

Parameter:

#boolean messagetoall

If true, send message to all.

Return value:

#string:

Text about warehouse stock

Get the proper terminal type based on generalized attribute of the group.

Defined in:

Parameters:

Generlized attibute of unit.

#number _category

Airbase category.

Return value:

Terminal type for this group.

Get (optimized) transport carriers for the given assets to be transported.

Defined in:

Parameters:

request.

request

Is the group a used as transporter for a given request?

Defined in:

Parameters:

The group from which the info is gathered.

Request.

Return value:

#boolean:

True if group is transport, false if group is cargo and nil otherwise.

Check if a group has a generalized attribute.

Defined in:

Parameters:

MOOSE group object.

Attribute to check.

Return value:

#boolean:

True if group has the specified attribute.

Info Message.

Message send to coalition if reports or debug mode activated (and duration > 0). Text self:I(text) added to DCS.log file.

Defined in:

Parameters:

#string text

The text of the error message.

#number duration

Message display duration in seconds. Default 20 sec. If duration is zero, no message is displayed.

Function that checks if a pending job is done and can be removed from queue.

Create a new path from a template group.

Defined in:

Parameters:

Group used for extracting the waypoints.

First coordinate.

Final coordinate.

Return value:

#table:

Table with route points.

Arrived event if an air unit/group arrived at its destination.

This can be an engine shutdown or a landing event.

Defined in:

Parameter:

Event data table.

Warehouse event handling function.

Handles the case when the airbase associated with the warehous is captured.

Defined in:

Parameter:

Event data.

Warehouse event function, handling the birth of a unit.

Defined in:

Parameter:

Event data.

Warehouse event handling function.

Defined in:

Parameter:

Event data.

Function handling the event when a (warehouse) unit shuts down its engines.

Defined in:

Parameter:

Event data.

Function handling the event when a (warehouse) unit starts its engines.

Defined in:

Parameter:

Event data.

Function handling the event when a (warehouse) unit lands.

Defined in:

Parameter:

Event data.

Warehouse event handling function.

Handles the case when the mission is ended.

Defined in:

Parameter:

Event data.

Function handling the event when a (warehouse) unit takes off.

Defined in:

Parameter:

Event data.

Task function for when passing a waypoint.

Defined in:

Parameters:

The group that arrived.

#number n

Waypoint passed.

#number N

Final waypoint.

Prints the queue to DCS.log file.

Defined in:

Parameters:

#table queue

Queue to print.

#string name

Name of the queue for info reasons.

Relative to absolute quantity.

Defined in:

Parameters:

#string relative

Relative number in terms of WAREHOUSE.Quantity.

#number ntot

Total number.

Return value:

#number:

Absolute number.

Register new asset in globase warehouse data base.

Defined in:

Parameters:

The group that will be added to the warehouse stock.

#number ngroups

Number of groups to be added.

#string forceattribute

Forced generalized attribute.

#number forcecargobay

Cargo bay weight limit in kg.

#number forceweight

Weight of units in kg.

#number loadradius

Radius in meters when cargo is loaded into the carrier.

#table liveries

Table of liveries.

DCS#AI.Skill skill

Skill of AI.

#string assignment

Assignment attached to the asset item.

Return value:

#table:

A table containing all registered assets.

Route the airplane from one airbase another.

Activates uncontrolled aircraft and sets ROE/ROT for ferry flights. ROE is set to return fire and ROT to passive defence.

Defined in:

Parameter:

Airplane group to be routed.

Route ground units to destination.

ROE is set to return fire and alarm state to green.

Defined in:

Parameters:

The ground group to be routed

The request for this group.

Route naval units along user defined shipping lanes to destination warehouse.

ROE is set to return fire.

Defined in:

Parameters:

The naval group to be routed

The request for this group.

Route trains to their destination - or at least to the closest point on rail of the desired final destination.

Defined in:

Parameters:

The train group.

of the destination. Tail will be routed to the closest point

#number Speed

Speed in km/h to drive to the destination coordinate. Default is 60% of max possible speed the unit can go.

Simple task function.

Can be used to call a function which has the warehouse and the executing group as parameters.

Defined in:

Parameters:

#string Function

The name of the function to call passed as string.

The group which is meant.

Simple task function.

Can be used to call a function which has the warehouse and the executing group as parameters.

Defined in:

Parameters:

#string Function

The name of the function to call passed as string.

The group which is meant.

#number n

Waypoint passed.

#number N

Final waypoint number.

Sort requests queue wrt prio and request uid.

Spawn an aircraft asset (plane or helo) at the airbase associated with the warehouse.

Defined in:

Parameters:

#string alias

Alias name of the asset group.

Ground asset that will be spawned.

Request belonging to this asset. Needed for the name/alias.

#table parking

Parking data for this asset.

#boolean uncontrolled

Spawn aircraft in uncontrolled state.

#boolean hotstart

Spawn aircraft with engines already on. Default is a cold start with engines off.

Return value:

The spawned group or nil if the group could not be spawned.

Spawn a ground or naval asset in the corresponding spawn zone of the warehouse.

Defined in:

Parameters:

#string alias

Alias name of the asset group.

Ground asset that will be spawned.

Request belonging to this asset. Needed for the name/alias.

Core.Zone#ZONE spawnzone

Zone where the assets should be spawned.

#boolean aioff

If true, AI of ground units are set to off.

Return value:

The spawned group or nil if the group could not be spawned.

Prepare a spawn template for the asset.

Deep copy of asset template, adjusting template and unit names, nillifying group and unit ids.

Defined in:

Parameters:

Ground asset that will be spawned.

#string alias

Alias name of the group.

Return value:

#table:

Prepared new spawn template.

Spawns requested assets at warehouse or associated airbase.

Defined in:

Parameter:

Information table of the request.

A unit of a group just died.

Update group sets in request. This is important in order to determine if a job is done and can be removed from the (pending) queue.

Defined in:

Parameters:

Unit that died.

Request that needs to be updated.

Create or update mark text at warehouse, which is displayed in F10 map showing how many assets of each type are in stock.

Only the coaliton of the warehouse owner is able to see it.

Defined in:

Return value:

#string:

Text about warehouse stock

Trigger the FSM event "AddAsset" with a delay.

Add a group to the warehouse stock.

Defined in:

Parameters:

#number delay

Delay in seconds.

Group to be added as new asset.

#number ngroups

(Optional) Number of groups to add to the warehouse stock. Default is 1.

#WAREHOUSE.Attribute forceattribute

(Optional) Explicitly force a generalized attribute for the asset. This has to be an WAREHOUSE.Attribute.

#number forcecargobay

(Optional) Explicitly force cargobay weight limit in kg for cargo carriers. This is for each unit of the group.

#number forceweight

(Optional) Explicitly force weight in kg of each unit in the group.

#number loadradius

(Optional) The distance in meters when the cargo is loaded into the carrier. Default is the bounding box size of the carrier.

DCS#AI.Skill skill

Skill of the asset.

#table liveries

Table of livery names. When the asset is spawned one livery is chosen randomly.

#string assignment

A free to choose string specifying an assignment for the asset. This can be used with the WAREHOUSE.OnAfterNewAsset function.

Triggers the FSM event "AddRequest" with a delay.

Add a request to the warehouse queue, which is processed when possible.

Defined in:

Parameters:

#number delay

Delay in seconds.

#WAREHOUSE warehouse

The warehouse requesting supply.

#WAREHOUSE.Descriptor AssetDescriptor

Descriptor describing the asset that is requested.

AssetDescriptorValue

Value of the asset descriptor. Type depends on descriptor, i.e. could be a string, etc.

#number nAsset

Number of groups requested that match the asset specification.

#WAREHOUSE.TransportType TransportType

Type of transport.

#number nTransport

Number of transport units requested.

#number Prio

Priority of the request. Number ranging from 1=high to 100=low.

#string Assignment

A keyword or text that later be used to identify this request and postprocess the assets.

Triggers the FSM event "AirbaseCaptured" with a delay when the airbase of the warehouse has been captured by another coalition.

Defined in:

Parameters:

#number delay

Delay in seconds.

DCS#coalition.side Coalition

Coalition side which captured the airbase, i.e. a number of DCS#coalition.side enumerator.

Triggers the FSM event "AirbaseRecaptured" with a delay when the airbase of the warehouse has been re-captured from the other coalition.

Defined in:

Parameters:

#number delay

Delay in seconds.

DCS#coalition.side Coalition

Coalition which re-captured the airbase, i.e. the same as the current warehouse owner coalition.

Triggers the FSM event "Arrived" after a delay when a group has arrived at the destination.

This function should always be called from the sending and not the receiving warehouse. If the group is a cargo asset, it is added to the receiving warehouse. If the group is a transporter it is added to the sending warehouse since carriers are supposed to return to their home warehouse once

Defined in:

Parameters:

#number delay

Delay in seconds.

Group that has arrived.

Triggers the delayed FSM event "AssetDead" when an asset group has died.

Defined in:

Parameters:

#number delay

Delay in seconds.

The asset that is dead.

The request of the dead asset.

Triggers the FSM event "AssetLowFuel" with a delay when an asset runs low on fuel.

Defined in:

Parameters:

#number delay

Delay in seconds.

The asset that is low on fuel.

The request of the asset that is low on fuel.

Triggers the FSM event "AssetSpawned" with a delay when the warehouse has spawned an asset.

Defined in:

Parameters:

#number delay

Delay in seconds.

the group that was spawned.

The asset that was spawned.

The request of the spawned asset.

Triggers the FSM event "Attacked" with a delay when a warehouse is under attack by an another coalition.

Defined in:

Parameters:

#number delay

Delay in seconds.

DCS#coalition.side Coalition

Coalition side which is attacking the warehouse, i.e. a number of DCS#coalition.side enumerator.

DCS#country.id Country

Country ID, which is attacking the warehouse, i.e. a number DCS#country.id enumerator.

Triggers the FSM event "Captured" with a delay when a warehouse has been captured by another coalition.

Defined in:

Parameters:

#number delay

Delay in seconds.

DCS#coalition.side Coalition

Coalition side which captured the warehouse.

DCS#country.id Country

Country id which has captured the warehouse.

Triggers the FSM event "ChangeCountry" after a delay so the warehouse is respawned with the new country.

Defined in:

Parameters:

#number delay

Delay in seconds.

DCS#country.id Country

Country id which has captured the warehouse.

Triggers the FSM event "Defeated" with a delay when an attack from an enemy was defeated.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Delivered" after a delay.

A group has been delivered from the warehouse to another warehouse.

Defined in:

Parameters:

#number delay

Delay in seconds.

Pending request that was now delivered.

Triggers the FSM event "Destroyed" with a delay when the warehouse was destroyed.

Services are stopped.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Load" with a delay when the warehouse assets are loaded from disk.

Defined in:

Parameters:

#number delay

Delay in seconds.

#string path

Path where the file is located. Default is the DCS installation root directory.

#string filename

(Optional) File name. Default is WAREHOUSE-_.txt.

Triggers the FSM delayed event "NewAsset" when a new asset has been added to the warehouse stock.

Defined in:

Parameters:

#number delay

Delay in seconds.

The new asset.

#string assignment

(Optional) Assignment text for the asset.

Triggers the FSM event "Pause" after a delay.

Pauses the warehouse. Assets can still be added and requests be made. However, requests are not processed.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Request" after a delay.

Executes a request from the queue if possible.

Defined in:

Parameters:

#number Delay

Delay in seconds.

Information table of the request.

Triggers the FSM event "Respawn" after a delay.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Restart" after a delay.

Restarts the warehouse from stopped state by reactivating the event handlers only.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Save" with a delay when the warehouse assets are saved to a file.

Defined in:

Parameters:

#number delay

Delay in seconds.

#string path

Path where the file is saved. Default is the DCS installation root directory.

#string filename

(Optional) File name. Default is WAREHOUSE-_.txt.

Triggers the FSM event "SelfRequest" with a delay.

Request was initiated from the warehouse to itself. Groups are just spawned at the warehouse or the associated airbase. If the warehouse is currently under attack when the self request is made, the self request is added to the defending table. One the attack is defeated, this request is used to put the groups back into the warehouse stock.

Defined in:

Parameters:

#number delay

Delay in seconds.

The set of cargo groups that was delivered to the warehouse itself.

Pending self request.

Triggers the FSM event "Start" after a delay.

Starts the warehouse. Initializes parameters and starts event handlers.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Status" after a delay.

Queue is updated and requests are executed.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Stop" after a delay.

Stops the warehouse and all its event handlers. All waiting and pending queue items are deleted as well and all assets are removed from stock.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Unpause" after a delay.

Unpauses the warehouse. Processing of queued requests is resumed.

Defined in:

Parameter:

#number delay

Delay in seconds.

On after "AddAsset" event.

Add a group to the warehouse stock. If the group is alive, it is destroyed.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Group or template group to be added to the warehouse stock.

#number ngroups

Number of groups to add to the warehouse stock. Default is 1.

#WAREHOUSE.Attribute forceattribute

(Optional) Explicitly force a generalized attribute for the asset. This has to be an WAREHOUSE.Attribute.

#number forcecargobay

(Optional) Explicitly force cargobay weight limit in kg for cargo carriers. This is for each unit of the group.

#number forceweight

(Optional) Explicitly force weight in kg of each unit in the group.

#number loadradius

(Optional) Radius in meters when the cargo is loaded into the carrier.

DCS#AI.Skill skill

Skill of the asset.

#table liveries

Table of livery names. When the asset is spawned one livery is chosen randomly.

#string assignment

A free to choose string specifying an assignment for the asset. This can be used with the WAREHOUSE.OnAfterNewAsset function.

#table other

(Optional) Table of other useful data. Can be collected via WAREHOUSE.OnAfterNewAsset() function for example

On after "AddRequest" event.

Add a request to the warehouse queue, which is processed when possible.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

#WAREHOUSE warehouse

The warehouse requesting supply.

#WAREHOUSE.Descriptor AssetDescriptor

Descriptor describing the asset that is requested.

AssetDescriptorValue

Value of the asset descriptor. Type depends on descriptor, i.e. could be a string, etc.

#number nAsset

Number of groups requested that match the asset specification.

#WAREHOUSE.TransportType TransportType

Type of transport.

#number nTransport

Number of transport units requested.

#number Prio

Priority of the request. Number ranging from 1=high to 100=low.

#string Assignment

A keyword or text that can later be used to identify this request and postprocess the assets.

On after "AirbaseCaptured" event.

Airbase of warehouse has been captured by another coalition.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

which captured the warehouse.

On after "AirbaseRecaptured" event.

Airbase of warehouse has been re-captured from other coalition.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

Coalition side which originally captured the warehouse.

On after "Arrived" event.

Triggered when a group has arrived at its destination warehouse. The routine should be called by the warehouse sending this asset and not by the receiving warehouse. It is checked if this asset is cargo (or self propelled) or transport. If it is cargo it is put into the stock of receiving warehouse. If it is a transporter it is put back into the sending warehouse since transports are supposed to return their home warehouse.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The group that was delivered.

On after "AssetDead" event triggered when an asset group died.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The asset that is dead.

The request of the dead asset.

On after "AssetSpawned" event triggered when an asset group is spawned into the cruel world.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The group spawned.

The asset that is dead.

The request of the dead asset.

On after "Attacked" event.

Warehouse is under attack by an another coalition.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

which is attacking the warehouse.

DCS#country.id Country

which is attacking the warehouse.

On after "Captured" event.

Warehouse has been captured by another coalition.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

which captured the warehouse.

DCS#country.id Country

which has captured the warehouse.

On after "ChangeCountry" event.

Warehouse is respawned with the specified country. All queued requests are deleted and the owned airbase is reset if the coalition is changed by changing the country.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#country.id Country

Country which has captured the warehouse.

On after "Defeated" event.

Warehouse defeated an attack by another coalition. Defender assets are added back to warehouse stock.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Delivered" event.

Triggered when all asset groups have reached their destination. Corresponding request is deleted from the pending queue.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The pending request that is finished and deleted from the pending queue.

On after "Destroyed" event.

Warehouse was destroyed. All services are stopped. Warehouse is going to "Stopped" state in one minute.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Load" event.

Warehouse assets are loaded from file on disk.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

#string path

Path where the file is loaded from.

#string filename

(Optional) Name of the file containing the asset data.

On after "NewAsset" event.

A new asset has been added to the warehouse stock.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The asset that has just been added.

#string assignment

The (optional) assignment for the asset.

On after "Pause" event.

Pauses the warehouse, i.e. no requests are processed. However, new requests and new assets can be added in this state.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Request" event.

Spawns the necessary cargo and transport assets.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Information table of the request.

On after "RequestSpawned" event.

Initiates the transport of the assets to the requesting warehouse.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Information table of the request.

Core.Set#SET_GROUP CargoGroupSet

Set of cargo groups.

Core.Set#SET_GROUP TransportGroupSet

Set of transport groups if any.

Respawn warehouse.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Restart" event.

Restarts the warehouse when it was in stopped state by reactivating the event handlers only.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Save" event.

Warehouse assets are saved to file on disk.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

#string path

Path where the file is saved. If nil, file is saved in the DCS root installtion directory.

#string filename

(Optional) Name of the file containing the asset data.

On after "SelfRequest" event.

Request was initiated to the warehouse itself. Groups are just spawned at the warehouse or the associated airbase. If the warehouse is currently under attack when the self request is made, the self request is added to the defending table. One the attack is defeated, this request is used to put the groups back into the warehouse stock.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The set of asset groups that was delivered to the warehouse itself.

Pending self request.

On after Start event.

Starts the warehouse. Addes event handlers and schedules status updates of reqests and queue.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after Status event.

Checks the queue and handles requests.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Stop" event.

Stops the warehouse, unhandles all events.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "Unloaded" event.

Triggered when a group was unloaded from the carrier.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The group that was delivered.

On after "Unpause" event.

Unpauses the warehouse, i.e. requests in queue are processed again.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On before "AddRequest" event.

Checks some basic properties of the given parameters.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

#WAREHOUSE warehouse

The warehouse requesting supply.

#WAREHOUSE.Descriptor AssetDescriptor

Descriptor describing the asset that is requested.

AssetDescriptorValue

Value of the asset descriptor. Type depends on descriptor, i.e. could be a string, etc.

#number nAsset

Number of groups requested that match the asset specification.

#WAREHOUSE.TransportType TransportType

Type of transport.

#number nTransport

Number of transport units requested.

#number Prio

Priority of the request. Number ranging from 1=high to 100=low.

#string Assignment

A keyword or text that later be used to identify this request and postprocess the assets.

Return value:

#boolean:

If true, request is okay at first glance.

On before "Arrived" event.

Triggered when a group has arrived at its destination warehouse.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The group that was delivered.

On before "AssetSpawned" event.

Checks whether the asset was already set to "spawned" for groups with multiple units.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The group spawned.

The asset that is dead.

The request of the dead asset.

On before "Captured" event.

Warehouse has been captured by another coalition.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#coalition.side Coalition

which captured the warehouse.

DCS#country.id Country

which has captured the warehouse.

On before "ChangeCountry" event.

Checks whether a change of country is necessary by comparing the actual country to the the requested one.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

DCS#country.id Country

which has captured the warehouse.

On before "Load" event.

Checks if the file the warehouse data should be loaded from exists.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

#string path

Path where the file is loaded from.

#string filename

(Optional) Name of the file containing the asset data.

On before "Request" event.

Checks if the request can be fulfilled.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Information table of the request.

Return value:

#boolean:

If true, request is granted.

Field(s)

#string AIRWING.ClassName

Name of the class.

#boolean AIRWING.Debug

Debug mode. Messages to all about status.

#string AIRWING.lid

Class id string for output to DCS log file.

#table AIRWING.menu

Table of menu items.

#table AIRWING.missionqueue

Mission queue table.

#number AIRWING.nflightsAWACS

Number of AWACS flights constantly in the air.

#number AIRWING.nflightsCAP

Number of CAP flights constantly in the air.

#number AIRWING.nflightsRescueHelo

Number of Rescue helo flights constantly in the air.

#number AIRWING.nflightsTANKERboom

Number of TANKER flights with BOOM constantly in the air.

#number AIRWING.nflightsTANKERprobe

Number of TANKER flights with PROBE constantly in the air.

#number AIRWING.payloadcounter

Running index of payloads.

#table AIRWING.payloads

Playloads for specific aircraft and mission types.

#table AIRWING.pointsAWACS

Table of AWACS points.

#table AIRWING.pointsCAP

Table of CAP points.

#table AIRWING.pointsTANKER

Table of Tanker points.

AIRWING.requestID

The queueid has been increased in the onafterAddRequest function. So we can simply use it here.

#table AIRWING.squadrons

Table of squadrons.

#number AIRWING.verbose

Verbosity of output.

#string AIRWING.version

AIRWING class version.

Ops.WingCommander#WINGCOMMANDER AIRWING.wingcommander

The wing commander responsible for this airwing.

Function(s)

Adds an End state.

Defined in:

Parameter:

State

Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Returns the End states.

Defined in:

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Returns a table with the scores defined.

Defined in:

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Returns a table with the Subs defined.

Defined in:

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Defined in:

Parameter:

State

Defined in:

Parameter:

CallBackTable

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Defined in:

Parameters:

Map

Event

Defined in:

Parameters:

step

trigger

params

EventName

Defined in:

Parameter:

EventName

Defined in:

Parameter:

EventName

Defined in:

Parameters:

Events

EventStructure

Defined in:

Parameters:

ParentFrom

ParentEvent

Defined in:

Parameters:

EventName

...

Defined in:

Parameter:

Current

Defined in:

Parameters:

subs

sub

name

Defined in:

Parameter:

e

Defined in:

Parameter:

e

Defined in:

Parameter:

state

Field(s)

#string AIRWING.ClassName

Name of the class.

#boolean AIRWING.Debug

Debug mode. Messages to all about status.

#string AIRWING.lid

Class id string for output to DCS log file.

#table AIRWING.menu

Table of menu items.

#table AIRWING.missionqueue

Mission queue table.

#number AIRWING.nflightsAWACS

Number of AWACS flights constantly in the air.

#number AIRWING.nflightsCAP

Number of CAP flights constantly in the air.

#number AIRWING.nflightsRescueHelo

Number of Rescue helo flights constantly in the air.

#number AIRWING.nflightsTANKERboom

Number of TANKER flights with BOOM constantly in the air.

#number AIRWING.nflightsTANKERprobe

Number of TANKER flights with PROBE constantly in the air.

#number AIRWING.payloadcounter

Running index of payloads.

#table AIRWING.payloads

Playloads for specific aircraft and mission types.

#table AIRWING.pointsAWACS

Table of AWACS points.

#table AIRWING.pointsCAP

Table of CAP points.

#table AIRWING.pointsTANKER

Table of Tanker points.

AIRWING.requestID

The queueid has been increased in the onafterAddRequest function. So we can simply use it here.

#table AIRWING.squadrons

Table of squadrons.

#number AIRWING.verbose

Verbosity of output.

#string AIRWING.version

AIRWING class version.

Ops.WingCommander#WINGCOMMANDER AIRWING.wingcommander

The wing commander responsible for this airwing.

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Remove Unit Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Takeoff Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Log an exception which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#string:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

The ClassName + ClassID is formatted as '%s#%09d'.

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the Class Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Return value:

#number:

The Event processing Priority.

This is the worker method to retrieve the Parent class.

Note that the Parent class must be passed to call the parent class method.

self:GetParent(self):ParentMethod()


Defined in:

Parameters:

#BASE Child

This is the Child class from which the Parent class needs to be retrieved.

#BASE FromClass

(Optional) The class from which to get the parent.

Return value:

Get a Value given a Key from the Object.

Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

The key that is used to retrieve the value. Note that the key can be a #string, but it can also be any other type!

Return value:

The Value retrieved or nil if the Key was not found and thus the Value could not be retrieved.

Subscribe to a DCS Event.

Defined in:

Parameters:

#function EventFunction

(optional) The function to be called when the event occurs for the unit.

Return value:

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

This is the worker method to inherit from a parent class.

Defined in:

Parameters:

Child

is the Child class that inherits.

#BASE Parent

is the Parent class that the Child inherits from.

Return value:

Child

This is the worker method to check if an object is an (sub)instance of a class.

Examples:

  • ZONE:New( 'some zone' ):IsInstanceOf( ZONE ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'ZONE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'zone' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'BASE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'GROUP' ) will return false

Defined in:

Parameter:

ClassName

is the name of the class or the class itself to run the check against

Return value:

#boolean:

Enquires if tracing is on (for the class).

Defined in:

Return value:

#boolean:

BASE constructor.

This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.

function EVENT:New()
  local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
  return self
end
  

Defined in:

Return value:

Occurs when an object is completely destroyed.

initiator : The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Occurs when a ground unit captures either an airbase or a farp.

initiator : The unit that captured the base place: The airbase that was captured, can be a FARP or Airbase. When calling place:getCoalition() the faction will already be the new owning faction.

Defined in:

Parameter:

The EventData structure.

Occurs when any object is spawned into the mission.

initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft crashes into the ground and is completely destroyed.

initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

Unknown precisely what creates this event, likely tied into newer damage model.

Will update this page when new information become available.

  • initiator: The unit that had the failure.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.

Defined in:

Parameter:

The EventData structure.

Occurs when any system fails on a human controlled aircraft.

initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs on the death of a unit.

Contains more and different information. Similar to unit_lost it will occur for aircraft before the aircraft crash event occurs.

  • initiator: The unit that killed the target
  • target: Target Object
  • weapon: Weapon Object

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

Event does not occur if the pilot lands in the water and sub combs to Davey Jones Locker.

  • initiator: Static object representing the ejected pilot. Place : Aircraft that the pilot ejected from.
  • place: may not return as a valid object if the aircraft has crashed into the ground and no longer exists.
  • subplace: is always 0 for unknown reasons.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts

Defined in:

Parameter:

The EventData structure.

Occurs when the pilot of an aircraft is killed.

Can occur either if the player is alive and crashes or if a weapon kills the pilot without completely destroying the plane. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player relieves control of a unit to the AI.

initiator : The unit that the player left.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft connects with a tanker and begins taking on fuel.

initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

There is no information on what values the score was changed to. Event is likely similar to player_comment in this regard.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. initiator : The unit that was doing the shooting.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit begins firing a weapon that has a high rate of fire.

Most common with aircraft cannons (GAU-8), autocannons, and machine guns. initiator : The unit that is doing the shooting. target: The unit that is being targeted.

Defined in:

Parameter:

The EventData structure.

Occurs whenever any unit in a mission fires a weapon.

But not any machine gun or autocannon based weapon, those are handled by EVENT.ShootingStart.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft takes off from an airbase, farp, or ship.

initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

  • initiator: The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Schedule a new time event.

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

#table ...

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#number:

The ScheduleID of the planned schedule.

Schedule a new time event.

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

#number Repeat

Specifies the interval in seconds when the scheduler will call the event function.

#number RandomizeFactor

Specifies a randomization factor between 0 and 1 to randomize the Repeat.

#number Stop

Specifies the amount of seconds when the scheduler will be stopped.

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

#table ...

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#number:

The ScheduleID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

Set the Class Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Parameter:

#number EventPriority

The Event processing Priority.

Return value:

self

Set a state or property of the Object given a Key and a Value.

Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that will hold the Value set by the Key.

Key

The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

true = trace all methods in MOOSE.

Set tracing for a class

Defined in:

Parameter:

#string Class

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

#string Method

Set trace level

Defined in:

Parameter:

#number Level

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.

So tracing must be switched on manually in your mission if you are using Moose statically. When moose is loading dynamically (for moose class development), tracing is switched on by default.

Defined in:

Parameter:

#boolean TraceOnOff

Switch the tracing on or off.

Usage:

-- Switch the tracing On
BASE:TraceOnOff( true )

-- Switch the tracing Off
BASE:TraceOnOff( false )

UnSubscribe to a DCS event.

Defined in:

Parameter:

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

TODO: Complete DCS#Event structure.
- The main event handling function... This function captures all events generated for the class. @param #BASE self @param DCS#Event event

Defined in:

Parameter:

event

Patrol data.

Field(s)

#number AIRWING.PatrolData.altitude

Altitude in feet.

#number AIRWING.PatrolData.heading

Heading in degrees.

#number AIRWING.PatrolData.leg

Leg length in NM.

#number AIRWING.PatrolData.noccupied

Number of flights on this patrol point.

#number AIRWING.PatrolData.speed

Speed in knots.

#string AIRWING.PatrolData.type

Type name.

Function(s)

Payload data.

Field(s)

#string AIRWING.Payload.aircrafttype

Type of aircraft, which can use this payload.

#table AIRWING.Payload.capabilities

Mission types and performances for which this payload can be used.

#number AIRWING.Payload.navail

Number of available payloads of this type.

#table AIRWING.Payload.pylons

Pylon data extracted for the unit template.

#string AIRWING.Payload.unitname

Name of the unit this pylon was extracted from.

#boolean AIRWING.Payload.unlimited

If true, this payload is unlimited and does not get consumed.

Function(s)