Banner Image

Module Ops.Brigade

Ops - Brigade Warehouse.

Main Features:

  • Manage platoons
  • Carry out ARTY and PATROLZONE missions (AUFTRAG)
  • Define rearming zones

Example Missions:

Demo missions can be found on github.


Author: funkyfranky


Global(s)

Global BRIGADE

I am not afraid of an Army of lions lead by a sheep; I am afraid of sheep lead by a lion -- Alexander the Great


The BRIGADE Concept

A BRIGADE consists of one or multiple PLATOONs.

#BRIGADE BRIGADE

I am not afraid of an Army of lions lead by a sheep; I am afraid of sheep lead by a lion -- Alexander the Great


The BRIGADE Concept

A BRIGADE consists of one or multiple PLATOONs.

These platoons "live" in a WAREHOUSE that has a phyiscal struction (STATIC or UNIT) and can be captured or destroyed.

Type(s)

Fields and Methods inherited from BRIGADE Description

BRIGADE:AddAssetToPlatoon(Platoon, Nassets)

Add asset group(s) to platoon.

BRIGADE:AddPlatoon(Platoon)

Add a platoon to the brigade.

BRIGADE:AddRearmingZone(RearmingZone)

Add a rearming zone.

BRIGADE:AddRefuellingZone(RefuellingZone)

Add a refuelling zone.

BRIGADE:AddRetreatZone(RetreatZone)

Add a retreat zone.

BRIGADE:ArmyOnMission(ArmyGroup, Mission)

Triggers the FSM event "ArmyOnMission".

BRIGADE.ClassName

Name of the class.

BRIGADE:GetPlatoon(PlatoonName)

Get platoon by name.

BRIGADE:GetPlatoonOfAsset(Asset)

Get platoon of an asset.

BRIGADE:GetRetreatZones()

Get retreat zones.

BRIGADE:LoadBackAssetInPosition(Templatename, Position)

[ GROUND ] Function to load back an asset in the field that has been filed before.

BRIGADE:New(WarehouseName, BrigadeName)

Create a new BRIGADE class object.

BRIGADE:OnAfterArmyOnMission(From, Event, To, ArmyGroup, Mission)

On after "ArmyOnMission" event.

BRIGADE:RemoveAssetFromPlatoon(Asset)

Remove asset from platoon.

BRIGADE:SetRetreatZones(RetreatZoneSet)

Define a set of retreat zones.

BRIGADE:Start()

Triggers the FSM event "Start".

BRIGADE:__ArmyOnMission(delay, ArmyGroup, Mission)

Triggers the FSM event "ArmyOnMission" after a delay.

BRIGADE:__Start(delay)

Triggers the FSM event "Start" after a delay.

BRIGADE:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

BRIGADE.lid

BRIGADE:onafterArmyOnMission(From, Event, To, ArmyGroup, Mission)

On after "ArmyOnMission".

BRIGADE:onafterStart(From, Event, To)

Start BRIGADE FSM.

BRIGADE:onafterStatus(From, Event, To)

Update status.

BRIGADE.rearmingZones

Rearming zones. Each element is of type #BRIGADE.SupplyZone.

BRIGADE.refuellingZones

Refuelling zones. Each element is of type #BRIGADE.SupplyZone.

BRIGADE.retreatZones

Retreat zone set.

BRIGADE.verbose

Verbosity of output.

BRIGADE.version

BRIGADE class version.

BRIGADE.warehouseOpsElement

BRIGADE.warehouseOpsGroup

Fields and Methods inherited from LEGION Description

BRIGADE:AddCohort(Cohort)

Add cohort to cohort table of this legion.

BRIGADE:AddMission(Mission)

Add a mission for the legion.

BRIGADE:AddOpsTransport(OpsTransport)

Add transport assignment to queue.

BRIGADE:AssignAssetsForEscort(Cohorts, Assets, NescortMin, NescortMax, MissionType, TargetTypes, EngageRange)

Recruit and assign assets performing an escort mission for a given asset list.

BRIGADE:AssignAssetsForTransport(Legions, CargoAssets, NcarriersMin, NcarriersMax, DeployZone, DisembarkZone, Categories, Attributes, Properties)

Recruit and assign assets performing an OPSTRANSPORT for a given asset list.

BRIGADE.CalculateAssetMissionScore(asset, MissionType, TargetVec2, IncludePayload, TotalWeight)

Calculate the mission score of an asset.

BRIGADE:CheckMissionQueue()

Check mission queue and assign ONE mission.

BRIGADE:CheckTransportQueue()

Check transport queue and assign ONE transport.

BRIGADE.ClassName

Name of the class.

BRIGADE:CountAssets(InStock, MissionTypes, Attributes)

Count total number of assets of the legion.

BRIGADE:CountAssetsOnMission(MissionTypes, Cohort)

Count assets on mission.

BRIGADE:CountAssetsWithPayloadsInStock(Payloads, MissionTypes, Attributes)

Count total number of assets in LEGION warehouse stock that also have a payload.

BRIGADE:CountMissionsInQueue(MissionTypes)

Count missions in mission queue.

BRIGADE:CountPayloadsInStock(MissionTypes, UnitTypes, Payloads)

Count payloads in stock.

BRIGADE:DelCohort(Cohort)

Remove cohort from cohor table of this legion.

BRIGADE:FetchPayloadFromStock(UnitType, MissionType, Payloads)

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

BRIGADE:GetAircraftTypes(onlyactive, cohorts)

Get the unit types of this legion.

BRIGADE:GetAssetCurrentMission(asset)

Get the current mission of the asset.

BRIGADE:GetAssetsOnMission(MissionTypes)

Get assets on mission.

BRIGADE:GetMissionByID(mid)

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

BRIGADE:GetMissionFromRequest(Request)

Returns the mission for a given request.

BRIGADE:GetMissionFromRequestID(RequestID)

Returns the mission for a given request ID.

BRIGADE:GetName()

Get name of legion.

BRIGADE:GetOpsGroups(MissionTypes, Attributes)

Get OPSGROUPs that are spawned and alive.

BRIGADE:GetTransportByID(uid)

Returns the mission for a given ID.

BRIGADE:IsAirwing()

Check if the AIRWING class is calling.

BRIGADE:IsAssetOnMission(asset, MissionTypes)

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

BRIGADE:IsBrigade()

Check if a BRIGADE class is calling.

BRIGADE:IsCohort(CohortName)

Check if cohort is part of this legion.

BRIGADE:IsFleet()

Check if the FLEET class is calling.

BRIGADE:LegionAssetReturned(Cohort, Asset)

Triggers the FSM event "LegionAssetReturned".

BRIGADE:MissionAssign(Mission, Legions)

Triggers the FSM event "MissionAssign".

BRIGADE:MissionCancel(Mission)

Triggers the FSM event "MissionCancel".

BRIGADE:MissionRequest(Mission, Assets)

Triggers the FSM event "MissionRequest".

BRIGADE:New(WarehouseName, LegionName)

Create a new LEGION class object.

BRIGADE:OnAfterLegionAssetReturned(From, Event, To, Cohort, Asset)

On after "LegionAssetReturned" event.

BRIGADE:OnAfterMissionAssign(From, Event, To, Mission, Legions)

On after "MissionAssign" event.

BRIGADE:OnAfterMissionCancel(From, Event, To, Mission)

On after "MissionCancel" event.

BRIGADE:OnAfterMissionRequest(From, Event, To, Mission, Assets)

On after "MissionRequest" event.

BRIGADE:OnAfterOpsOnMission(From, Event, To, OpsGroup, Mission)

On after "OpsOnMission" event.

BRIGADE:OnAfterTransportAssign(From, Event, To, Transport, Legions)

