Banner Image

Module Ops.CTLD

Ops -- Combat Troops & Logistics Department.


CTLD - MOOSE based Helicopter CTLD Operations.


Missions:

CTLD - Combat Troop & Logistics Deployment


Main Features:

  • MOOSE-based Helicopter CTLD Operations for Players.

Author: Applevangelist (Moose Version), Ciribob (original), Thanks to: Shadowze, Cammel (testing), bbirchnz (additional code!!)

Global(s)

Global CTLD

Combat Troop & Logistics Deployment (CTLD): Everyone wants to be a POG, until there's POG stuff to be done. (Mil Saying)


Banner Image

CTLD Concept

  • MOOSE-based CTLD for Players.
#CTLD CTLD

Combat Troop & Logistics Deployment (CTLD): Everyone wants to be a POG, until there's POG stuff to be done. (Mil Saying)


Banner Image

CTLD Concept

  • MOOSE-based CTLD for Players.
  • Object oriented refactoring of Ciribob's fantastic CTLD script.
  • No need for extra MIST loading.
  • Additional events to tailor your mission.
  • ANY late activated group can serve as cargo, either as troops or crates, which have to be build on-location.

0. Prerequisites

You need to load an .ogg soundfile for the pilot's beacons into the mission, e.g. "beacon.ogg", use a once trigger, "sound to country" for that. Create the late-activated troops, vehicles (no statics at this point!) that will make up your deployable forces.

1. Basic Setup

1.1 Create and start a CTLD instance

A basic setup example is the following:

   -- Instantiate and start a CTLD for the blue side, using helicopter groups named "Helicargo" and alias "Lufttransportbrigade I"
   local my_ctld = CTLD:New(coalition.side.BLUE,{"Helicargo"},"Lufttransportbrigade I")
   my_ctld:__Start(5)

1.2 Add cargo types available

Add generic cargo types that you need for your missions, here infantry units, vehicles and a FOB. These need to be late-activated Wrapper.Group#GROUP objects:

   -- add infantry unit called "Anti-Tank Small" using template "ATS", of type TROOP with size 3
   -- infantry units will be loaded directly from LOAD zones into the heli (matching number of free seats needed)
   my_ctld:AddTroopsCargo("Anti-Tank Small",{"ATS"},CTLD_CARGO.Enum.TROOPS,3)
   -- if you want to add weight to your Heli, troops can have a weight in kg **per person**. Currently no max weight checked. Fly carefully.
   my_ctld:AddTroopsCargo("Anti-Tank Small",{"ATS"},CTLD_CARGO.Enum.TROOPS,3,80)

   -- add infantry unit called "Anti-Tank" using templates "AA" and "AA"", of type TROOP with size 4
   my_ctld:AddTroopsCargo("Anti-Air",{"AA","AA2"},CTLD_CARGO.Enum.TROOPS,4)

   -- add vehicle called "Humvee" using template "Humvee", of type VEHICLE, size 2, i.e. needs two crates to be build
   -- vehicles and FOB will be spawned as crates in a LOAD zone first. Once transported to DROP zones, they can be build into the objects
   my_ctld:AddCratesCargo("Humvee",{"Humvee"},CTLD_CARGO.Enum.VEHICLE,2)
   -- if you want to add weight to your Heli, crates can have a weight in kg **per crate**. Currently no max weight checked. Fly carefully.
   my_ctld:AddCratesCargo("Humvee",{"Humvee"},CTLD_CARGO.Enum.VEHICLE,2,2775)

   -- add infantry unit called "Forward Ops Base" using template "FOB", of type FOB, size 4, i.e. needs four crates to be build:
   my_ctld:AddCratesCargo("Forward Ops Base",{"FOB"},CTLD_CARGO.Enum.FOB,4)

   -- add crates to repair FOB or VEHICLE type units - the 2nd parameter needs to match the template you want to repair
   my_ctld:AddCratesRepair("Humvee Repair","Humvee",CTLD_CARGO.Enum.REPAIR,1)

1.3 Add logistics zones

Add zones for loading troops and crates and dropping, building crates

   -- Add a zone of type LOAD to our setup. Players can load troops and crates.
   -- "Loadzone" is the name of the zone from the ME. Players can load, if they are inside of the zone.
   -- Smoke and Flare color for this zone is blue, it is active (can be used) and has a radio beacon.
   my_ctld:AddCTLDZone("Loadzone",CTLD.CargoZoneType.LOAD,SMOKECOLOR.Blue,true,true)

   -- Add a zone of type DROP. Players can drop crates here.
   -- Smoke and Flare color for this zone is blue, it is active (can be used) and has a radio beacon.
   -- NOTE: Troops can be unloaded anywhere, also when hovering in parameters.
   my_ctld:AddCTLDZone("Dropzone",CTLD.CargoZoneType.DROP,SMOKECOLOR.Red,true,true)

   -- Add two zones of type MOVE. Dropped troops and vehicles will move to the nearest one. See options.
   -- Smoke and Flare color for this zone is blue, it is active (can be used) and has a radio beacon.
   my_ctld:AddCTLDZone("Movezone",CTLD.CargoZoneType.MOVE,SMOKECOLOR.Orange,false,false)

   my_ctld:AddCTLDZone("Movezone2",CTLD.CargoZoneType.MOVE,SMOKECOLOR.White,true,true)

2. Options

The following options are available (with their defaults). Only set the ones you want changed:

     my_ctld.useprefix = true -- (DO NOT SWITCH THIS OFF UNLESS YOU KNOW WHAT YOU ARE DOING!) Adjust **before** starting CTLD. If set to false, *all* choppers of the coalition side will be enabled for CTLD.
     my_ctld.CrateDistance = 30 -- List and Load crates in this radius only.
     my_ctld.dropcratesanywhere = false -- Option to allow crates to be dropped anywhere.
     my_ctld.maximumHoverHeight = 15 -- Hover max this high to load.
     my_ctld.minimumHoverHeight = 4 -- Hover min this low to load.
     my_ctld.forcehoverload = true -- Crates (not: troops) can only be loaded while hovering.
     my_ctld.hoverautoloading = true -- Crates in CrateDistance in a LOAD zone will be loaded automatically if space allows.
     my_ctld.smokedistance = 2000 -- Smoke or flares can be request for zones this far away (in meters).
     my_ctld.movetroopstowpzone = true -- Troops and vehicles will move to the nearest MOVE zone...
     my_ctld.movetroopsdistance = 5000 -- .. but only if this far away (in meters)
     my_ctld.smokedistance = 2000 -- Only smoke or flare zones if requesting player unit is this far away (in meters)
     my_ctld.suppressmessages = false -- Set to true if you want to script your own messages.
     my_ctld.repairtime = 300 -- Number of seconds it takes to repair a unit.

2.1 User functions

2.1.1 Adjust or add chopper unit-type capabilities

Use this function to adjust what a heli type can or cannot do:

   -- E.g. update unit capabilities for testing. Please stay realistic in your mission design.
   -- Make a Gazelle into a heavy truck, this type can load both crates and troops and eight of each type:
   my_ctld:UnitCapabilities("SA342L", true, true, 8, 8)

   Default unit type capabilities are:

   ["SA342Mistral"] = {type="SA342Mistral", crates=false, troops=true, cratelimit = 0, trooplimit = 4},
   ["SA342L"] = {type="SA342L", crates=false, troops=true, cratelimit = 0, trooplimit = 2},
   ["SA342M"] = {type="SA342M", crates=false, troops=true, cratelimit = 0, trooplimit = 4},
   ["SA342Minigun"] = {type="SA342Minigun", crates=false, troops=true, cratelimit = 0, trooplimit = 2},
   ["UH-1H"] = {type="UH-1H", crates=true, troops=true, cratelimit = 1, trooplimit = 8},
   ["Mi-8MT"] = {type="Mi-8MT", crates=true, troops=true, cratelimit = 2, trooplimit = 12},
   ["Ka-50"] = {type="Ka-50", crates=false, troops=false, cratelimit = 0, trooplimit = 0},
   ["Mi-24P"] = {type="Mi-24P", crates=true, troops=true, cratelimit = 1, trooplimit = 8},
   ["Mi-24V"] = {type="Mi-24V", crates=true, troops=true, cratelimit = 1, trooplimit = 8},

2.1.2 Activate and deactivate zones

Activate a zone:

   -- Activate zone called Name of type #CTLD.CargoZoneType ZoneType:
   my_ctld:ActivateZone(Name,CTLD.CargoZoneType.MOVE)

Deactivate a zone:

   -- Deactivate zone called Name of type #CTLD.CargoZoneType ZoneType:
   my_ctld:DeactivateZone(Name,CTLD.CargoZoneType.DROP)

3. Events

The class comes with a number of FSM-based events that missions designers can use to shape their mission. These are:

3.1 OnAfterTroopsPickedUp

This function is called when a player has loaded Troops:

   function my_ctld:OnAfterTroopsPickedUp(From, Event, To, Group, Unit, Cargo)
     ... your code here ...
   end

3.2 OnAfterCratesPickedUp

This function is called when a player has picked up crates:

   function my_ctld:OnAfterCratesPickedUp(From, Event, To, Group, Unit, Cargo)
     ... your code here ...
   end

3.3 OnAfterTroopsDeployed

This function is called when a player has deployed troops into the field:

   function my_ctld:OnAfterTroopsDeployed(From, Event, To, Group, Unit, Troops)
     ... your code here ...
   end

3.4 OnAfterTroopsExtracted

This function is called when a player has re-boarded already deployed troops from the field:

   function my_ctld:OnAfterTroopsExtracted(From, Event, To, Group, Unit, Troops)
     ... your code here ...
   end

3.5 OnAfterCratesDropped

This function is called when a player has deployed crates to a DROP zone:

   function my_ctld:OnAfterCratesDropped(From, Event, To, Group, Unit, Cargotable)
     ... your code here ...
   end

3.6 OnAfterCratesBuild, OnAfterCratesRepaired

This function is called when a player has build a vehicle or FOB:

   function my_ctld:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle)
     ... your code here ...
   end

   function my_ctld:OnAfterCratesRepaired(From, Event, To, Group, Unit, Vehicle)
     ... your code here ...
   end

3.7 A simple SCORING example:

To award player with points, using the SCORING Class (SCORING: my_Scoring, CTLD: CTLD_Cargotransport)

   function CTLD_Cargotransport:OnAfterCratesDropped(From, Event, To, Group, Unit, Cargotable)
       local points = 10
       local PlayerName = Unit:GetPlayerName()
       my_scoring:_AddPlayerFromUnit( Unit )
       my_scoring:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for transporting cargo crates!", PlayerName, points), points)
   end

   function CTLD_Cargotransport:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle)
     local points = 5
     local PlayerName = Unit:GetPlayerName()
     my_scoring:_AddPlayerFromUnit( Unit )
     my_scoring:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for the construction of Units!", PlayerName, points), points)
    end

4. F10 Menu structure

CTLD management menu is under the F10 top menu and called "CTLD"

4.1 Manage Crates

Use this entry to get, load, list nearby, drop, build and repair crates. Also @see options.

4.2 Manage Troops

Use this entry to load, drop and extract troops. NOTE - with extract you can only load troops from the field that were deployed prior. Currently limited CTLD_CARGO troops, which are build from one template. Also, this will heal/complete your units as they are respawned.

4.3 List boarded cargo

Lists what you have loaded. Shows load capabilities for number of crates and number of seats for troops.

4.4 Smoke & Flare zones nearby

Does what it says.

4.5 List active zone beacons

Lists active radio beacons for all zones, where zones are both active and have a beacon. @see CTLD:AddCTLDZone()

4.6 Show hover parameters

Lists hover parameters and indicates if these are curently fulfilled. Also @see options on hover heights.

5. Support for Hercules mod by Anubis

Basic support for the Hercules mod By Anubis has been build into CTLD. Currently this does not cover objects and troops which can be loaded from the Rearm/Refuel menu, i.e. you can drop them into the field, but you cannot use them in functions scripted with this class.

         local my_ctld = CTLD:New(coalition.side.BLUE,{"Helicargo", "Hercules"},"Lufttransportbrigade I")

Enable these options for Hercules support:

         my_ctld.enableHercules = true
         my_ctld.HercMinAngels = 155 -- for troop/cargo drop via chute in meters, ca 470 ft
         my_ctld.HercMaxAngels = 2000 -- for troop/cargo drop via chute in meters, ca 6000 ft
         my_ctld.HercMaxSpeed = 77 -- 77mps or 270kph or 150kn

Also, the following options need to be set to true:

         my_ctld.useprefix = true -- this is true by default and MUST BE ON. 

Standard transport capabilities as per the real Hercules are:

          ["Hercules"] = {type="Hercules", crates=true, troops=true, cratelimit = 7, trooplimit = 64}, -- 19t cargo, 64 paratroopers

Global CTLD_CARGO

Type(s)

CTLD , extends Core.Fsm#FSM , extends Core.Base#BASE
Fields and Methods inherited from CTLD Description

CTLD:ActivateZone(Name, ZoneType, NewState)

User function - Activate Name #CTLD.CargoZone.Type ZoneType for this CTLD instance.

CTLD:AddCTLDZone(Name, Type, Color, Active, HasBeacon)

User function - Crates and adds a #CTLD.CargoZone zone for this CTLD instance.

CTLD:AddCratesCargo(Name, Templates, Type, NoCrates, PerCrateMass)

User function - Add generic crate-type loadable as cargo.

CTLD:AddCratesRepair(Name, Template, Type, NoCrates, PerCrateMass)

User function - Add generic repair crates loadable as cargo.

CTLD:AddTroopsCargo(Name, Templates, Type, NoTroops, PerTroopMass)

User function - Add generic troop type loadable as cargo.

CTLD:AddZone(Zone)

User function - Add a #CTLD.CargoZoneType zone for this CTLD instance.

CTLD:AutoHoverLoad(Unit)

(Internal) Autoload if we can do crates, have capacity free and are in a load zone.

CTLD:CanHoverLoad(Unit)

(Internal) Check if a unit is in a load zone and is hovering in parameters.

CTLD.CargoCounter

CTLD.CargoType

CTLD.CargoZoneType

CTLD.Cargo_Crates

CTLD.Cargo_Troops

CTLD:CheckAutoHoverload()

(Internal) Run through all pilots and see if we autoload.

CTLD.ClassName

Name of the class.

CTLD:CleanDroppedTroops()

(Internal) Run through DroppedTroops and capture alive units

CTLD.CrateCounter

CTLD.CrateDistance

CTLD.CratesNeeded

CTLD.CtldUnits

CTLD:DeactivateZone(Name, ZoneType)

User function - Deactivate Name #CTLD.CargoZoneType ZoneType for this CTLD instance.

CTLD.DroppedCrates

CTLD.DroppedTroops

CTLD.ExtractFactor

CTLD.FreeFMFrequencies

CTLD.FreeUHFFrequencies

CTLD.FreeVHFFrequencies

CTLD.HasBeenDropped

CTLD.HasBeenMoved

CTLD.HercMaxAngels

CTLD.HercMaxSpeed

CTLD.HercMinAngels

CTLD.ID

CTLD:IsCorrectFlightParameters(Unit)

(Internal) Check if a Hercules is flying in parameters for air drops.

CTLD:IsCorrectHover(Unit)

(Internal) Check if a unit is hovering in parameters.

CTLD:IsHercules(Unit)

(Internal) Function to check if a unit is a Hercules C-130.

CTLD:IsUnitInAir(Unit)

(Internal) Check if a unit is above ground.

CTLD:IsUnitInZone(Unit, Zonetype)

(Internal) Function to see if a unit is in a specific zone type.

CTLD.LoadDirectly

CTLD.Loaded_Cargo

CTLD.MenusDone

CTLD.Name

CTLD:New(Coalition, Prefixes, Alias)

Instantiate a new CTLD.

CTLD:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle)

FSM Function OnAfterCratesBuild.

CTLD:OnAfterCratesDropped(From, Event, To, Group, Unit, Cargotable)

FSM Function OnAfterCratesDropped.

CTLD:OnAfterCratesPickedUp(From, Event, To, Group, Unit, Cargo)

FSM Function OnAfterCratesPickedUp.

CTLD:OnAfterCratesRepaired(From, Event, To, Group, Unit, Vehicle)

FSM Function OnAfterCratesRepaired.

CTLD:OnAfterTroopsDeployed(From, Event, To, Group, Unit, Troops)

FSM Function OnAfterTroopsDeployed.

CTLD:OnAfterTroopsExtracted(From, Event, To, Group, Unit, Cargo)

FSM Function OnAfterTroopsExtracted.

CTLD:OnAfterTroopsPickedUp(From, Event, To, Group, Unit, Cargo)

FSM Function OnAfterTroopsPickedUp.

CTLD:OnAfterTroopsRTB(From, Event, To, Group, Unit)

FSM Function OnAfterTroopsRTB.

CTLD.PerCrateMass

CTLD.PilotGroups

CTLD.Positionable

CTLD.RadioSound

CTLD:SmokeZoneNearBy(Unit, Flare)

User function - Start smoke in a zone close to the Unit.

CTLD.Spawned_Cargo

CTLD.Spawned_Crates

CTLD:Start()

Triggers the FSM event "Start".

CTLD:Status()

Triggers the FSM event "Status".

CTLD.Templates