On after "TransportAssign" event.

BRIGADE:OnAfterTransportCancel(From, Event, To, Transport)

On after "TransportCancel" event.

BRIGADE:OnAfterTransportRequest(From, Event, To, Transport)

On after "TransportRequest" event.

BRIGADE:OpsOnMission(OpsGroup, Mission)

Triggers the FSM event "OpsOnMission".

BRIGADE.RandomAssetScore

Random score that is added to the asset score in the selection process.

BRIGADE:RecruitAssetsForEscort(Mission, Assets)

Recruit assets performing an escort mission for a given asset.

BRIGADE:RecruitAssetsForMission(Mission)

Recruit assets for a given mission.

BRIGADE:RecruitAssetsForTransport(Transport)

Recruit assets for a given OPS transport.

BRIGADE.RecruitCohortAssets(Cohorts, MissionTypeRecruit, MissionTypeOpt, NreqMin, NreqMax, TargetVec2, Payloads, RangeMax, RefuelSystem, CargoWeight, TotalWeight, MaxWeight, Categories, Attributes, Properties, WeaponTypes)

Recruit assets from Cohorts for the given parameters.

BRIGADE:RelocateCohort(Cohort, Legion, Delay, NcarriersMin, NcarriersMax, TransportLegions)

Relocate a cohort to another legion.

BRIGADE:RemoveMission(Mission)

Remove mission from queue.

BRIGADE:ReturnPayloadFromAsset(asset)

Return payload from asset back to stock.

BRIGADE:SetTacticalOverviewOn()

Set tactical overview on.

BRIGADE:SetVerbosity(VerbosityLevel)

Set verbosity level.

BRIGADE:Start()

Triggers the FSM event "Start".

BRIGADE:TransportAssign(Transport, Legions)

Triggers the FSM event "TransportAssign".

BRIGADE:TransportCancel(Transport)

Triggers the FSM event "TransportCancel".

BRIGADE:TransportRequest(Transport)

Triggers the FSM event "TransportRequest".

BRIGADE.UnRecruitAssets(Assets, Mission)

Unrecruit assets.

BRIGADE:_AddRequest(AssetDescriptor, AssetDescriptorValue, nAsset, Prio, Assignment)

Create a request and add it to the warehouse queue.

BRIGADE._CohortCan(Cohort, MissionType, Categories, Attributes, Properties, WeaponTypes, TargetVec2, RangeMax, RefuelSystem, CargoWeight, MaxWeight)

Recruit assets from Cohorts for the given parameters.

BRIGADE:_CountPayloads(MissionType, Cohorts, Payloads)

Count payloads of all cohorts for all unit types.

BRIGADE:_CreateFlightGroup(asset)

Create a new OPS group after an asset was spawned.

BRIGADE:_GetCohort(CohortName)

Get cohort by name.

BRIGADE:_GetCohortOfAsset(Asset)

Get cohort of an asset.

BRIGADE._GetCohorts(Legions, Cohorts, Operation, OpsQueue)

Get cohorts.

BRIGADE._OptimizeAssetSelection(assets, MissionType, TargetVec2, IncludePayload, TotalWeight)

Optimize chosen assets for the mission at hand.

BRIGADE:_TacticalOverview()

Display tactical overview.

BRIGADE:__LegionAssetReturned(delay, Cohort, Asset)

Triggers the FSM event "LegionAssetReturned" after a delay.

BRIGADE:__MissionAssign(delay, Mission, Legions)

Triggers the FSM event "MissionAssign" after a delay.

BRIGADE:__MissionCancel(delay, Mission)

Triggers the FSM event "MissionCancel" after a delay.

BRIGADE:__MissionRequest(delay, Mission, Assets)

Triggers the FSM event "MissionRequest" after a delay.

BRIGADE:__OpsOnMission(delay, OpsGroup, Mission)

Triggers the FSM event "OpsOnMission" after a delay.

BRIGADE:__Start(delay)

Triggers the FSM event "Start" after a delay.

BRIGADE:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

BRIGADE:__TransportAssign(delay, Transport, Legions)

Triggers the FSM event "TransportAssign" after a delay.

BRIGADE:__TransportCancel(delay, Transport)

Triggers the FSM event "TransportCancel" after a delay.

BRIGADE:__TransportRequest(delay, Transport)

Triggers the FSM event "TransportRequest" after a delay.

BRIGADE.chief

Chief of this legion.

BRIGADE.cohorts

Cohorts of this legion.

BRIGADE.commander

Commander of this legion.

BRIGADE.homebase

BRIGADE.homezone

BRIGADE.lid

Class id string for output to DCS log file.

BRIGADE.missionqueue

Mission queue table.

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

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

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

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

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

On after "Captured" event.

BRIGADE:onafterDestroyed(From, Event, To)

On after "Destroyed" event.

BRIGADE:onafterLegionAssetReturned(From, Event, To, Cohort, Asset)

On after "LegionAssetReturned" event.

BRIGADE:onafterMissionAssign(From, Event, To, Mission, Legions)

On after "MissionAssign" event.

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

On after "MissionCancel" event.

BRIGADE:onafterMissionRequest(From, Event, To, Mission, Assets)

On after "MissionRequest" event.

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

On after "NewAsset" event.

BRIGADE:onafterOpsOnMission(From, Event, To, OpsGroup, Mission)

On after "OpsOnMission".

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

On after "Request" event.

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

On after "RequestSpawned" event.

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

On after "SelfRequest" event.

BRIGADE:onafterStart(From, Event, To)

Start LEGION FSM.

BRIGADE:onafterTransportAssign(From, Event, To, Transport, Legions)

On after "TransportAssign" event.

BRIGADE:onafterTransportCancel(From, Event, To, Transport)

On after "TransportCancel" event.

BRIGADE:onafterTransportRequest(From, Event, To, Opstransport, OpsTransport)

On after "TransportRequest" event.

BRIGADE.queueid

BRIGADE.tacview

If true, show tactical overview on status update.

BRIGADE.transportqueue

Transport queue.

BRIGADE.verbose

Verbosity of output.

BRIGADE.version

LEGION class version.

Fields and Methods inherited from WAREHOUSE Description

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

Trigger the FSM event "AddAsset".

BRIGADE:AddOffRoadPath(remotewarehouse, group, oneway)

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

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

Triggers the FSM event "AddRequest".

BRIGADE:AddShippingLane(remotewarehouse, group, oneway)

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

BRIGADE:AirbaseCaptured(Coalition)

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

BRIGADE:AirbaseRecaptured(Coalition)

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

BRIGADE:Arrived(group)

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

BRIGADE:AssetDead(asset, request)

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

BRIGADE:AssetLowFuel(asset, request)

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

BRIGADE:AssetSpawned(group, asset, request)

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

BRIGADE:Attacked(Coalition, Country)

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

BRIGADE.Attribute

BRIGADE:Captured(Coalition, Country)

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

BRIGADE:ChangeCountry(Country)

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

BRIGADE.ClassName

Name of the class.

BRIGADE.Debug

If true, send debug messages to all.

BRIGADE:Defeated()

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

BRIGADE:Delivered(request)

Triggers the FSM event "Delivered".

BRIGADE.Descriptor

BRIGADE:Destroyed()

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

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

Filter stock assets by descriptor and attribute.

BRIGADE:FindAssetInDB(group)

Find an asset in the the global warehouse data base.

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

Find nearest warehouse in service, i.e.

BRIGADE:FindWarehouseInDB(uid)

Find a warehouse in the global warehouse data base.

BRIGADE:GetAirbase()

Get airbase associated to the warehouse.

BRIGADE:GetAirbaseCategory()

Get category of airbase associated to the warehouse.

BRIGADE:GetAirbaseName()

Get name airbase associated to the warehouse.

BRIGADE:GetAssetByID(id)

Get a warehouse asset from its unique id.

BRIGADE:GetAssetByName(GroupName)

Get a warehouse asset from its name.

BRIGADE:GetAssignment(request)

Get assignment of a request.

BRIGADE:GetCoalition()

Get coalition side of warehouse static.

BRIGADE:GetCoalitionName()

Get coalition name of warehouse static.

BRIGADE:GetCoordinate()

Get coordinate of warehouse static.

BRIGADE:GetCountry()

Get country id of warehouse static.

BRIGADE:GetCountryName()

Get country name of warehouse static.

BRIGADE:GetNumberOfAssets(Descriptor, DescriptorValue, OnlyMobile)

Get number of assets in warehouse stock.

BRIGADE:GetRequestByID(id)

Get a warehouse request from its unique id.

BRIGADE:GetRunwayRepairtime()

Check if runway is operational.

BRIGADE:GetSpawnZone()

Get the spawn zone.

BRIGADE:GetStockInfo(stock)

Returns the number of assets for each generalized attribute.

BRIGADE:GetVec2()

Get 2D vector of warehouse static.

BRIGADE:GetVec3()

Get 3D vector of warehouse static.

BRIGADE:GetWarehouseZone()

Get the warehouse zone.

BRIGADE:HasConnectionNaval(warehouse, markpath, smokepath)

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

BRIGADE:HasConnectionOffRoad(warehouse, markpath, smokepath)

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

BRIGADE:HasConnectionRail(warehouse, markpath, smokepath)

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

BRIGADE:HasConnectionRoad(warehouse, markpath, smokepath)

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

BRIGADE:IsAttacked()

Check if the warehouse is under attack by another coalition.

BRIGADE:IsDestroyed()

Check if the warehouse has been destroyed.

BRIGADE:IsLoaded()

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

BRIGADE:IsNotReadyYet()

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

BRIGADE:IsPaused()

Check if the warehouse is paused.

BRIGADE:IsRunning()

Check if the warehouse is running.

BRIGADE:IsRunwayOperational()

Check if runway is operational.

BRIGADE:IsShip()

Check if warehouse physical representation is a ship.

BRIGADE:IsStatic()

Check if warehouse physical representation is a static (not a unit) object.

BRIGADE:IsStopped()

Check if the warehouse is stopped.

BRIGADE:IsUnit()

Check if warehouse physical representation is a unit (not a static) object.

BRIGADE:Load(path, filename)

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

BRIGADE:New(warehouse, alias)

The WAREHOUSE constructor.

BRIGADE:NewAsset(asset, assignment)

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

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

On after "AirbaseCaptured" even user function.

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

On after "AirbaseRecaptured" event user function.

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

On after "Arrived" event user function.

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

On after "AssetDead" event user function.

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

On after "AssetLowFuel" event user function.

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

On after "AssetSpawned" event user function.

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

On after "Attacked" event user function.

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

On after "Captured" event user function.

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

On after "ChangeCountry" event user function.

BRIGADE:OnAfterDefeate(From, Event, To)

On after "Defeated" event user function.

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

On after "Delivered" event user function.

BRIGADE:OnAfterDestroyed(From, Event, To)

On after "Destroyed" event user function.

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

On after "Load" event user function.

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

On after "NewAsset" event user function.

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

On after "Request" user function.

BRIGADE:OnAfterRespawn(From, Event, To)

On after "Respawn" event user function.

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

On after "Save" event user function.

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

On after "SelfRequest" event.

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

On before "Request" user function.

BRIGADE:Pause()

Triggers the FSM event "Pause".

BRIGADE.Quantity

BRIGADE.Report

If true, send status messages to coalition.

BRIGADE:Request(Request)

Triggers the FSM event "Request".

BRIGADE:Respawn()

Triggers the FSM event "Respawn".

BRIGADE:Restart()

Triggers the FSM event "Restart".

BRIGADE:Save(path, filename)

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

BRIGADE:SelfRequest(groupset, request)

Triggers the FSM event "SelfRequest".

BRIGADE:SetAirbase(airbase)

Set the airbase belonging to this warehouse.

BRIGADE:SetAllowSpawnOnClientParking()

Set wether client parking spots can be used for spawning.

BRIGADE:SetAutoDefenceOff()

Set auto defence off.

BRIGADE:SetAutoDefenceOn()

Set auto defence on.

BRIGADE:SetDebugOff()

Set debug mode off.

BRIGADE:SetDebugOn()

Set debug mode on.

BRIGADE:SetHarborZone(zone)

Add a Harbor Zone for this warehouse where naval cargo units will spawn and be received.

BRIGADE:SetLowFuelThreshold(threshold)

Set low fuel threshold.

BRIGADE:SetMarker(switch)

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

BRIGADE:SetParkingIDs(ParkingIDs)

Set valid parking spot IDs.

BRIGADE:SetPortZone(zone)

Set the port zone for this warehouse.

BRIGADE:SetRailConnection(coordinate)

Set the connection of the warehouse to the railroad.

BRIGADE:SetReportOff()

Set report off.

BRIGADE:SetReportOn()

Set report on.

BRIGADE:SetRespawnAfterDestroyed(delay)

Set respawn after destroy.

BRIGADE:SetRoadConnection(coordinate)

Set the connection of the warehouse to the road.

BRIGADE:SetRunwayRepairtime(RepairTime)

Set the time until the runway(s) of an airdrome are repaired after it has been destroyed.

BRIGADE:SetSafeParkingOff()

Disable safe parking option.

BRIGADE:SetSafeParkingOn()

Enable safe parking option, i.e.

BRIGADE:SetSaveOnMissionEnd(path, filename)

Enable auto save of warehouse assets at mission end event.

BRIGADE:SetSpawnZone(zone, maxdist)

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

BRIGADE:SetStatusUpdate(timeinterval)

Set interval of status updates.

BRIGADE:SetVerbosityLevel(VerbosityLevel)

Set verbosity level.

BRIGADE:SetWarehouseZone(zone)

Set a warehouse zone.

BRIGADE:Start()

Triggers the FSM event "Start".

BRIGADE:Status()

Triggers the FSM event "Status".

BRIGADE:Stop()

Triggers the FSM event "Stop".

BRIGADE.TransportType

BRIGADE:UnPause()

Triggers the FSM event "Unpause".

BRIGADE:_Arrived(group)

Task function for last waypoint.

BRIGADE:_AssetItemInfo(asset)

Asset item characteristics.

BRIGADE:_CheckAirbaseOwner()

Checks if the associated airbase still belongs to the warehouse.

BRIGADE:_CheckAssetStatus()

Function that checks if an asset group is still okay.

BRIGADE:_CheckConquered()

Checks if the warehouse zone was conquered by antoher coalition.

BRIGADE:_CheckFuel()

Checks fuel on all pening assets.

BRIGADE:_CheckParkingAsset(spot, asset)

Check parking ID for an asset.

BRIGADE:_CheckParkingValid(spot)

Check parking ID.

BRIGADE:_CheckQueue()

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

BRIGADE:_CheckRequestConsistancy(queue)

Checks if the request can be fulfilled in general.

BRIGADE:_CheckRequestNow(request)

Checks if the request can be fulfilled right now.

BRIGADE:_CheckRequestValid(request)

Check if a request is valid in general.

BRIGADE:_DebugMessage(text, duration)

Debug message.

BRIGADE:_DeleteQueueItem(qitem, queue)

Delete item from queue.

BRIGADE:_DeleteQueueItemByID(qitemID, queue)

Delete item from queue.

BRIGADE:_DeleteStockItem(stockitem)