CTLD.TroopCounter

CTLD:UnitCapabilities(Unittype, Cancrates, Cantroops, Cratelimit, Trooplimit)

User - Function to add/adjust unittype capabilities.

CTLD.UnitTypes

CTLD.UsedFMFrequencies

CTLD.UsedUHFFrequencies

CTLD.UsedVHFFrequencies

CTLD:_AddRadioBeacon(Name, Sound, Mhz, Modulation)

(Internal) Add radio beacon to zone.

CTLD:_BuildCrates(Group, Unit)

(Internal) Function to build nearby crates.

CTLD:_BuildObjectFromCrates(Group, Unit, Build, Repair, Coordinate, RepairLocation)

(Internal) Function to actually SPAWN buildables in the mission.

CTLD:_CleanUpCrates(Crates, Build, Number)

(Internal) Housekeeping - Cleanup crates when build

CTLD:_EventHandler(EventData)

(Internal) Event handler function

CTLD:_ExtractTroops(Group, Unit)

(Internal) Function to extract (load from the field) troops into a heli.

CTLD:_FindCratesNearby(_group, _unit, _dist)

(Internal) Function to find and return nearby crates.

CTLD:_FindRepairNearby(Group, Unit, Repairtype)

CTLD:_GenerateFMFrequencies()

(Internal) Function to generate valid FM Frequencies

CTLD:_GenerateUHFrequencies()

(Internal) Function to generate valid UHF Frequencies

CTLD:_GenerateVHFrequencies()

(Internal) Populate table with available VHF beacon frequencies.

CTLD:_GetCrates(Group, Unit, Cargo, number, drop)

(Internal) Function to spawn crates in front of the heli.

CTLD:_GetDistance(_point1, _point2)

(Internal) Return distance in meters between two coordinates.

CTLD:_GetFMBeacon(Name)

(Internal) Function to obtain a valid FM frequency.

CTLD:_GetUHFBeacon(Name)

(Internal) Function to obtain a valid UHF frequency.

CTLD:_GetUnitCapabilities(Unit)

(Internal) Function to get capabilities of a chopper

CTLD:_GetUnitCargoMass(Unit)

(Internal) Function to get current loaded mass

CTLD:_GetVHFBeacon(Name)

(Internal) Function to obtain a valid VHF frequency.

CTLD:_ListCargo(Group, Unit)

(Internal) Function to list loaded cargo.

CTLD:_ListCratesNearby(Group, Unit, _group, _unit)

(Internal) Function to find and list nearby crates.

CTLD:_ListRadioBeacons(Group, Unit)

(Internal) Function to show list of radio beacons

CTLD:_LoadCratesNearby(Group, Unit)

(Internal) Function to get and load nearby crates.

CTLD:_LoadTroops(Group, Unit, Cargotype)

(Internal) Function to load troops into a heli.

CTLD:_MoveGroupToZone(Group)

(Internal) Function to move group to WP zone.

CTLD:_RefreshF10Menus()

(Internal) Housekeeping - Function to refresh F10 menus.

CTLD:_RefreshRadioBeacons()

(Internal) Function to refresh radio beacons

CTLD:_RepairCrates(Group, Unit)

(Internal) Function to repair nearby vehicles / FOBs

CTLD:_RepairObjectFromCrates(Group, Unit, Crates, Build, Number)

(Internal) Function to repair an object.

CTLD:_SendMessage(Text, Time, Clearscreen, Group)

(Internal) Function to message a group.

CTLD:_ShowFlightParams(Group, Unit)

(Internal) List if a Herc unit is flying in parameters.

CTLD:_ShowHoverParams(Group, Unit)

(Internal) List if a unit is hovering in parameters.

CTLD:_UnloadCrates(Group, Unit)

(Internal) Function to unload crates from heli.

CTLD:_UnloadTroops(Group, Unit)

(Internal) Function to unload troops from heli.

CTLD:_UpdateUnitCargoMass(Unit)

(Internal) Function to calculate and set Unit internal cargo mass

CTLD:__Start(delay)

Triggers the FSM event "Start" after a delay.

CTLD:__Status(delay)

Triggers the FSM event "Status" after a delay.

CTLD:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

CTLD.alias

CTLD.coalition

Coalition side number, e.g. coalition.side.RED.

CTLD.coalitiontxt

CTLD.dropOffZones

CTLD.dropcratesanywhere

CTLD.enableHercules

CTLD.forcehoverload

CTLD.hoverautoloading

CTLD.lid

Class id string for output to DCS log file.

CTLD.maximumHoverHeight

CTLD.minimumHoverHeight

CTLD.movetroopsdistance

CTLD.movetroopstowpzone

CTLD:onafterStart(From, Event, To)

(Internal) FSM Function onafterStart.

CTLD:onafterStatus(From, Event, To)

(Internal) FSM Function onafterStatus.

CTLD:onafterStop(From, Event, To)

(Internal) FSM Function onafterStop.

CTLD:onbeforeCratesBuild(From, Event, To, Group, Unit, Vehicle)

(Internal) FSM Function onbeforeCratesBuild.

CTLD:onbeforeCratesDropped(From, Event, To, Group, Unit, Cargotable)

(Internal) FSM Function onbeforeCratesDropped.

CTLD:onbeforeCratesPickedUp(From, Event, To, Group, Unit, Cargo)

(Internal) FSM Function onbeforeCratesPickedUp.

CTLD:onbeforeStatus(From, Event, To)

(Internal) FSM Function onbeforeStatus.

CTLD:onbeforeTroopsDeployed(From, Event, To, Group, Unit, Troops)

(Internal) FSM Function onbeforeTroopsDeployed.

CTLD:onbeforeTroopsExtracted(From, Event, To, Group, Unit, Troops)

(Internal) FSM Function onbeforeTroopsExtracted.

CTLD:onbeforeTroopsPickedUp(From, Event, To, Group, Unit, Cargo)

(Internal) FSM Function onbeforeTroopsPickedUp.

CTLD:onbeforeTroopsRTB(From, Event, To, Group, Unit)

(Internal) FSM Function onbeforeTroopsRTB.

CTLD.pickupZones

CTLD.prefixes

CTLD.repairtime

CTLD.smokedistance

CTLD.suppressmessages

CTLD.useprefix

CTLD.verbose

Verbosity level.

CTLD.version

CTLD class version.

CTLD.wpZones

Fields and Methods inherited from FSM Description

CTLD:AddEndState(State)

Adds an End state.

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

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

CTLD:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

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

Adds a score for the FSM_PROCESS to be achieved.

CTLD:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

CTLD.CallScheduler

Call scheduler.

CTLD.ClassName

Name of the class.

CTLD.Events

CTLD:GetCurrentState()

Get current state.

CTLD:GetEndStates()

Returns the End states.

CTLD:GetProcess(From, Event)

CTLD:GetProcesses()

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

CTLD:GetScores()

Returns a table with the scores defined.

CTLD:GetStartState()

Returns the start state of the FSM.

CTLD:GetState()

Get current state.

CTLD:GetSubs()

Returns a table with the Subs defined.

CTLD:GetTransitions()

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

CTLD:Is(State, If)

Check if FSM is in state.

CTLD:LoadCallBacks(CallBackTable)

Load call backs.

CTLD:New()

Creates a new FSM object.

CTLD.Scores

Scores.

CTLD:SetProcess(From, Event, Fsm)

CTLD:SetStartState(State)

Sets the start state of the FSM.

CTLD._EndStates

CTLD._EventSchedules

CTLD._Processes

CTLD._Scores

CTLD._StartState

CTLD._Transitions

CTLD:_add_to_map(Map, Event)

Add to map.

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

Call handler.

CTLD:_create_transition(EventName)

Create transition.

CTLD:_delayed_transition(EventName)

Delayed transition.

CTLD:_eventmap(Events, EventStructure)

Event map.

CTLD:_gosub(ParentFrom, ParentEvent)

Go sub.

CTLD:_handler(EventName, ...)

Handler.

CTLD:_isendstate(Current)

Is end state.

CTLD:_submap(subs, sub, name)

Sub maps.

CTLD:can(e)

Check if can do an event.

CTLD:cannot(e)

Check if cannot do an event.

CTLD.current

Current state name.

CTLD.endstates

CTLD:is(State, If, state)

Check if FSM is in state.

CTLD.options

Options.

CTLD.subs

Subs.

Fields and Methods inherited from BASE Description

CTLD.ClassID

The ID number of the class.

CTLD.ClassName

The name of the class.

CTLD.ClassNameAndID

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

CTLD:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

CTLD:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

CTLD:CreateEventDead(EventTime, Initiator)

Creation of a Dead Event.

CTLD:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

CTLD:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

CTLD:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

CTLD:E(Arguments)

Log an exception which will be traced always.