Delete an asset item from stock.

BRIGADE:_DisplayStatus()

Display status of warehouse.

BRIGADE:_DisplayStockItems(stock)

Display stock items of warehouse.

BRIGADE:_ErrorMessage(text, duration)

Error message.

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

Filter stock assets by table entry.

BRIGADE:_FindParkingForAssets(airbase, assets)

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

BRIGADE:_Fireworks(coord)

Fireworks!

BRIGADE:_GetAttribute(group)

Get the generalized attribute of a group.

BRIGADE:_GetFlightplan(asset, departure, destination)

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

BRIGADE:_GetIDsFromGroup(group)

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

BRIGADE:_GetIDsFromGroupName(groupname)

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

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

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

BRIGADE:_GetNameWithOut(group)

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

BRIGADE:_GetObjectSize(DCSobject)

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

BRIGADE:_GetRequestOfGroup(group, queue)

Get the request belonging to a group.

BRIGADE:_GetStockAssetsText(messagetoall)

Get text about warehouse stock.

BRIGADE:_GetTerminal(_attribute, _category)

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

BRIGADE:_GetTransportsForAssets(Chosen, request)

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

BRIGADE:_GroupIsTransport(group, request)

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

BRIGADE:_HasAttribute(group, attribute)

Check if a group has a generalized attribute.

BRIGADE:_InfoMessage(text, duration)

Info Message.

BRIGADE:_JobDone()

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

BRIGADE:_NewLane(group, startcoord, finalcoord)

Create a new path from a template group.

BRIGADE:_OnEventArrived(EventData)

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

BRIGADE:_OnEventBaseCaptured(EventData)

Warehouse event handling function.

BRIGADE:_OnEventBirth(EventData)

Warehouse event function, handling the birth of a unit.

BRIGADE:_OnEventCrashOrDead(EventData)

Warehouse event handling function.

BRIGADE:_OnEventEngineShutdown(EventData)

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

BRIGADE:_OnEventEngineStartup(EventData)

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

BRIGADE:_OnEventLanding(EventData)

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

BRIGADE:_OnEventMissionEnd(EventData)

Warehouse event handling function.

BRIGADE:_OnEventTakeOff(EventData)

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

BRIGADE:_PassingWaypoint(group, n, N)

Task function for when passing a waypoint.

BRIGADE:_PrintQueue(queue, name)

Prints the queue to DCS.log file.

BRIGADE:_QuantityRel2Abs(relative, ntot)

Relative to absolute quantity.

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

Register new asset in globase warehouse data base.

BRIGADE:_RouteAir(aircraft)

Route the airplane from one airbase another.

BRIGADE:_RouteGround(group, request)

Route ground units to destination.

BRIGADE:_RouteNaval(group, request)

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

BRIGADE:_RouteTrain(Group, Coordinate, Speed)

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

BRIGADE:_SimpleTaskFunction(Function, group)

Simple task function.

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

Simple task function.

BRIGADE:_SortQueue()

Sort requests queue wrt prio and request uid.

BRIGADE:_SpawnAssetAircraft(alias, asset, request, parking, uncontrolled, lateactivated)

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

BRIGADE:_SpawnAssetGroundNaval(alias, asset, request, spawnzone, lateactivated)

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

BRIGADE:_SpawnAssetPrepareTemplate(asset, alias)

Prepare a spawn template for the asset.

BRIGADE:_SpawnAssetRequest(Request)

Spawns requested assets at warehouse or associated airbase.

BRIGADE:_UnitDead(deadunit, deadgroup, request)

A unit of a group just died.

BRIGADE:_UpdateWarehouseMarkText()

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

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

Trigger the FSM event "AddAsset" with a delay.

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

Triggers the FSM event "AddRequest" with a delay.

BRIGADE:__AirbaseCaptured(delay, Coalition)

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

BRIGADE:__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.

BRIGADE:__Arrived(delay, group)

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

BRIGADE:__AssetDead(delay, asset, request)

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

BRIGADE:__AssetLowFuel(delay, asset, request)

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

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

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

BRIGADE:__Attacked(delay, Coalition, Country)

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

BRIGADE:__Captured(delay, Coalition, Country)

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

BRIGADE:__ChangeCountry(delay, Country)

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

BRIGADE:__Defeated(delay)

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

BRIGADE:__Delivered(delay, request)

Triggers the FSM event "Delivered" after a delay.

BRIGADE:__Destroyed(delay)

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

BRIGADE:__Load(delay, path, filename)

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

BRIGADE:__NewAsset(delay, asset, assignment)

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

BRIGADE:__Pause(delay)

Triggers the FSM event "Pause" after a delay.

BRIGADE:__Request(Delay, Request)

Triggers the FSM event "Request" after a delay.

BRIGADE:__Respawn(delay)

Triggers the FSM event "Respawn" after a delay.

BRIGADE:__Restart(delay)

Triggers the FSM event "Restart" after a delay.

BRIGADE:__Save(delay, path, filename)

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

BRIGADE:__SelfRequest(delay, groupset, request)

Triggers the FSM event "SelfRequest" with a delay.

BRIGADE:__Start(delay)

Triggers the FSM event "Start" after a delay.

BRIGADE:__Status(delay)

Triggers the FSM event "Status" after a delay.

BRIGADE:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

BRIGADE:__Unpause(delay)

Triggers the FSM event "Unpause" after a delay.

BRIGADE.airbase

Airbase the warehouse belongs to.

BRIGADE.airbasename

Name of the airbase associated to the warehouse.

BRIGADE.alias

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

BRIGADE.allowSpawnOnClientSpots

BRIGADE.autodefence

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

BRIGADE.autosave

Automatically save assets to file when mission ends.

BRIGADE.autosavefile

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

BRIGADE.autosavepath

Path where the asset file is saved on auto save.

BRIGADE.clientcoords

BRIGADE.coalition

BRIGADE.countryid

BRIGADE.dTstatus

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

BRIGADE.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.

BRIGADE.delivered

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

BRIGADE.flightcontrol

Flight control of this warehouse.

BRIGADE.harborzone

BRIGADE.isShip

If true, warehouse is represented by a ship unit.

BRIGADE.isUnit

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

BRIGADE.lid

BRIGADE.lowfuelthresh

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

BRIGADE.markerOn

If true, markers are displayed on the F10 map.

BRIGADE.markerRail

Rail road connection.

BRIGADE.markerRoad

Road connection.

BRIGADE.markerWarehouse

Marker warehouse.

BRIGADE.markerid

ID of the warehouse marker at the airbase.

BRIGADE.markrail

BRIGADE.markroad

BRIGADE.offroadpaths

Table holding user defined paths from one warehouse to another.

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

On after "AddAsset" event.

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

On after "AddRequest" event.

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

On after "AirbaseCaptured" event.

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

On after "AirbaseRecaptured" event.

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

On after "Arrived" event.

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

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

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

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

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

On after "Attacked" event.

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

On after "Captured" event.

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

On after "ChangeCountry" event.

BRIGADE:onafterDefeated(From, Event, To)

On after "Defeated" event.

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

On after "Delivered" event.

BRIGADE:onafterDestroyed(From, Event, To)

On after "Destroyed" event.

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

On after "Load" event.

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

On after "NewAsset" event.

BRIGADE:onafterPause(From, Event, To)

On after "Pause" event.

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

On after "Request" event.

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

On after "RequestSpawned" event.

BRIGADE:onafterRespawn(From, Event, To)

Respawn warehouse.

BRIGADE:onafterRestart(From, Event, To)

On after "Restart" event.

BRIGADE:onafterRunwayDestroyed(From, Event, To)

On after "RunwayDestroyed" event.