CTLD:EventDispatcher()

Returns the event dispatcher

CTLD:EventRemoveAll()

Remove all subscribed events

CTLD:F(Arguments)

Trace a function call.

CTLD:F2(Arguments)

Trace a function call level 2.

CTLD:F3(Arguments)

Trace a function call level 3.

CTLD:GetClassID()

Get the ClassID of the class instance.

CTLD:GetClassName()

Get the ClassName of the class instance.

CTLD:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

CTLD:GetEventPriority()

Get the Class Event processing Priority.

CTLD:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

CTLD:GetState(Object, Key)

Get a Value given a Key from the Object.

CTLD:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

CTLD:I(Arguments)

Log an information which will be traced always.

CTLD:Inherit(Child, Parent)

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

CTLD:IsInstanceOf(ClassName)

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

CTLD:IsTrace()

Enquires if tracing is on (for the class).

CTLD:New()

BASE constructor.

CTLD:OnEvent(EventData)

Occurs when an object is completely destroyed.

CTLD:OnEventBDA(EventData)

BDA.

CTLD:OnEventBaseCaptured(EventData)

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

CTLD:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

CTLD:OnEventCrash(EventData)

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

CTLD:OnEventDead(EventData)

Occurs when an object is dead.

CTLD:OnEventDetailedFailure(EventData)

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

CTLD:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

CTLD:OnEventEjection(EventData)

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

CTLD:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

CTLD:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

CTLD:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

CTLD:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

CTLD:OnEventKill(EventData)

Occurs on the death of a unit.

CTLD:OnEventLand(EventData)

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

CTLD:OnEventLandingAfterEjection(EventData)

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

CTLD:OnEventLandingQualityMark(EventData)

Landing quality mark.

CTLD:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

CTLD:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

CTLD:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

CTLD:OnEventMissionEnd(EventData)

Occurs when a mission ends

CTLD:OnEventMissionStart(EventData)

Occurs when a mission starts

CTLD:OnEventParatrooperLanding(EventData)

Weapon add.

CTLD:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

CTLD:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

CTLD:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

CTLD:OnEventPlayerLeaveUnit(EventData)

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

CTLD:OnEventRefueling(EventData)

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

CTLD:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

CTLD:OnEventScore(EventData)

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

CTLD:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

CTLD:OnEventShootingStart(EventData)

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

CTLD:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

CTLD:OnEventTakeoff(EventData)

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

CTLD:OnEventTriggerZone(EventData)

Trigger zone.

CTLD:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

CTLD:ScheduleStop(SchedulerFunction)

Stops the Schedule.

CTLD.Scheduler

CTLD:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

CTLD:SetState(Object, Key, Value)

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

CTLD:T(Arguments)

Trace a function logic level 1.

CTLD:T2(Arguments)

Trace a function logic level 2.

CTLD:T3(Arguments)

Trace a function logic level 3.

CTLD:TraceAll(TraceAll)

Trace all methods in MOOSE

CTLD:TraceClass(Class)

Set tracing for a class

CTLD:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

CTLD:TraceLevel(Level)

Set trace level

CTLD:TraceOff()

Set trace off.

CTLD:TraceOn()

Set trace on.

CTLD:TraceOnOff(TraceOnOff)

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

CTLD:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

CTLD._

CTLD:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

CTLD:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

CTLD.__

CTLD:onEvent(event)

Fields and Methods inherited from CTLD.Buildable Description

CTLD.Buildable.CanBuild

Is buildable or not.

CTLD.Buildable.Found

Found crates.

CTLD.Buildable.Name

Name of the object.

CTLD.Buildable.Required

Required crates.

CTLD.Buildable.Template

Template names for this build.

CTLD.Buildable.Type

Type enumerator (for moves).

Fields and Methods inherited from CTLD.CargoZone Description

CTLD.CargoZone.active

Active or not.

CTLD.CargoZone.color

Smoke color for zone, e.g. SMOKECOLOR.Red.

CTLD.CargoZone.fmbeacon

Beacon info as #CTLD.ZoneBeacon

CTLD.CargoZone.hasbeacon

Create and run radio beacons if active.

CTLD.CargoZone.name

Name of Zone.

CTLD.CargoZone.type

Type of zone, i.e. load,drop,move

CTLD.CargoZone.uhfbeacon

Beacon info as #CTLD.ZoneBeacon

CTLD.CargoZone.vhfbeacon

Beacon info as #CTLD.ZoneBeacon

Fields and Methods inherited from CTLD.CargoZoneType Description

CTLD.CargoZoneType.DROP

CTLD.CargoZoneType.LOAD

CTLD.CargoZoneType.MOVE

Fields and Methods inherited from CTLD.LoadedCargo Description

CTLD.LoadedCargo.Cargo

CTLD.LoadedCargo.Cratesloaded

CTLD.LoadedCargo.Troopsloaded

Fields and Methods inherited from CTLD.ZoneBeacon Description

CTLD.ZoneBeacon.frequency

-- in mHz

CTLD.ZoneBeacon.modulation

-- i.e.radio.modulation.FM or radio.modulation.AM

CTLD.ZoneBeacon.name

-- Name of zone for the coordinate

CTLD_CARGO , extends Core.Fsm#FSM , extends Core.Base#BASE
Fields and Methods inherited from CTLD_CARGO Description

CTLD_CARGO:CanLoadDirectly()

Query directly loadable.

CTLD_CARGO.CargoType

CTLD_CARGO.ClassName

CTLD_CARGO.CratesNeeded

Crates needed to build.

CTLD_CARGO.Enum

CTLD_CARGO:GetCratesNeeded()

Query number of crates or troopsize.

CTLD_CARGO:GetID()

Query ID.

CTLD_CARGO:GetName()

Query Name.

CTLD_CARGO:GetPositionable()

Query type.

CTLD_CARGO:GetTemplates()

Query Templates.

CTLD_CARGO:GetType()

Query type.

CTLD_CARGO.HasBeenDropped

True if dropped from heli.

CTLD_CARGO.HasBeenMoved

Flag for moving.

CTLD_CARGO:HasMoved()

Query has moved.

CTLD_CARGO.ID

ID of this cargo.

CTLD_CARGO:IsRepair()

Query crate type for REPAIR

CTLD_CARGO:Isloaded(loaded)

Query if cargo has been loaded.

CTLD_CARGO.LoadDirectly

Flag for direct loading.

CTLD_CARGO.Name

Name for menu.

CTLD_CARGO:New(ID, Name, Templates, Sorte, HasBeenMoved, LoadDirectly, CratesNeeded, Positionable, Dropped, PerCrateMass)

Function to create new CTLD_CARGO object.

CTLD_CARGO.PerCrateMass

Mass in kg

CTLD_CARGO.Positionable

Representation of cargo in the mission.

CTLD_CARGO:SetHasMoved(moved)

Set HasMoved.

CTLD_CARGO:SetWasDropped(dropped)

Set WasDropped.

CTLD_CARGO.Templates

Table of #POSITIONABLE objects.

CTLD_CARGO.Type

Enumerator of Type.

CTLD_CARGO:WasDropped()

Query was dropped.

Fields and Methods inherited from FSM Description

CTLD_CARGO:AddEndState(State)

Adds an End state.

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

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

CTLD_CARGO:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

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

Adds a score for the FSM_PROCESS to be achieved.

CTLD_CARGO:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

CTLD_CARGO.CallScheduler

Call scheduler.

CTLD_CARGO.ClassName

Name of the class.

CTLD_CARGO.Events

CTLD_CARGO:GetCurrentState()

Get current state.

CTLD_CARGO:GetEndStates()

Returns the End states.

CTLD_CARGO:GetProcess(From, Event)

CTLD_CARGO:GetProcesses()

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

CTLD_CARGO:GetScores()

Returns a table with the scores defined.

CTLD_CARGO:GetStartState()

Returns the start state of the FSM.

CTLD_CARGO:GetState()

Get current state.

CTLD_CARGO:GetSubs()

Returns a table with the Subs defined.

CTLD_CARGO:GetTransitions()

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

CTLD_CARGO:Is(State, If)

Check if FSM is in state.

CTLD_CARGO:LoadCallBacks(CallBackTable)

Load call backs.

CTLD_CARGO:New()

Creates a new FSM object.

CTLD_CARGO.Scores

Scores.

CTLD_CARGO:SetProcess(From, Event, Fsm)

CTLD_CARGO:SetStartState(State)

Sets the start state of the FSM.

CTLD_CARGO._EndStates

CTLD_CARGO._EventSchedules

CTLD_CARGO._Processes

CTLD_CARGO._Scores

CTLD_CARGO._StartState

CTLD_CARGO._Transitions

CTLD_CARGO:_add_to_map(Map, Event)

Add to map.

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