BRIGADE:onafterRunwayRepaired(From, Event, To)

On after "RunwayRepaired" event.

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

On after "Save" event.

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

On after "SelfRequest" event.

BRIGADE:onafterStart(From, Event, To)

On after Start event.

BRIGADE:onafterStatus(From, Event, To)

On after Status event.

BRIGADE:onafterStop(From, Event, To)

On after "Stop" event.

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

On after "Unloaded" event.

BRIGADE:onafterUnpause(From, Event, To)

On after "Unpause" event.

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

On before "AddRequest" event.

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

On before "Arrived" event.

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

On before "Captured" event.

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

On before "ChangeCountry" event.

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

On before "Load" event.

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

On before "Request" event.

BRIGADE.parkingIDs

BRIGADE.pending

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

BRIGADE.portzone

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

BRIGADE.queue

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

BRIGADE.queueid

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

BRIGADE.rail

Closest point to warehouse on rail.

BRIGADE.respawnafterdestroyed

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

BRIGADE.respawndelay

Delay before respawn in seconds.

BRIGADE.road

Closest point to warehouse on road.

BRIGADE.runwaydestroyed

Time stamp timer.getAbsTime() when the runway was destroyed.

BRIGADE.runwayrepairtime

Time in seconds until runway will be repaired after it was destroyed. Default is 3600 sec (one hour).

BRIGADE.safeparking

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

BRIGADE.shippinglanes

Table holding the user defined shipping between warehouses.

BRIGADE.spawnzone

Zone in which assets are spawned.

BRIGADE.spawnzonemaxdist

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

BRIGADE.stock

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

BRIGADE.transporting

Table holding assets currently transporting cargo assets.

BRIGADE.uid

Unique ID of the warehouse.

BRIGADE.verbosity

Verbosity level.

BRIGADE.version

Warehouse class version.

BRIGADE.warehouse

The phyical warehouse structure.

BRIGADE.wid

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

BRIGADE.zone

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

Fields and Methods inherited from FSM Description

BRIGADE:AddEndState(State)

Adds an End state.

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

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

BRIGADE:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

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

Adds a score for the FSM_PROCESS to be achieved.

BRIGADE:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

BRIGADE.CallScheduler

BRIGADE.Events

BRIGADE:GetCurrentState()

Get current state.

BRIGADE:GetEndStates()

Returns the End states.

BRIGADE:GetProcess(From, Event)

BRIGADE:GetProcesses()

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

BRIGADE:GetScores()

Returns a table with the scores defined.

BRIGADE:GetStartState()

Returns the start state of the FSM.

BRIGADE:GetState()

Get current state.

BRIGADE:GetSubs()

Returns a table with the Subs defined.

BRIGADE:GetTransitions()

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

BRIGADE:Is(State)

Check if FSM is in state.

BRIGADE:LoadCallBacks(CallBackTable)

Load call backs.

BRIGADE:New()

Creates a new FSM object.

BRIGADE.Scores

BRIGADE:SetProcess(From, Event, Fsm)

BRIGADE:SetStartState(State)

Sets the start state of the FSM.

BRIGADE._EndStates

BRIGADE._EventSchedules

BRIGADE._Processes

BRIGADE._Scores

BRIGADE._StartState

BRIGADE._Transitions

BRIGADE:_add_to_map(Map, Event)

Add to map.

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

Call handler.

BRIGADE:_create_transition(EventName)

Create transition.

BRIGADE:_delayed_transition(EventName)

Delayed transition.

BRIGADE:_eventmap(Events, EventStructure)

Event map.

BRIGADE:_gosub(ParentFrom, ParentEvent)

Go sub.

BRIGADE:_handler(EventName, ...)

Handler.

BRIGADE:_isendstate(Current)

Is end state.

BRIGADE:_submap(subs, sub, name)

Sub maps.

BRIGADE:can(e)

Check if can do an event.

BRIGADE:cannot(e)

Check if cannot do an event.

BRIGADE.current

BRIGADE.endstates

BRIGADE:is(State, state)

Check if FSM is in state.

BRIGADE.options

BRIGADE.subs

Fields and Methods inherited from BRIGADE.SupplyZone Description

BRIGADE.SupplyZone.marker

F10 marker.

BRIGADE.SupplyZone.markerOn

If true, marker is on.

BRIGADE.SupplyZone.mission

Mission assigned to supply ammo or fuel.

BRIGADE.SupplyZone.zone

The zone.

BRIGADE class.

Field(s)

#string BRIGADE.ClassName

Name of the class.

BRIGADE.lid

Set some string id for output to DCS.log file.

#table BRIGADE.rearmingZones

Rearming zones. Each element is of type #BRIGADE.SupplyZone.

#table BRIGADE.refuellingZones

Refuelling zones. Each element is of type #BRIGADE.SupplyZone.

#number BRIGADE.verbose

Verbosity of output.

#string BRIGADE.version

BRIGADE class version.

Function(s)

Add asset group(s) to platoon.

Defined in:

BRIGADE

Parameters:

The platoon object.

#number Nassets

Number of asset groups to add.

Return value:

self

Add a platoon to the brigade.

Defined in:

BRIGADE

Parameter:

The platoon object.

Return value:

self

Add a rearming zone.

Defined in:

BRIGADE

Parameter:

Core.Zone#ZONE RearmingZone

Rearming zone.

Return value:

The rearming zone data.

Add a refuelling zone.

Defined in:

BRIGADE

Parameter:

Core.Zone#ZONE RefuellingZone

Refuelling zone.

Return value:

The refuelling zone data.

Add a retreat zone.

Defined in:

BRIGADE

Parameter:

Core.Zone#ZONE RetreatZone

Retreat zone.

Return value:

self

Triggers the FSM event "ArmyOnMission".

Defined in:

BRIGADE

Parameters:

The ARMYGROUP on mission.

The mission.

Get platoon by name.

Defined in:

BRIGADE

Parameter:

#string PlatoonName

Name of the platoon.

Return value:

The Platoon object.

Get platoon of an asset.

Defined in:

BRIGADE

Parameter:

The platoon asset.

Return value:

The platoon object.

Get retreat zones.

Defined in:

BRIGADE

Return value:

Set of retreat zones.

[ GROUND ] Function to load back an asset in the field that has been filed before.

Defined in:

BRIGADE

Parameters:

#string Templatename

e.g."1 PzDv LogRg I_AID-976" - that's the alias (name) of an platoon spawned as "platoon - alias"_AID-"asset-ID"

where to spawn the platoon

Return value:

self

Usage:

Prerequisites:
Save the assets spawned by BRIGADE/CHIEF regularly (~every 5 mins) into a file, e.g. like this: 
  
             local Path = FilePath or "C:\\Users\\<yourname>\\Saved Games\\DCS\\Missions\\" -- example path
             local BlueOpsFilename = BlueFileName or "ExamplePlatoonSave.csv" -- example filename 
             local BlueSaveOps = SET_OPSGROUP:New():FilterCoalitions("blue"):FilterCategoryGround():FilterOnce()
             UTILS.SaveSetOfOpsGroups(BlueSaveOps,Path,BlueOpsFilename)
         
where Path and Filename are strings, as chosen by you.
You can then load back the assets at the start of your next mission run. Be aware that it takes a couple of seconds for the 
platoon data to arrive in brigade, so make this an action after ~20 seconds, e.g. like so:

           function LoadBackAssets()
             local Path = FilePath or "C:\\Users\\<yourname>\\Saved Games\\DCS\\Missions\\" -- example path
             local BlueOpsFilename = BlueFileName or "ExamplePlatoonSave.csv" -- example filename  
             if UTILS.CheckFileExists(Path,BlueOpsFilename) then
               local loadback = UTILS.LoadSetOfOpsGroups(Path,BlueOpsFilename,false)
               for _,_platoondata in pairs (loadback) do
                 local groupname = _platoondata.groupname -- #string
                 local coordinate = _platoondata.coordinate -- Core.Point#COORDINATE
                 Your_Brigade:LoadBackAssetInPosition(groupname,coordinate)
               end
             end
           end
 
           local AssetLoader = TIMER:New(LoadBackAssets)
           AssetLoader:Start(20)