Call handler.

CTLD_CARGO:_create_transition(EventName)

Create transition.

CTLD_CARGO:_delayed_transition(EventName)

Delayed transition.

CTLD_CARGO:_eventmap(Events, EventStructure)

Event map.

CTLD_CARGO:_gosub(ParentFrom, ParentEvent)

Go sub.

CTLD_CARGO:_handler(EventName, ...)

Handler.

CTLD_CARGO:_isendstate(Current)

Is end state.

CTLD_CARGO:_submap(subs, sub, name)

Sub maps.

CTLD_CARGO:can(e)

Check if can do an event.

CTLD_CARGO:cannot(e)

Check if cannot do an event.

CTLD_CARGO.current

Current state name.

CTLD_CARGO.endstates

CTLD_CARGO:is(State, If, state)

Check if FSM is in state.

CTLD_CARGO.options

Options.

CTLD_CARGO.subs

Subs.

Fields and Methods inherited from BASE Description

CTLD_CARGO.ClassID

The ID number of the class.

CTLD_CARGO.ClassName

The name of the class.

CTLD_CARGO.ClassNameAndID

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

CTLD_CARGO:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

CTLD_CARGO:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

CTLD_CARGO:CreateEventDead(EventTime, Initiator)

Creation of a Dead Event.

CTLD_CARGO:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

CTLD_CARGO:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

CTLD_CARGO:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

CTLD_CARGO:E(Arguments)

Log an exception which will be traced always.

CTLD_CARGO:EventDispatcher()

Returns the event dispatcher

CTLD_CARGO:EventRemoveAll()

Remove all subscribed events

CTLD_CARGO:F(Arguments)

Trace a function call.

CTLD_CARGO:F2(Arguments)

Trace a function call level 2.

CTLD_CARGO:F3(Arguments)

Trace a function call level 3.

CTLD_CARGO:GetClassID()

Get the ClassID of the class instance.

CTLD_CARGO:GetClassName()

Get the ClassName of the class instance.

CTLD_CARGO:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

CTLD_CARGO:GetEventPriority()

Get the Class Event processing Priority.

CTLD_CARGO:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

CTLD_CARGO:GetState(Object, Key)

Get a Value given a Key from the Object.

CTLD_CARGO:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

CTLD_CARGO:I(Arguments)

Log an information which will be traced always.

CTLD_CARGO:Inherit(Child, Parent)

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

CTLD_CARGO:IsInstanceOf(ClassName)

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

CTLD_CARGO:IsTrace()

Enquires if tracing is on (for the class).

CTLD_CARGO:New()

BASE constructor.

CTLD_CARGO:OnEvent(EventData)

Occurs when an object is completely destroyed.

CTLD_CARGO:OnEventBDA(EventData)

BDA.

CTLD_CARGO:OnEventBaseCaptured(EventData)

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

CTLD_CARGO:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

CTLD_CARGO:OnEventCrash(EventData)

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

CTLD_CARGO:OnEventDead(EventData)

Occurs when an object is dead.

CTLD_CARGO:OnEventDetailedFailure(EventData)

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

CTLD_CARGO:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

CTLD_CARGO:OnEventEjection(EventData)

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

CTLD_CARGO:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

CTLD_CARGO:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

CTLD_CARGO:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

CTLD_CARGO:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

CTLD_CARGO:OnEventKill(EventData)

Occurs on the death of a unit.

CTLD_CARGO:OnEventLand(EventData)

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

CTLD_CARGO:OnEventLandingAfterEjection(EventData)

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

CTLD_CARGO:OnEventLandingQualityMark(EventData)

Landing quality mark.

CTLD_CARGO:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

CTLD_CARGO:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

CTLD_CARGO:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

CTLD_CARGO:OnEventMissionEnd(EventData)

Occurs when a mission ends

CTLD_CARGO:OnEventMissionStart(EventData)

Occurs when a mission starts

CTLD_CARGO:OnEventParatrooperLanding(EventData)

Weapon add.

CTLD_CARGO:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

CTLD_CARGO:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

CTLD_CARGO:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

CTLD_CARGO:OnEventPlayerLeaveUnit(EventData)

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

CTLD_CARGO:OnEventRefueling(EventData)

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

CTLD_CARGO:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

CTLD_CARGO:OnEventScore(EventData)

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

CTLD_CARGO:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

CTLD_CARGO:OnEventShootingStart(EventData)

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

CTLD_CARGO:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

CTLD_CARGO:OnEventTakeoff(EventData)

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

CTLD_CARGO:OnEventTriggerZone(EventData)

Trigger zone.

CTLD_CARGO:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

CTLD_CARGO:ScheduleStop(SchedulerFunction)

Stops the Schedule.

CTLD_CARGO.Scheduler

CTLD_CARGO:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

CTLD_CARGO:SetState(Object, Key, Value)

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

CTLD_CARGO:T(Arguments)

Trace a function logic level 1.

CTLD_CARGO:T2(Arguments)

Trace a function logic level 2.

CTLD_CARGO:T3(Arguments)

Trace a function logic level 3.

CTLD_CARGO:TraceAll(TraceAll)

Trace all methods in MOOSE

CTLD_CARGO:TraceClass(Class)

Set tracing for a class

CTLD_CARGO:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

CTLD_CARGO:TraceLevel(Level)

Set trace level

CTLD_CARGO:TraceOff()

Set trace off.

CTLD_CARGO:TraceOn()

Set trace on.

CTLD_CARGO:TraceOnOff(TraceOnOff)

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

CTLD_CARGO:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

CTLD_CARGO._

CTLD_CARGO:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

CTLD_CARGO:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

CTLD_CARGO.__

CTLD_CARGO:onEvent(event)

  • CTLD class, extends Core.Base#BASE, Core.Fsm#FSM

Field(s)

#table CTLD.Cargo_Crates

Cargo

#string CTLD.ClassName

Name of the class.

#number CTLD.CrateDistance

list/load crates in this radius

#number CTLD.ExtractFactor

factor for troops extraction, i.e. CrateDistance * Extractfactor

#number CTLD.HercMaxAngels

for troop/cargo drop via chute

#number CTLD.HercMaxSpeed

280 kph or 150kn eq 77 mps

#number CTLD.HercMinAngels

for troop/cargo drop via chute

#string CTLD.Name
#table CTLD.PilotGroups

tables

#string CTLD.RadioSound

radio beacons

#number CTLD.coalition

Coalition side number, e.g. coalition.side.RED.

#boolean CTLD.dropcratesanywhere

#1570

#boolean CTLD.enableHercules

added support Hercules Mod

#string CTLD.lid

Class id string for output to DCS log file.

#table CTLD.pickupZones

zones stuff

#number CTLD.repairtime

time to repair a unit/group

#boolean CTLD.suppressmessages

message suppression

#boolean CTLD.useprefix

self.I({prefixes = self.prefixes})

#number CTLD.verbose

Verbosity level.

#string CTLD.version

CTLD class version.

#table CTLD.wpZones

Function(s)

User function - Activate Name #CTLD.CargoZone.Type ZoneType for this CTLD instance.

Defined in:

CTLD

Parameters:

#string Name

Name of the zone to change in the ME.

Type of zone this belongs to.

#boolean NewState

(Optional) Set to true to activate, false to switch off.

User function - Crates and adds a #CTLD.CargoZone zone for this CTLD instance.

Zones of type LOAD: Players load crates and troops here.
Zones of type DROP: Players can drop crates here. Note that troops can be unloaded anywhere.
Zone of type MOVE: Dropped troops and vehicles will start moving to the nearest zone of this type (also see options).

Defined in:

CTLD

Parameters:

#string Name

Name of this zone, as in Mission Editor.

#string Type

Type of this zone, #CTLD.CargoZoneType

#number Color

Smoke/Flare color e.g. #SMOKECOLOR.Red

#string Active

Is this zone currently active?

#string HasBeacon

Does this zone have a beacon if it is active?

Return value:

self

User function - Add generic crate-type loadable as cargo.

This type will create crates that need to be loaded, moved, dropped and built.

Defined in:

CTLD

Parameters:

#string Name

Unique name of this type of cargo. E.g. "Humvee".

#table Templates

Table of #string names of late activated Wrapper.Group#GROUP building this cargo.

Type of cargo. I.e. VEHICLE or FOB. VEHICLE will move to destination zones when dropped/build, FOB stays put.

#number NoCrates

Number of crates needed to build this cargo.

#number PerCrateMass

Mass in kg of each crate

User function - Add generic repair crates loadable as cargo.

This type will create crates that need to be loaded, moved, dropped and built.

Defined in:

CTLD

Parameters:

#string Name

Unique name of this type of cargo. E.g. "Humvee".

#string Template

Template of VEHICLE or FOB cargo that this can repair.

Type of cargo, here REPAIR.

#number NoCrates

Number of crates needed to build this cargo.

#number PerCrateMass

Mass in kg of each crate

User function - Add generic troop type loadable as cargo.

This type will load directly into the heli without crates.

Defined in:

CTLD

Parameters:

#string Name

Unique name of this type of troop. E.g. "Anti-Air Small".

#table Templates

Table of #string names of late activated Wrapper.Group#GROUP making up this troop.

Type of cargo, here TROOPS - these will move to a nearby destination zone when dropped/build.

#number NoTroops

Size of the group in number of Units across combined templates (for loading).

#number PerTroopMass

Mass in kg of each soldier

User function - Add a #CTLD.CargoZoneType zone for this CTLD instance.

Defined in:

CTLD

Parameter:

Zone #CTLD.CargoZone describing the zone.

(Internal) Autoload if we can do crates, have capacity free and are in a load zone.

Defined in:

CTLD

Parameter:

Return value:

self

(Internal) Check if a unit is in a load zone and is hovering in parameters.

Defined in:

CTLD

Parameter:

Return value:

#boolean:

Outcome

(Internal) Run through all pilots and see if we autoload.

Defined in:

CTLD

Return value:

self

(Internal) Run through DroppedTroops and capture alive units

Defined in:

CTLD

Return value:

self

User function - Deactivate Name #CTLD.CargoZoneType ZoneType for this CTLD instance.

Defined in:

CTLD

Parameters:

#string Name

Name of the zone to change in the ME.

Type of zone this belongs to.

(Internal) Check if a Hercules is flying in parameters for air drops.

Defined in:

CTLD

Parameter:

Return value:

#boolean:

Outcome

(Internal) Check if a unit is hovering in parameters.

Defined in:

CTLD

Parameter:

Return value:

#boolean:

Outcome

(Internal) Function to check if a unit is a Hercules C-130.

Defined in:

CTLD

Parameter:

Return value:

#boolean:

Outcome

(Internal) Check if a unit is above ground.

Defined in:

CTLD

Parameter:

Return value:

#boolean:

Outcome

(Internal) Function to see if a unit is in a specific zone type.

Defined in:

CTLD

Parameters:

Unit

Zonetype

Return values:

#boolean:

Outcome Is in zone or not

#string:

name Closest zone name

#string:

zone Closest Core.Zone#ZONE object

#number:

distance Distance to closest zone

Instantiate a new CTLD.

Defined in:

CTLD

Parameters:

#string Coalition

Coalition of this CTLD. I.e. coalition.side.BLUE or coalition.side.RED or coalition.side.NEUTRAL

#table Prefixes

Table of pilot prefixes.

#string Alias

Alias of this CTLD for logging.

Return value:

self

FSM Function OnAfterCratesBuild.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

The #GROUP object of the vehicle or FOB build.

Return value:

self

FSM Function OnAfterCratesDropped.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

#table Cargotable

Table of #CTLD_CARGO objects dropped.

Return value:

self

FSM Function OnAfterCratesPickedUp.

Defined in:

CTLD

Parameters:

#string From

State .

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

#CTLD_CARGO Cargo

Cargo crate.

Return value:

self

FSM Function OnAfterCratesRepaired.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

The #GROUP object of the vehicle or FOB repaired.

Return value:

self

FSM Function OnAfterTroopsDeployed.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

Troops #GROUP Object.

Return value:

self

FSM Function OnAfterTroopsExtracted.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

#CTLD_CARGO Cargo

Cargo troops.

Return value:

self

FSM Function OnAfterTroopsPickedUp.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

#CTLD_CARGO Cargo

Cargo troops.

Return value:

self

FSM Function OnAfterTroopsRTB.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

User function - Start smoke in a zone close to the Unit.

Defined in:

CTLD

Parameters:

The Unit.

#boolean Flare

If true, flare instead.

Triggers the FSM event "Start".

Starts the CTLD. Initializes parameters and starts event handlers.

Defined in:

CTLD

Triggers the FSM event "Status".

Defined in:

CTLD

User - Function to add/adjust unittype capabilities.

Defined in:

CTLD

Parameters:

#string Unittype

The unittype to adjust. If passed as Wrapper.Unit#UNIT, it will search for the unit in the mission.

#boolean Cancrates

Unit can load crates.

#boolean Cantroops

Unit can load troops.

#number Cratelimit

Unit can carry number of crates.

#number Trooplimit

Unit can carry number of troops.

(Internal) Add radio beacon to zone.

Runs 30 secs.

Defined in:

CTLD

Parameters:

#string Name

Name of zone.

#string Sound

Name of soundfile.

#number Mhz

Frequency in Mhz.

#number Modulation

Modulation AM or FM.

(Internal) Function to build nearby crates.

Defined in:

CTLD

Parameters:

(Internal) Function to actually SPAWN buildables in the mission.

Defined in:

CTLD

Parameters:

#boolean Repair

If true this is a repair and not a new build

Location for repair (e.g. where the destroyed unit was)

RepairLocation

(Internal) Housekeeping - Cleanup crates when build

Defined in:

CTLD

Parameters:

#table Crates

Table of #CTLD_CARGO objects near the unit.

Table build object.

#number Number

Number of objects in Crates (found) to limit search.

(Internal) Event handler function

Defined in:

CTLD

Parameter:

(Internal) Function to extract (load from the field) troops into a heli.

Defined in:

CTLD

Parameters:

(Internal) Function to find and return nearby crates.

Defined in:

CTLD

Parameters:

Group

Unit

#number _dist

Distance

Return values:

#table:

Table of crates

#number:

Number Number of crates found

Defined in:

CTLD

Parameters:

Group

Unit

Repairtype

(Internal) Function to generate valid FM Frequencies

Defined in:

CTLD

(Internal) Function to generate valid UHF Frequencies

Defined in:

CTLD

(Internal) Populate table with available VHF beacon frequencies.

Defined in:

CTLD

(Internal) Function to spawn crates in front of the heli.

Defined in:

CTLD

Parameters:

#CTLD_CARGO Cargo

#number number

Number of crates to generate (for dropping)

#boolean drop

If true we're dropping from heli rather than loading.

(Internal) Return distance in meters between two coordinates.

Defined in:

CTLD

Parameters:

Coordinate one

Coordinate two

Return value:

#number:

Distance in meters

(Internal) Function to obtain a valid FM frequency.

Defined in:

CTLD

Parameter:

#string Name

Name of zone.

Return value:

Beacon Beacon table.

(Internal) Function to obtain a valid UHF frequency.

Defined in:

CTLD

Parameter:

#string Name

Name of zone.

Return value:

Beacon Beacon table.

(Internal) Function to get capabilities of a chopper

Defined in:

CTLD

Parameter:

The unit

Return value:

#table:

Capabilities Table of caps

(Internal) Function to get current loaded mass

Defined in:

CTLD

Parameter:

Return value:

#number:

mass in kgs

(Internal) Function to obtain a valid VHF frequency.

Defined in:

CTLD

Parameter:

#string Name

Name of zone.

Return value:

Beacon Beacon table.

(Internal) Function to list loaded cargo.

Defined in:

CTLD

Parameters:

Return value:

self

(Internal) Function to find and list nearby crates.

Defined in:

CTLD

Parameters:

_group

_unit

Return value:

self

(Internal) Function to show list of radio beacons

Defined in:

CTLD

Parameters:

(Internal) Function to get and load nearby crates.

Defined in:

CTLD

Parameters:

Return value:

self

(Internal) Function to load troops into a heli.

Defined in:

CTLD

Parameters:

#CTLD_CARGO Cargotype

(Internal) Function to move group to WP zone.

Defined in:

CTLD

Parameter:

The Group to move.

(Internal) Housekeeping - Function to refresh F10 menus.

Defined in:

CTLD

Return value:

self

(Internal) Function to refresh radio beacons

Defined in:

CTLD

(Internal) Function to repair nearby vehicles / FOBs

Defined in:

CTLD

Parameters:

(Internal) Function to repair an object.

Defined in:

CTLD

Parameters:

#table Crates

Table of #CTLD_CARGO objects near the unit.

Table build object.

#number Number

Number of objects in Crates (found) to limit search.

(Internal) Function to message a group.

Defined in:

CTLD

Parameters:

#string Text

The text to display.

#number Time

Number of seconds to display the message.

#boolean Clearscreen

Clear screen or not.

The group receiving the message.

(Internal) List if a Herc unit is flying in parameters.

Defined in:

CTLD

Parameters:

(Internal) List if a unit is hovering in parameters.

Defined in:

CTLD

Parameters:

(Internal) Function to unload crates from heli.

Defined in:

CTLD

Parameters:

(Internal) Function to unload troops from heli.

Defined in:

CTLD

Parameters:

(Internal) Function to calculate and set Unit internal cargo mass

Defined in:

CTLD

Parameter:

Triggers the FSM event "Start" after a delay.

Starts the CTLD. Initializes parameters and starts event handlers.

Defined in:

CTLD

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Status" after a delay.

Defined in:

CTLD

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Stop" after a delay.

Stops the CTLD and all its event handlers.

Defined in:

CTLD

Parameter:

#number delay

Delay in seconds.

(Internal) FSM Function onafterStart.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Return value:

self

(Internal) FSM Function onafterStatus.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Return value:

self

(Internal) FSM Function onafterStop.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Return value:

self

(Internal) FSM Function onbeforeCratesBuild.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

The #GROUP object of the vehicle or FOB build.

Return value:

self

(Internal) FSM Function onbeforeCratesDropped.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

#table Cargotable

Table of #CTLD_CARGO objects dropped.

Return value:

self

(Internal) FSM Function onbeforeCratesPickedUp.

Defined in:

CTLD

Parameters:

#string From

State .

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

#CTLD_CARGO Cargo

Cargo crate.

Return value:

self

(Internal) FSM Function onbeforeStatus.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Return value:

self

(Internal) FSM Function onbeforeTroopsDeployed.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

Troops #GROUP Object.

Return value:

self

(Internal) FSM Function onbeforeTroopsExtracted.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

Troops #GROUP Object.

Return value:

self

(Internal) FSM Function onbeforeTroopsPickedUp.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

#CTLD_CARGO Cargo

Cargo crate.

Return value:

self

(Internal) FSM Function onbeforeTroopsRTB.

Defined in:

CTLD

Parameters:

#string From

State.

#string Event

Trigger.

#string To

State.

Group Object.

Unit Object.

Return value:

self

Field(s)

#table CTLD.Cargo_Crates

Cargo

#string CTLD.ClassName

Name of the class.

#number CTLD.CrateDistance

list/load crates in this radius

#number CTLD.ExtractFactor

factor for troops extraction, i.e. CrateDistance * Extractfactor

#number CTLD.HercMaxAngels

for troop/cargo drop via chute

#number CTLD.HercMaxSpeed

280 kph or 150kn eq 77 mps

#number CTLD.HercMinAngels

for troop/cargo drop via chute

#string CTLD.Name
#table CTLD.PilotGroups

tables

#string CTLD.RadioSound

radio beacons

#number CTLD.coalition

Coalition side number, e.g. coalition.side.RED.

#boolean CTLD.dropcratesanywhere

#1570

#boolean CTLD.enableHercules

added support Hercules Mod

#string CTLD.lid

Class id string for output to DCS log file.

#table CTLD.pickupZones

zones stuff

#number CTLD.repairtime

time to repair a unit/group

#boolean CTLD.suppressmessages

message suppression

#boolean CTLD.useprefix

self.I({prefixes = self.prefixes})

#number CTLD.verbose

Verbosity level.

#string CTLD.version

CTLD class version.

#table CTLD.wpZones

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

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

Defined in:

Parameters:

#table From

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

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

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

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

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

#string ScoreText

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

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

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

#string ScoreText

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

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

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

Defined in:

Parameters:

#table From

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

#string Event

The Event name.

#string To

The To state.

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:

Parameters:

#string State

State name.

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

#boolean If

true, FSM is in this state.

state

Field(s)

#table CTLD.Cargo_Crates

Cargo

#string CTLD.ClassName

Name of the class.

#number CTLD.CrateDistance

list/load crates in this radius

#number CTLD.ExtractFactor

factor for troops extraction, i.e. CrateDistance * Extractfactor

#number CTLD.HercMaxAngels

for troop/cargo drop via chute

#number CTLD.HercMaxSpeed

280 kph or 150kn eq 77 mps

#number CTLD.HercMinAngels

for troop/cargo drop via chute

#string CTLD.Name
#table CTLD.PilotGroups

tables

#string CTLD.RadioSound

radio beacons

#number CTLD.coalition

Coalition side number, e.g. coalition.side.RED.

#boolean CTLD.dropcratesanywhere

#1570

#boolean CTLD.enableHercules

added support Hercules Mod

#string CTLD.lid

Class id string for output to DCS log file.

#table CTLD.pickupZones

zones stuff

#number CTLD.repairtime

time to repair a unit/group

#boolean CTLD.suppressmessages

message suppression

#boolean CTLD.useprefix

self.I({prefixes = self.prefixes})

#number CTLD.verbose

Verbosity level.

#string CTLD.version

CTLD class version.

#table CTLD.wpZones

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

Creation of a Remove Unit Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Takeoff Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Log an exception which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#string:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

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

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the Class Event processing Priority.

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

Defined in:

Return value:

#number:

The Event processing Priority.

This is the worker method to retrieve the Parent class.

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

self:GetParent(self):ParentMethod()


Defined in:

Parameters:

#BASE Child

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

#BASE FromClass

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

Return value:

Get a Value given a Key from the Object.

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

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

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

Return value:

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

Subscribe to a DCS Event.

Defined in:

Parameters:

Event ID.

#function EventFunction

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

Return value:

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

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

Defined in:

Parameters:

Child

is the Child class that inherits.

#BASE Parent

is the Parent class that the Child inherits from.

Return value:

Child

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

Examples:

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

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

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

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

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

Defined in:

Parameter:

ClassName

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

Return value:

#boolean:

Enquires if tracing is on (for the class).

Defined in:

Return value:

#boolean:

BASE constructor.

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

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

Defined in:

Return value:

Occurs when an object is completely destroyed.

initiator : The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

BDA.

Defined in:

Parameter:

The EventData structure.

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

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

Defined in:

Parameter:

The EventData structure.

Occurs when any object is spawned into the mission.

initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

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

initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

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

Will update this page when new information become available.

  • initiator: The unit that had the failure.

Defined in:

Parameter:

The EventData structure.

Discard chair after ejection.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

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

Defined in:

Parameter:

The EventData structure.

Occurs when any system fails on a human controlled aircraft.

initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs on the death of a unit.

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

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

Defined in:

Parameter:

The EventData structure.

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

Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

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

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

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

Defined in:

Parameter:

The EventData structure.

Landing quality mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted.

Defined in:

Parameter:

The EventData structure.

Occurs when the pilot of an aircraft is killed.

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

Defined in:

Parameter:

The EventData structure.

Occurs when a player enters a slot and takes control of an aircraft.

NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

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

initiator : The unit that the player left.

Defined in:

Parameter:

The EventData structure.

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

initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

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

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

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

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

Defined in:

Parameter:

The EventData structure.

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

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

Defined in:

Parameter:

The EventData structure.

Occurs whenever any unit in a mission fires a weapon.

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

Defined in:

Parameter:

The EventData structure.

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

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

Defined in:

Parameter:

The EventData structure.

Trigger zone.

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

  • initiator: The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Schedule a new time event.

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

Defined in:

Parameters:

#number Start

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

#function SchedulerFunction

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

#table ...

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

Return value:

#number:

The ScheduleID of the planned schedule.

Schedule a new time event.

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

Defined in:

Parameters:

#number Start

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

#number Repeat

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

#number RandomizeFactor

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

#number Stop

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

#function SchedulerFunction

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

#table ...

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

Return value:

#number:

The ScheduleID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#function SchedulerFunction

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

Set the Class Event processing Priority.

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

Defined in:

Parameter:

#number EventPriority

The Event processing Priority.

Return value:

self

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

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

Defined in:

Parameters:

Object

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

Key

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

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

true = trace all methods in MOOSE.

Set tracing for a class

Defined in:

Parameter:

#string Class

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

#string Method

Set trace level

Defined in:

Parameter:

#number Level

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

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

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

Defined in:

Parameter:

#boolean TraceOnOff

Switch the tracing on or off.

Usage:

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

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

UnSubscribe to a DCS event.

Defined in:

Parameter:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

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

Defined in:

Parameter:

event

Buildable table info.

Field(s)

#boolean CTLD.Buildable.CanBuild

Is buildable or not.

#number CTLD.Buildable.Found

Found crates.

#string CTLD.Buildable.Name

Name of the object.

#number CTLD.Buildable.Required

Required crates.

#table CTLD.Buildable.Template

Template names for this build.

#CTLD_CARGO.Enum CTLD.Buildable.Type

Type enumerator (for moves).

Function(s)

Zone Info.

Field(s)

#boolean CTLD.CargoZone.active

Active or not.

#string CTLD.CargoZone.color

Smoke color for zone, e.g. SMOKECOLOR.Red.

#table CTLD.CargoZone.fmbeacon

Beacon info as #CTLD.ZoneBeacon

#boolean CTLD.CargoZone.hasbeacon

Create and run radio beacons if active.

#string CTLD.CargoZone.name