The assets loaded back into the mission will be considered for AUFTRAG type missions from CHIEF and BRIGADE.

Create a new BRIGADE class object.

Defined in:

BRIGADE

Parameters:

#string WarehouseName

Name of the warehouse STATIC or UNIT object representing the warehouse.

#string BrigadeName

Name of the brigade.

Return value:

self

On after "ArmyOnMission" event.

Defined in:

BRIGADE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The ARMYGROUP on mission.

The mission.

Remove asset from platoon.

Defined in:

BRIGADE

Parameter:

The platoon asset.

Define a set of retreat zones.

Defined in:

BRIGADE

Parameter:

Core.Set#SET_ZONE RetreatZoneSet

Set of retreat zones.

Return value:

self

Triggers the FSM event "Start".

Starts the BRIGADE. Initializes parameters and starts event handlers.

Defined in:

BRIGADE

Triggers the FSM event "ArmyOnMission" after a delay.

Defined in:

BRIGADE

Parameters:

#number delay

Delay in seconds.

The ARMYGROUP on mission.

The mission.

Triggers the FSM event "Start" after a delay.

Starts the BRIGADE. Initializes parameters and starts event handlers.

Defined in:

BRIGADE

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Stop" after a delay.

Stops the BRIGADE and all its event handlers.

Defined in:

BRIGADE

Parameter:

#number delay

Delay in seconds.

On after "ArmyOnMission".

Defined in:

BRIGADE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Ops army group on mission.

The requested mission.

Start BRIGADE FSM.

Defined in:

BRIGADE

Parameters:

From

Event

To

Update status.

Defined in:

BRIGADE

Parameters:

From

Event

To

Field(s)

#string BRIGADE.ClassName

Name of the class.

BRIGADE.lid

Set some string id for output to DCS.log file.

#table BRIGADE.rearmingZones

Rearming zones. Each element is of type #BRIGADE.SupplyZone.

#table BRIGADE.refuellingZones

Refuelling zones. Each element is of type #BRIGADE.SupplyZone.

#number BRIGADE.verbose

Verbosity of output.

#string BRIGADE.version

BRIGADE class version.

Function(s)

Add cohort to cohort table of this legion.

Defined in:

Parameter:

The cohort to be added.

Return value:

self

Add a mission for the legion.

It will pick the best available assets for the mission and lauch it when ready.

Defined in:

Parameter:

Mission for this legion.

Return value:

self

Add transport assignment to queue.

Defined in:

Parameter:

Transport assignment.

Return value:

self

Recruit and assign assets performing an escort mission for a given asset list.

Note that each asset gets an escort.

Defined in:

Parameters:

#table Cohorts

Cohorts for escorting assets.

#table Assets

Table of assets to be escorted.

#number NescortMin

Min number of escort groups required per escorted asset.

#number NescortMax

Max number of escort groups required per escorted asset.

#string MissionType

Mission type.

#string TargetTypes

Types of targets that are engaged.

#number EngageRange

EngageRange in Nautical Miles.

Return value:

#boolean:

If true, enough assets could be recruited or no escort was required in the first place.

Recruit and assign assets performing an OPSTRANSPORT for a given asset list.

Defined in:

Parameters:

#table Legions

Transport legions.

#table CargoAssets

Weight of the heaviest cargo group to be transported.

#number NcarriersMin

Min number of carrier assets.

#number NcarriersMax

Max number of carrier assets.

Core.Zone#ZONE DeployZone

Deploy zone.

Core.Zone#ZONE DisembarkZone

(Optional) Disembark zone.

#table Categories

Group categories.

#table Attributes

Generalizes group attributes.

#table Properties

DCS attributes.

Return values:

#boolean:

If true, enough assets could be recruited and an OPSTRANSPORT object was created.

Transport The transport.

Calculate the mission score of an asset.

Defined in:

Parameters:

#string MissionType

Mission type for which the best assets are desired.

DCS#Vec2 TargetVec2

Target 2D vector.

#boolean IncludePayload

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

#number TotalWeight

The total weight of the cargo to be transported, if applicable.

Return value:

#number:

Mission score.

Check mission queue and assign ONE mission.

Defined in:

Return value:

#boolean:

If true, a mission was found and requested.

Check transport queue and assign ONE transport.

Defined in:

Return value:

#boolean:

If true, a transport was found and requested.

Count total number of assets of the legion.

Defined in:

Parameters:

#boolean InStock

If true, only assets that are in the warehouse stock/inventory are counted. If false, only assets that are NOT in stock (i.e. spawned) are counted. If nil, all assets are counted.

#table MissionTypes

(Optional) Count only assest that can perform certain mission type(s). Default is all types.

#table Attributes

(Optional) Count only assest that have a certain attribute(s), e.g. GROUP.Attribute.AIR_BOMBER.

Return value:

#number:

Amount of asset groups in stock.

Count assets on mission.

Defined in:

Parameters:

#table MissionTypes

Types on mission to be checked. Default all.

Only count assets of this cohort. Default count assets of all cohorts.

Return values:

#number:

Number of pending and queued assets.

#number:

Number of pending assets.

#number:

Number of queued assets.

Count total number of assets in LEGION warehouse stock that also have a payload.

Defined in:

Parameters:

#boolean Payloads

(Optional) Specifc payloads to consider. Default all.

#table MissionTypes

(Optional) Count only assest that can perform certain mission type(s). Default is all types.

#table Attributes

(Optional) Count only assest that have a certain attribute(s), e.g. WAREHOUSE.Attribute.AIR_BOMBER.

Return value:

#number:

Amount of asset groups in stock.

Count missions in mission queue.

Defined in:

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:

Parameters:

#table MissionTypes

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

#table UnitTypes

Types of units.

#table Payloads

Specific payloads to be counted only.

Return value:

#number:

Count of available payloads in stock.

Remove cohort from cohor table of this legion.

Defined in:

Parameter:

The cohort to be added.

Return value:

self

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

The payload with the highest priority is preferred.

Defined in:

Parameters:

#string UnitType

The type of the unit.

#string MissionType

The mission type.

#table Payloads

Specific payloads only to be considered.

Return value:

Payload table or nil.

Get the unit types of this legion.

These are the unit types of all assigned cohorts.

Defined in:

Parameters:

#boolean onlyactive

Count only the active ones.

#table cohorts

Table of cohorts. Default all.

Return value:

#table:

Table of unit types.

Get the current mission of the asset.

Defined in:

Parameter:

Return value:

Current mission or nil.

Get assets on mission.

Defined in:

Parameter:

#table MissionTypes

Types on mission to be checked. Default all.

Return value:

#table:

Assets on pending requests.

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

Defined in:

Parameter:

#number mid

Mission ID (Auftragsnummer).

Return value:

Mission table.

Returns the mission for a given request.

Defined in:

Parameter:

The warehouse request.

Return value:

Mission table or nil.

Returns the mission for a given request ID.

Defined in:

Parameter:

#number RequestID

Unique ID of the request.

Return value:

Mission table or nil.

Get name of legion.

This is the alias of the warehouse.

Defined in:

Return value:

#string:

Name of legion.

Get OPSGROUPs that are spawned and alive.

Defined in:

Parameters:

#table MissionTypes

(Optional) Get only assest that can perform certain mission type(s). Default is all types.

#table Attributes

(Optional) Get only assest that have a certain attribute(s), e.g. WAREHOUSE.Attribute.AIR_BOMBER.

Return value:

The set of OPSGROUPs. Can be empty if no groups are spawned or alive!

Returns the mission for a given ID.

Defined in:

Parameter:

#number uid

Transport UID.

Return value:

Transport assignment.

Check if the AIRWING class is calling.

Defined in:

Return value:

#boolean:

If true, this is an AIRWING.

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

Defined in:

Parameters:

#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.

Check if a BRIGADE class is calling.

Defined in:

Return value:

#boolean:

If true, this is a BRIGADE.

Check if cohort is part of this legion.

Defined in:

Parameter:

#string CohortName

Name of the platoon.

Return value:

#boolean:

If true, cohort is part of this legion.

Check if the FLEET class is calling.

Defined in:

Return value:

#boolean:

If true, this is a FLEET.

Triggers the FSM event "LegionAssetReturned".

Defined in:

Parameters:

The cohort the asset belongs to.

The asset that returned.

Triggers the FSM event "MissionAssign".

Defined in:

Parameters:

The mission.

#table Legions

The legion(s) from which the mission assets are requested.

Triggers the FSM event "MissionCancel".

Defined in:

Parameter:

The mission.

Triggers the FSM event "MissionRequest".

Defined in:

Parameters:

The mission.

#table Assets

(Optional) Assets to add.

Create a new LEGION class object.

Defined in:

Parameters:

#string WarehouseName

Name of the warehouse STATIC or UNIT object representing the warehouse.

#string LegionName

Name of the legion. Must be unique!

Return value:

self

On after "LegionAssetReturned" event.

Triggered when an asset group returned to its Legion.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The cohort the asset belongs to.

The asset that returned.

On after "MissionAssign" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The mission.

#table Legions

The legion(s) from which the mission assets are requested.

On after "MissionCancel" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The mission.

On after "MissionRequest" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The mission.

#table Assets

(Optional) Assets to add.

On after "OpsOnMission" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The OPS group on mission.

The mission.

On after "TransportAssign" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The transport.

#table Legions

The legion(s) to which this transport is assigned.

On after "TransportCancel" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The transport.

On after "TransportRequest" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The transport.

Triggers the FSM event "OpsOnMission".

Defined in:

Parameters:

The OPS group on mission.

The mission.

Recruit assets performing an escort mission for a given asset.

Defined in:

Parameters:

The mission.

#table Assets

Table of assets.

Return value:

#boolean:

If true, enough assets could be recruited or no escort was required in the first place.

Recruit assets for a given mission.

Defined in:

Parameter:

The mission.

Return values:

#boolean:

If true enough assets could be recruited.

#table:

Recruited assets.

#table:

Legions of recruited assets.

Recruit assets for a given OPS transport.

Defined in:

Parameter:

The OPS transport.

Return values:

#boolean:

If true, enough assets could be recruited.

#table:

assets Recruited assets.

#table:

legions Legions of recruited assets.

Recruit assets from Cohorts for the given parameters.

NOTE that we set the asset.isReserved=true flag so it cannot be recruited by anyone else.

Defined in:

Parameters:

#table Cohorts

Cohorts included.

#string MissionTypeRecruit

Mission type for recruiting the cohort assets.

#string MissionTypeOpt

Mission type for which the assets are optimized. Default is the same as MissionTypeRecruit.

#number NreqMin

Minimum number of required assets.

#number NreqMax

Maximum number of required assets.

DCS#Vec2 TargetVec2

Target position as 2D vector.

#table Payloads

Special payloads.

#number RangeMax

Max range in meters.

#number RefuelSystem

Refuelsystem.

#number CargoWeight

Cargo weight for recruiting transport carriers.

#number TotalWeight

Total cargo weight in kg.

#number MaxWeight

Max weight [kg] of the asset group.

#table Categories

Group categories.

#table Attributes

Group attributes. See GROUP.Attribute.

#table Properties

DCS attributes.

#table WeaponTypes

Bit of weapon types.

Return values:

#boolean:

If true enough assets could be recruited.

#table:

Recruited assets. NOTE that we set the asset.isReserved=true flag so it cant be recruited by anyone else.

#table:

Legions of recruited assets.

Relocate a cohort to another legion.

Assets in stock are spawned and routed to the new legion. If assets are spawned, running missions will be cancelled. Cohort assets will not be available until relocation is finished.

Defined in:

Parameters:

The cohort to be relocated.

The legion where the cohort is relocated to.

#number Delay

Delay in seconds before relocation takes place. Default nil, i.e. ASAP.

#number NcarriersMin

Min number of transport carriers in case the troops should be transported. Default nil for no transport.

#number NcarriersMax

Max number of transport carriers.

#table TransportLegions

Legion(s) assigned for transportation. Default is that transport assets can only be recruited from this legion.

Return value:

self

Remove mission from queue.

Defined in:

Parameter:

Mission to be removed.

Return value:

self

Return payload from asset back to stock.

Defined in:

Parameter:

The squadron asset.

Set tactical overview on.

Defined in:

Return value:

self

Set verbosity level.

Defined in:

Parameter:

#number VerbosityLevel

Level of output (higher=more). Default 0.

Return value:

self

Triggers the FSM event "Start".

Starts the LEGION. Initializes parameters and starts event handlers.

Defined in:

Triggers the FSM event "TransportAssign".

Defined in:

Parameters:

The transport.

#table Legions

The legion(s) to which this transport is assigned.

Triggers the FSM event "TransportCancel".

Defined in:

Parameter:

The transport.

Triggers the FSM event "TransportRequest".

Defined in:

Parameter:

The transport.

Unrecruit assets.

Set isReserved to false, return payload to airwing and (optionally) remove from assigned mission.

Defined in:

Parameters:

#table Assets

List of assets.

(Optional) The mission from which the assets will be deleted.

Create a request and add it to the warehouse queue.

Defined in:

Parameters:

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.

#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.

Return value:

Recruit assets from Cohorts for the given parameters.

NOTE that we set the asset.isReserved=true flag so it cant be recruited by anyone else.

Defined in:

Parameters:

The Cohort.

#string MissionType

Misson type(s).

#table Categories

Group categories.

#table Attributes

Group attributes. See GROUP.Attribute.

#table Properties

DCS attributes.

#table WeaponTypes

Bit of weapon types.

DCS#Vec2 TargetVec2

Target position.

RangeMax

Max range in meters.

#number RefuelSystem

Refueling system (boom or probe).

#number CargoWeight

Cargo weight [kg]. This checks the cargo bay of the cohort assets and ensures that it is large enough to carry the given cargo weight.

#number MaxWeight

Max weight [kg]. This checks whether the cohort asset group is not too heavy.

Return value:

#boolean:

Returns true if given cohort can meet all requirements.

Count payloads of all cohorts for all unit types.

Defined in:

Parameters:

#string MissionType

Mission type.

#table Cohorts

Cohorts included.

#table Payloads

(Optional) Special payloads.

Return value:

#table:

Table of payloads for each unit type.

Create a new OPS group after an asset was spawned.

Defined in:

Parameter:

Return value:

The created flightgroup object.

Get cohort by name.

Defined in:

Parameter:

#string CohortName

Name of the platoon.

Return value:

The Cohort object.

Get cohort of an asset.

Defined in:

Parameter:

Return value:

The Cohort object.

Get cohorts.

Defined in:

Parameters:

#table Legions

Special legions.

#table Cohorts

Special cohorts.

Operation.

#table OpsQueue

Queue of operations.

Return value:

#table:

Cohorts.

Optimize chosen assets for the mission at hand.

Defined in:

Parameters:

#table assets

Table of (unoptimized) assets.

#string MissionType

Mission type.

DCS#Vec2 TargetVec2

Target position as 2D vector.

#boolean IncludePayload

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

#number TotalWeight

The total weight of the cargo to be transported, if applicable.

Display tactical overview.

Defined in:

Triggers the FSM event "LegionAssetReturned" after a delay.

Defined in:

Parameters:

#number delay

Delay in seconds.

The cohort the asset belongs to.

The asset that returned.

Triggers the FSM event "MissionAssign" after a delay.

Defined in:

Parameters:

#number delay

Delay in seconds.

The mission.

#table Legions

The legion(s) from which the mission assets are requested.

Triggers the FSM event "MissionCancel" after a delay.

Defined in:

Parameters:

#number delay

Delay in seconds.

The mission.

Triggers the FSM event "MissionRequest" after a delay.

Defined in:

Parameters:

#number delay

Delay in seconds.

The mission.

#table Assets

(Optional) Assets to add.

Triggers the FSM event "OpsOnMission" after a delay.

Defined in:

Parameters:

#number delay

Delay in seconds.

The OPS group on mission.

The mission.

Triggers the FSM event "Start" after a delay.

Starts the LEGION. Initializes parameters and starts event handlers.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Stop" after a delay.

Stops the LEGION and all its event handlers.

Defined in:

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "TransportAssign" after a delay.

Defined in:

Parameters:

#number delay

Delay in seconds.

The transport.

#table Legions

The legion(s) to which this transport is assigned.

Triggers the FSM event "TransportCancel" after a delay.

Defined in:

Parameters:

#number delay

Delay in seconds.

The transport.

Triggers the FSM event "TransportRequest" after a delay.

Defined in:

Parameters:

#number delay

Delay in seconds.

The transport.

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.

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

Defined in:

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 "Captured" event.

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 "Destroyed" event.

Remove assets from cohorts. Stop cohorts.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "LegionAssetReturned" event.

Triggered when an asset group returned to its legion.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The cohort the asset belongs to.

The asset that returned.

On after "MissionAssign" event.

Mission is added to a LEGION mission queue and already requested. Needs assets to be added to the mission already.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The mission.

#table Legions

The LEGIONs.

On after "MissionCancel" event.

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

Defined in:

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:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The requested mission.

#table Assets

(Optional) Assets to add.

On after "NewAsset" event.

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

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 "OpsOnMission".

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Ops group on mission

The requested mission.

On after "Request" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Information table of the request.

On after "RequestSpawned" event.

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.

On after "SelfRequest" event.

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.

Start LEGION FSM.

Defined in:

Parameters:

From

Event

To

On after "TransportAssign" event.

Transport is added to a LEGION transport queue and assets are requested from the LEGION warehouse.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The transport.

#table Legions

The legion(s) to which the transport is assigned.

On after "TransportCancel" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The transport to be cancelled.

On after "TransportRequest" event.

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

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The requested mission.

OpsTransport

Field(s)

#string BRIGADE.ClassName

Name of the class.

BRIGADE.lid

Set some string id for output to DCS.log file.

#table BRIGADE.rearmingZones

Rearming zones. Each element is of type #BRIGADE.SupplyZone.

#table BRIGADE.refuellingZones

Refuelling zones. Each element is of type #BRIGADE.SupplyZone.

#number BRIGADE.verbose

Verbosity of output.

#string BRIGADE.version

BRIGADE class version.

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 coalition 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.

Check if runway is operational.

Defined in:

Return value:

#number:

Time in seconds until the runway is repaired. Will return 0 if runway is repaired.

Get the spawn zone.

Defined in:

Return value:

The spawn zone.

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.

Get 2D vector of warehouse static.

Defined in:

Return value:

The 2D vector of the warehouse.

Get 3D vector of warehouse static.

Defined in:

Return value:

The 3D vector of the warehouse.

Get the warehouse zone.

Defined in:

Return value:

The warehouse zone.

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 runway is operational.

Defined in:

Return value:

#boolean:

If true, runway is operational.

Check if warehouse physical representation is a ship.

Defined in:

Return value:

#boolean:

If true, warehouse object is a ship.

Check if warehouse physical representation is a static (not a unit) object.

Defined in:

Return value:

#boolean:

If true, warehouse object is a static.

Check if the warehouse is stopped.

Defined in:

Return value:

#boolean:

If true, the warehouse is stopped.

Check if warehouse physical representation is a unit (not a static) object.

Defined in:

Return value:

#boolean:

If true, warehouse object is a unit.

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. Can also be a Wrapper.Unit#UNIT.

#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/unit representing the warehouse.

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 wether client parking spots can be used for spawning.

Defined in:

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

Add a Harbor Zone for this warehouse where naval cargo units will spawn and be received.

Both warehouses must have the harbor zone defined for units to properly spawn on both the sending and receiving side. The harbor zone should be within 3km of the port zone used for warehouse in order to facilitate the boarding process.

Defined in:

Parameter:

The zone defining the naval embarcation/debarcation point for cargo units

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

Set the time until the runway(s) of an airdrome are repaired after it has been destroyed.

Note that this is the time, the DCS engine uses not something we can control on a user level or we could get via scripting. You need to input the value. On the DCS forum it was stated that this is currently one hour. Hence this is the default value.

Defined in:

Parameter:

#number RepairTime

Time in seconds until the runway is repaired. Default 3600 sec (one hour).

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 verbosity level.

Defined in:

Parameter:

#number VerbosityLevel

Level of output (higher=more). Default 0.

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 for an asset.

Defined in:

Parameters:

asset

Return value:

#boolean:

If true, parking is valid.

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:

#string groupname

Name of 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 lateactivated

If true, groups are spawned late activated.

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 lateactivated

If true, groups are spawned late activated.

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.

Group of 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 coalition 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 "RunwayDestroyed" event.

Defined in:

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after "RunwayRepaired" event.

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. Adds 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 "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 BRIGADE.ClassName

Name of the class.

BRIGADE.lid

Set some string id for output to DCS.log file.

#table BRIGADE.rearmingZones

Rearming zones. Each element is of type #BRIGADE.SupplyZone.

#table BRIGADE.refuellingZones

Refuelling zones. Each element is of type #BRIGADE.SupplyZone.

#number BRIGADE.verbose

Verbosity of output.

#string BRIGADE.version

BRIGADE class version.

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

Set the default #FSM_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.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

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

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

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

Defined in:

Return value:

#table:

Transitions.

Check if FSM is in state.

Defined in:

Parameter:

#string State

State name.

Return value:

#boolean:

If true, FSM is in this state.

Load call backs.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

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.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

Call handler.

Defined in:

Parameters:

#string step

Step "onafter", "onbefore", "onenter", "onleave".

#string trigger

Trigger.

#table params

Parameters.

#string EventName

Event name.

Return value:

Value.

Create transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Delayed transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Event map.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

Check if can do an event.

Defined in:

Parameter:

#string e

Event name.

Return values:

#boolean:

If true, FSM can do the event.

#string:

To state.

Check if cannot do an event.

Defined in:

Parameter:

#string e

Event name.

Return value:

#boolean:

If true, FSM cannot do the event.

Check if FSM is in state.

Defined in:

Parameters:

#string State

State name.

state

Return value:

#boolean:

If true, FSM is in this state.

Supply Zone.

Field(s)

#boolean BRIGADE.SupplyZone.markerOn

If true, marker is on.

Ops.Auftrag#AUFTRAG BRIGADE.SupplyZone.mission

Mission assigned to supply ammo or fuel.

Function(s)