Name of Zone.

#string CTLD.CargoZone.type

Type of zone, i.e. load,drop,move

#table CTLD.CargoZone.uhfbeacon

Beacon info as #CTLD.ZoneBeacon

#table CTLD.CargoZone.vhfbeacon

Beacon info as #CTLD.ZoneBeacon

Function(s)

Zone Type Info.

Field(s)

Function(s)

Radio Beacons

Field(s)

#number CTLD.ZoneBeacon.frequency

-- in mHz

#number CTLD.ZoneBeacon.modulation

-- i.e.radio.modulation.FM or radio.modulation.AM

#string CTLD.ZoneBeacon.name

-- Name of zone for the coordinate

Function(s)

  • CTLD_CARGO class, extends #Core.Base#BASE

Field(s)

#number CTLD_CARGO.CratesNeeded

Crates needed to build.

#boolean CTLD_CARGO.HasBeenDropped

True if dropped from heli.

#boolean CTLD_CARGO.HasBeenMoved

Flag for moving.

#number CTLD_CARGO.ID

ID of this cargo.

#boolean CTLD_CARGO.LoadDirectly

Flag for direct loading.

#string CTLD_CARGO.Name

Name for menu.

#number CTLD_CARGO.PerCrateMass

Mass in kg

Wrapper.Positionable#POSITIONABLE CTLD_CARGO.Positionable

Representation of cargo in the mission.

#table CTLD_CARGO.Templates

Table of #POSITIONABLE objects.

#CTLD_CARGO.Enum CTLD_CARGO.Type

Enumerator of Type.

Function(s)

Query directly loadable.

Defined in:

CTLD_CARGO

Return value:

#boolean:

loadable

Query number of crates or troopsize.

Defined in:

CTLD_CARGO

Return value:

#number:

Crates or size of troops.

Query ID.

Defined in:

CTLD_CARGO

Return value:

#number:

ID

Query Name.

Defined in:

CTLD_CARGO

Return value:

#string:

Name

Query type.

Defined in:

CTLD_CARGO

Return value:

Query Templates.

Defined in:

CTLD_CARGO

Return value:

#table:

Templates

Query type.

Defined in:

CTLD_CARGO

Return value:

Query has moved.

Defined in:

CTLD_CARGO

Return value:

#boolean:

Has moved

Query crate type for REPAIR

Defined in:

CTLD_CARGO

Query if cargo has been loaded.

Defined in:

CTLD_CARGO

Parameter:

#boolean loaded

Function to create new CTLD_CARGO object.

Defined in:

CTLD_CARGO

Parameters:

#number ID

ID of this #CTLD_CARGO

#string Name

Name for menu.

#table Templates

Table of #POSITIONABLE objects.

Enumerator of Type.

#boolean HasBeenMoved

Flag for moving.

#boolean LoadDirectly

Flag for direct loading.

#number CratesNeeded

Crates needed to build.

Representation of cargo in the mission.

#boolean Dropped

Cargo/Troops have been unloaded from a chopper.

#number PerCrateMass

Mass in kg

Return value:

self

Set HasMoved.

Defined in:

CTLD_CARGO

Parameter:

#boolean moved

Set WasDropped.

Defined in:

CTLD_CARGO

Parameter:

#boolean dropped

Query was dropped.

Defined in:

CTLD_CARGO

Return value:

#boolean:

Has been dropped.

Field(s)

#number CTLD_CARGO.CratesNeeded

Crates needed to build.

#boolean CTLD_CARGO.HasBeenDropped

True if dropped from heli.

#boolean CTLD_CARGO.HasBeenMoved

Flag for moving.

#number CTLD_CARGO.ID

ID of this cargo.

#boolean CTLD_CARGO.LoadDirectly

Flag for direct loading.

#string CTLD_CARGO.Name

Name for menu.

#number CTLD_CARGO.PerCrateMass

Mass in kg

Wrapper.Positionable#POSITIONABLE CTLD_CARGO.Positionable

Representation of cargo in the mission.

#table CTLD_CARGO.Templates

Table of #POSITIONABLE objects.

#CTLD_CARGO.Enum CTLD_CARGO.Type

Enumerator of Type.

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

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

Defined in:

Parameters:

#table From

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

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

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

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

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

#string ScoreText

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

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

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

#string ScoreText

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

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

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

Defined in:

Parameters:

#table From

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

#string Event

The Event name.

#string To

The To state.

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:

Parameters:

#string State

State name.

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

#boolean If

true, FSM is in this state.

state

Field(s)

#number CTLD_CARGO.CratesNeeded

Crates needed to build.

#boolean CTLD_CARGO.HasBeenDropped

True if dropped from heli.

#boolean CTLD_CARGO.HasBeenMoved

Flag for moving.

#number CTLD_CARGO.ID

ID of this cargo.

#boolean CTLD_CARGO.LoadDirectly

Flag for direct loading.

#string CTLD_CARGO.Name

Name for menu.

#number CTLD_CARGO.PerCrateMass

Mass in kg

Wrapper.Positionable#POSITIONABLE CTLD_CARGO.Positionable

Representation of cargo in the mission.

#table CTLD_CARGO.Templates

Table of #POSITIONABLE objects.

#CTLD_CARGO.Enum CTLD_CARGO.Type

Enumerator of Type.

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

Creation of a Remove Unit Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Takeoff Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Log an exception which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#string:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

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

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the Class Event processing Priority.

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

Defined in:

Return value:

#number:

The Event processing Priority.

This is the worker method to retrieve the Parent class.

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

self:GetParent(self):ParentMethod()


Defined in:

Parameters:

#BASE Child

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

#BASE FromClass

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

Return value:

Get a Value given a Key from the Object.

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

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

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

Return value:

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

Subscribe to a DCS Event.

Defined in:

Parameters:

Event ID.

#function EventFunction

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

Return value:

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

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

Defined in:

Parameters:

Child

is the Child class that inherits.

#BASE Parent

is the Parent class that the Child inherits from.

Return value:

Child

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

Examples:

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

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

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

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

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

Defined in:

Parameter:

ClassName

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

Return value:

#boolean:

Enquires if tracing is on (for the class).

Defined in:

Return value:

#boolean:

BASE constructor.

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

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

Defined in:

Return value:

Occurs when an object is completely destroyed.

initiator : The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

BDA.

Defined in:

Parameter:

The EventData structure.

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

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

Defined in:

Parameter:

The EventData structure.

Occurs when any object is spawned into the mission.

initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

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

initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

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

Will update this page when new information become available.

  • initiator: The unit that had the failure.

Defined in:

Parameter:

The EventData structure.

Discard chair after ejection.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

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

Defined in:

Parameter:

The EventData structure.

Occurs when any system fails on a human controlled aircraft.

initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs on the death of a unit.

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

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

Defined in:

Parameter:

The EventData structure.

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

Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

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

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

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

Defined in:

Parameter:

The EventData structure.

Landing quality mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted.

Defined in:

Parameter:

The EventData structure.

Occurs when the pilot of an aircraft is killed.

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

Defined in:

Parameter:

The EventData structure.

Occurs when a player enters a slot and takes control of an aircraft.

NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

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

initiator : The unit that the player left.

Defined in:

Parameter:

The EventData structure.

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

initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

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

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

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

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

Defined in:

Parameter:

The EventData structure.

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

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

Defined in:

Parameter:

The EventData structure.

Occurs whenever any unit in a mission fires a weapon.

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

Defined in:

Parameter:

The EventData structure.

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

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

Defined in:

Parameter:

The EventData structure.

Trigger zone.

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

  • initiator: The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Schedule a new time event.

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

Defined in:

Parameters:

#number Start

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

#function SchedulerFunction

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

#table ...

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

Return value:

#number:

The ScheduleID of the planned schedule.

Schedule a new time event.

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

Defined in:

Parameters:

#number Start

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

#number Repeat

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

#number RandomizeFactor

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

#number Stop

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

#function SchedulerFunction

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

#table ...

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

Return value:

#number:

The ScheduleID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#function SchedulerFunction

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

Set the Class Event processing Priority.

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

Defined in:

Parameter:

#number EventPriority

The Event processing Priority.

Return value:

self

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

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

Defined in:

Parameters:

Object

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

Key

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

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

true = trace all methods in MOOSE.

Set tracing for a class

Defined in:

Parameter:

#string Class

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

#string Method

Set trace level

Defined in:

Parameter:

#number Level

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

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

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

Defined in:

Parameter:

#boolean TraceOnOff

Switch the tracing on or off.

Usage:

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

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

UnSubscribe to a DCS event.

Defined in:

Parameter:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

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

Defined in:

Parameter:

event

Define cargo types.

Field(s)

#string CTLD_CARGO.Enum.Type

Type of Cargo.

Function(s)