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!!)
Repack addition for crates: Raiden
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) CTLD Concept
|
Combat Troop & Logistics Deployment (CTLD): Everyone wants to be a POG, until there's POG stuff to be done. (Mil Saying)
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, crates, which have to be build on-location, or static like ammo chests.
- Option to persist (save&load) your dropped troops, crates and vehicles.
- Weight checks on loaded cargo.
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, that will make up your deployable forces.
Example sound files are here: Moose Sound
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. No weight. We only have 2 in stock:
my_ctld:AddTroopsCargo("Anti-Air",{"AA","AA2"},CTLD_CARGO.Enum.TROOPS,4,nil,2)
-- add an engineers unit called "Wrenches" using template "Engineers", of type ENGINEERS with size 2. Engineers can be loaded, dropped,
-- and extracted like troops. However, they will seek to build and/or repair crates found in a given radius. Handy if you can\'t stay
-- to build or repair or under fire.
my_ctld:AddTroopsCargo("Wrenches",{"Engineers"},CTLD_CARGO.Enum.ENGINEERS,4)
myctld.EngineerSearch = 2000 -- teams will search for crates in this radius.
-- 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**. Fly carefully.
my_ctld:AddCratesCargo("Humvee",{"Humvee"},CTLD_CARGO.Enum.VEHICLE,2,2775)
-- if you want to limit your stock, add a number (here: 10) as parameter after weight. No parameter / nil means unlimited stock.
my_ctld:AddCratesCargo("Humvee",{"Humvee"},CTLD_CARGO.Enum.VEHICLE,2,2775,10)
-- additionally, you can limit **where** the stock is available (one location only!) - this one is available in a zone called "Vehicle Store".
my_ctld:AddCratesCargo("Humvee",{"Humvee"},CTLD_CARGO.Enum.VEHICLE,2,2775,10,nil,nil,"Vehicle Store")
-- 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,
-- e.g. the "Humvee" here refers back to the "Humvee" crates cargo added above (same template!)
my_ctld:AddCratesRepair("Humvee Repair","Humvee",CTLD_CARGO.Enum.REPAIR,1)
my_ctld.repairtime = 300 -- takes 300 seconds to repair something
-- add static cargo objects, e.g ammo chests - the name needs to refer to a STATIC object in the mission editor,
-- here: it\'s the UNIT name (not the GROUP name!), the second parameter is the weight in kg.
my_ctld:AddStaticsCargo("Ammunition",500)
1.3 Add logistics zones
Add (normal, round!) zones for loading troops and crates and dropping, building crates
-- Add a zone of type LOAD to our setup. Players can load any troops and crates here as defined in 1.2 above.
-- "Loadzone" is the name of the zone from the ME. Players can load, if they are inside 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)
-- Add a zone of type SHIP to our setup. Players can load troops and crates from this ship
-- "Tarawa" is the unitname (callsign) of the ship from the ME. Players can load, if they are inside the zone.
-- The ship is 240 meters long and 20 meters wide.
-- Note that you need to adjust the max hover height to deck height plus 5 meters or so for loading to work.
-- When the ship is moving, avoid forcing hoverload.
my_ctld:AddCTLDZone("Tarawa",CTLD.CargoZoneType.SHIP,SMOKECOLOR.Blue,true,true,240,20)
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 = 35 -- List and Load crates in this radius only.
my_ctld.PackDistance = 35 -- Pack crates in this radius only
my_ctld.dropcratesanywhere = false -- Option to allow crates to be dropped anywhere.
my_ctld.dropAsCargoCrate = false -- Parachuted herc cargo is not unpacked automatically but placed as crate to be unpacked. Needs a cargo with the same name defined like the cargo that was dropped.
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.
my_ctld.buildtime = 300 -- Number of seconds it takes to build a unit. Set to zero or nil to build instantly.
my_ctld.cratecountry = country.id.GERMANY -- ID of crates. Will default to country.id.RUSSIA for RED coalition setups.
my_ctld.allowcratepickupagain = true -- allow re-pickup crates that were dropped.
my_ctld.enableslingload = false -- allow cargos to be slingloaded - might not work for all cargo types
my_ctld.pilotmustopendoors = false -- force opening of doors
my_ctld.SmokeColor = SMOKECOLOR.Red -- default color to use when dropping smoke from heli
my_ctld.FlareColor = FLARECOLOR.Red -- color to use when flaring from heli
my_ctld.basetype = "container_cargo" -- default shape of the cargo container
my_ctld.droppedbeacontimeout = 600 -- dropped beacon lasts 10 minutes
my_ctld.usesubcats = false -- use sub-category names for crates, adds an extra menu layer in "Get Crates", useful if you have > 10 crate types.
my_ctld.placeCratesAhead = false -- place crates straight ahead of the helicopter, in a random way. If true, crates are more neatly sorted.
my_ctld.nobuildinloadzones = true -- forbid players to build stuff in LOAD zones if set to `true`
my_ctld.movecratesbeforebuild = true -- crates must be moved once before they can be build. Set to false for direct builds.
my_ctld.surfacetypes = {land.SurfaceType.LAND,land.SurfaceType.ROAD,land.SurfaceType.RUNWAY,land.SurfaceType.SHALLOW_WATER} -- surfaces for loading back objects.
my_ctld.nobuildmenu = false -- if set to true effectively enforces to have engineers build/repair stuff for you.
my_ctld.RadioSound = "beacon.ogg" -- -- this sound will be hearable if you tune in the beacon frequency. Add the sound file to your miz.
my_ctld.RadioSoundFC3 = "beacon.ogg" -- this sound will be hearable by FC3 users (actually all UHF radios); change to something like "beaconsilent.ogg" and add the sound file to your miz if you don't want to annoy FC3 pilots.
my_ctld.enableChinookGCLoading = true -- this will effectively suppress the crate load and drop for CTLD_CARGO.Enum.STATIc types for CTLD for the Chinook
my_ctld.TroopUnloadDistGround = 5 -- If hovering, spawn dropped troops this far away in meters from the helo
my_ctld.TroopUnloadDistHover = 1.5 -- If grounded, spawn dropped troops this far away in meters from the helo
my_ctld.TroopUnloadDistGroundHerc = 25 -- On the ground, unload troops this far behind the Hercules
my_ctld.TroopUnloadDistGroundHook = 15 -- On the ground, unload troops this far behind the Chinook
2.1 CH-47 Chinook support
The Chinook comes with the option to use the ground crew menu to load and unload cargo into the Helicopter itself for better immersion. As well, it can sling-load cargo from ground. The cargo you can actually create from this menu is limited to contain items from the airbase or FARP's resources warehouse and can take a number of shapes (static shapes in the category of cargo) independent of their contents. If you unload this kind of cargo with the ground crew, the contents will be "absorbed" into the airbase or FARP you landed at, and the cargo static will be removed after ca 2 mins.
2.1.1 Moose CTLD created crate cargo
Given the correct shape, Moose created cargo can be either loaded with the ground crew or via the F10 CTLD menu. It is strongly recommend to either use the ground crew or CTLD to load/unload Moose created cargo. Mix and match will not work here. Static shapes loadable into the Chinook are at the time of writing:
* Ammo crate (type "ammo_cargo")
* M117 bomb crate (type name "m117_cargo")
* Dual shell fuel barrels (type name "barrels")
* UH-1H net (type name "uh1h_cargo")
All other kinds of cargo can be sling-loaded.
2.1.2 Recommended settings
my_ctld.basetype = "ammo_cargo"
my_ctld.forcehoverload = false -- no hover autoload, leads to cargo complications with ground crew created cargo items
my_ctld.pilotmustopendoors = true -- crew must open back loading door 50% (horizontal) or more
my_ctld.enableslingload = true -- will set cargo items as sling-loadable
my_ctld.enableChinookGCLoading = true -- will effectively suppress the crate load and drop menus for CTLD for the Chinook
my_ctld.movecratesbeforebuild = false -- cannot detect movement of crates at the moment
my_ctld.nobuildinloadzones = true -- don't build where you load.
my_ctld.ChinookTroopCircleRadius = 5 -- Radius for troops dropping in a nice circle. Adjust to your planned squad size for the Chinook.
2.2 User functions
2.2.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, up to 4000 kgs:
my_ctld:SetUnitCapabilities("SA342L", true, true, 8, 8, 12, 4000)
-- Default unit type capabilities are:
["SA342Mistral"] = {type="SA342Mistral", crates=false, troops=true, cratelimit = 0, trooplimit = 4, length = 12, cargoweightlimit = 400},
["SA342L"] = {type="SA342L", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 12, cargoweightlimit = 400},
["SA342M"] = {type="SA342M", crates=false, troops=true, cratelimit = 0, trooplimit = 4, length = 12, cargoweightlimit = 400},
["SA342Minigun"] = {type="SA342Minigun", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 12, cargoweightlimit = 400},
["UH-1H"] = {type="UH-1H", crates=true, troops=true, cratelimit = 1, trooplimit = 8, length = 15, cargoweightlimit = 700},
["Mi-8MT"] = {type="Mi-8MT", crates=true, troops=true, cratelimit = 2, trooplimit = 12, length = 15, cargoweightlimit = 3000},
["Mi-8MTV2"] = {type="Mi-8MTV2", crates=true, troops=true, cratelimit = 2, trooplimit = 12, length = 15, cargoweightlimit = 3000},
["Ka-50"] = {type="Ka-50", crates=false, troops=false, cratelimit = 0, trooplimit = 0, length = 15, cargoweightlimit = 0},
["Mi-24P"] = {type="Mi-24P", crates=true, troops=true, cratelimit = 2, trooplimit = 8, length = 18, cargoweightlimit = 700},
["Mi-24V"] = {type="Mi-24V", crates=true, troops=true, cratelimit = 2, trooplimit = 8, length = 18, cargoweightlimit = 700},
["Hercules"] = {type="Hercules", crates=true, troops=true, cratelimit = 7, trooplimit = 64, length = 25, cargoweightlimit = 19000},
["UH-60L"] = {type="UH-60L", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500},
["AH-64D_BLK_II"] = {type="AH-64D_BLK_II", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 17, cargoweightlimit = 200},
["MH-60R"] = {type="MH-60R", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
["SH-60B"] = {type="SH-60B", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats
["Bronco-OV-10A"] = {type="Bronco-OV-10A", crates= false, troops=true, cratelimit = 0, trooplimit = 5, length = 13, cargoweightlimit = 1450},
["Bronco-OV-10A"] = {type="Bronco-OV-10A", crates= false, troops=true, cratelimit = 0, trooplimit = 5, length = 13, cargoweightlimit = 1450},
["OH-6A"] = {type="OH-6A", crates=false, troops=true, cratelimit = 0, trooplimit = 4, length = 7, cargoweightlimit = 550},
["OH58D"] = {type="OH58D", crates=false, troops=false, cratelimit = 0, trooplimit = 0, length = 14, cargoweightlimit = 400},
["CH-47Fbl1"] = {type="CH-47Fbl1", crates=true, troops=true, cratelimit = 4, trooplimit = 31, length = 20, cargoweightlimit = 8000},
2.2.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)
2.2.3 Limit and manage available resources
When adding generic cargo types, you can effectively limit how many units can be dropped/build by the players, e.g.
-- if you want to limit your stock, add a number (here: 10) as parameter after weight. No parameter / nil means unlimited stock.
my_ctld:AddCratesCargo("Humvee",{"Humvee"},CTLD_CARGO.Enum.VEHICLE,2,2775,10)
You can manually add or remove the available stock like so:
-- Crates
my_ctld:AddStockCrates("Humvee", 2)
my_ctld:RemoveStockCrates("Humvee", 2)
-- Troops
my_ctld:AddStockTroops("Anti-Air", 2)
my_ctld:RemoveStockTroops("Anti-Air", 2)
Notes: Troops dropped back into a LOAD zone will effectively be added to the stock. Crates lost in e.g. a heli crash are just that - lost.
2.2.4 Create own SET_GROUP to manage CTLD Pilot groups
-- Parameter: Set The SET_GROUP object created by the mission designer/user to represent the CTLD pilot groups.
-- Needs to be set before starting the CTLD instance.
local myset = SET_GROUP:New():FilterPrefixes("Helikopter"):FilterCoalitions("red"):FilterStart()
my_ctld:SetOwnSetPilotGroups(myset)
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)
my_scoring = SCORING:New("Combat Transport")
function CTLD_Cargotransport:OnAfterCratesDropped(From, Event, To, Group, Unit, Cargotable)
local points = 10
if Unit then
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
end
function CTLD_Cargotransport:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle)
local points = 5
if Unit then
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
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 or drop smoke, beacon or flare from Heli
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.
4.7 List Inventory
Lists invetory of available units to drop or build.
5. Support for Hercules mod by Anubis
Basic support for the Hercules mod By Anubis has been build into CTLD - that is you can load/drop/build the same way and for the same objects as
the helicopters (main method).
To cover objects and troops which can be loaded from the groud crew Rearm/Refuel menu (F8), you need to use CTLD_HERCULES.New() and link
this object to your CTLD setup (alternative method). In this case, do not use the Hercules_Cargo.lua
or Hercules_Cargo_CTLD.lua
which are part of the mod
in your mission!
5.1 Create an own CTLD instance and allow the usage of the Hercules mod (main method)
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
Hint: you can only airdrop from the Hercules if you are "in parameters", i.e. at or below HercMaxSpeed
and in the AGL bracket between
HercMinAngels
and HercMaxAngels
!
Also, the following options need to be set to true
:
my_ctld.useprefix = true -- this is true by default and MUST BE ON.
5.2 Integrate Hercules ground crew (F8 Menu) loadable objects (alternative method, use either the above OR this method, NOT both!)
Integrate to your CTLD instance like so, where my_ctld
is a previously created CTLD instance:
my_ctld.enableHercules = false -- avoid dual loading via CTLD F10 and F8 ground crew
local herccargo = CTLD_HERCULES:New("blue", "Hercules Test", my_ctld)
You also need:
- A template called "Infantry" for 10 Paratroopers (as set via herccargo.infantrytemplate).
- Depending on what you are loading with the help of the ground crew, there are 42 more templates for the various vehicles that are loadable.
There's a quick check output in the dcs.log
which tells you what's there and what not.
E.g.:
...Checking template for APC BTR-82A Air [24998lb] (BTR-82A) ... MISSING)
...Checking template for ART 2S9 NONA Skid [19030lb] (SAU 2-C9) ... MISSING)
...Checking template for EWR SBORKA Air [21624lb] (Dog Ear radar) ... MISSING)
...Checking template for Transport Tigr Air [15900lb] (Tigr_233036) ... OK)
Expected template names are the ones in the rounded brackets.
5.2.1 Hints
The script works on the EVENTS.Shot trigger, which is used by the mod when you drop cargo from the Hercules while flying. Unloading on the ground does not achieve anything here. If you just want to unload on the ground, use the normal Moose CTLD (see 5.1).
DO NOT use the "splash damage" script together with this method! Your cargo will explode on the ground!
There are two ways of airdropping:
1) Very low and very slow (>5m and <10m AGL) - here you can drop stuff which has "Skid" at the end of the cargo name (loaded via F8 Ground Crew menu)
2) Higher up and slow (>100m AGL) - here you can drop paratroopers and cargo which has "Air" at the end of the cargo name (loaded via F8 Ground Crew menu)
Standard transport capabilities as per the real Hercules are:
["Hercules"] = {type="Hercules", crates=true, troops=true, cratelimit = 7, trooplimit = 64}, -- 19t cargo, 64 paratroopers
5.3 Don't automatically unpack dropped cargo but drop as CTLD_CARGO
Cargo can be defined to be automatically dropped as crates.
my_ctld.dropAsCargoCrate = true -- default is false
The idea is, to have those crate behave like brought in with a helo. So any unpack restictions apply. To enable those cargo drops, the cargo types must be added manually in the CTLD configuration. So when the above defined template for "Vulcan" should be used as CTLD_Cargo, the following line has to be added. NoCrates, PerCrateMass, Stock, SubCategory can be configured freely.
my_ctld:AddCratesCargo("Vulcan", {"Vulcan"}, CTLD_CARGO.Enum.VEHICLE, 6, 2000, nil, "SAM/AAA")
So if the Vulcan in the example now needs six crates to complete, you have to bring two Hercs with three Vulcan crates each and drop them very close together...
6. Save and load back units - persistance
You can save and later load back units dropped or build to make your mission persistent. For this to work, you need to de-sanitize io and lfs in your MissionScripting.lua, which is located in your DCS installtion folder under Scripts. There is a risk involved in doing that; if you do not know what that means, this is possibly not for you.
Use the following options to manage your saves:
my_ctld.enableLoadSave = true -- allow auto-saving and loading of files
my_ctld.saveinterval = 600 -- save every 10 minutes
my_ctld.filename = "missionsave.csv" -- example filename
my_ctld.filepath = "C:\\Users\\myname\\Saved Games\\DCS\Missions\\MyMission" -- example path
my_ctld.eventoninject = true -- fire OnAfterCratesBuild and OnAfterTroopsDeployed events when loading (uses Inject functions)
my_ctld.useprecisecoordloads = true -- Instead if slightly varyiing the group position, try to maintain it as is
Then use an initial load at the beginning of your mission:
my_ctld:__Load(10)
Caveat: If you use units build by multiple templates, they will effectively double on loading. Dropped crates are not saved. Current stock is not saved.
7. Complex example - Build a complete FARP from a CTLD crate drop
Prerequisites - you need to add a cargo of type FOB to your CTLD instance, for simplification reasons we call it FOB:
my_ctld:AddCratesCargo("FARP",{"FOB"},CTLD_CARGO.Enum.FOB,2)
The following code will build a FARP at the coordinate the FOB was dropped and built (the UTILS function used below does not need a template for the statics):
-- FARP Radio. First one has 130AM name London, next 131 name Dallas, and so forth.
local FARPFreq = 129
local FARPName = 1 --numbers 1..10
local FARPClearnames = {
[1]="London",
[2]="Dallas",
[3]="Paris",
[4]="Moscow",
[5]="Berlin",
[6]="Rome",
[7]="Madrid",
[8]="Warsaw",
[9]="Dublin",
[10]="Perth",
}
function BuildAFARP(Coordinate)
local coord = Coordinate --Core.Point#COORDINATE
local FarpNameNumber = ((FARPName-1)%10)+1 -- make sure 11 becomes 1 etc
local FName = FARPClearnames[FarpNameNumber] -- get clear namee
FARPFreq = FARPFreq + 1
FARPName = FARPName + 1
FName = FName .. " FAT COW "..tostring(FARPFreq).."AM" -- make name unique
-- Get a Zone for loading
local ZoneSpawn = ZONE_RADIUS:New("FARP "..FName,Coordinate:GetVec2(),150,false)
-- Spawn a FARP with our little helper and fill it up with resources (10t fuel each type, 10 pieces of each known equipment)
UTILS.SpawnFARPAndFunctionalStatics(FName,Coordinate,ENUMS.FARPType.INVISIBLE,my_ctld.coalition,country.id.USA,FarpNameNumber,FARPFreq,radio.modulation.AM,nil,nil,nil,10,10)
-- add a loadzone to CTLD
my_ctld:AddCTLDZone("FARP "..FName,CTLD.CargoZoneType.LOAD,SMOKECOLOR.Blue,true,true)
local m = MESSAGE:New(string.format("FARP %s in operation!",FName),15,"CTLD"):ToBlue()
end
function my_ctld:OnAfterCratesBuild(From,Event,To,Group,Unit,Vehicle)
local name = Vehicle:GetName()
if string.find(name,"FOB",1,true) then
local Coord = Vehicle:GetCoordinate()
Vehicle:Destroy(false)
BuildAFARP(Coord)
end
end
Global CTLD_CARGO |
Global CTLD_ENGINEERING |
Global CTLD_HERCULES |
Type(s)
Fields and Methods inherited from CTLD | Description |
---|---|
User function - Activate Name #CTLD.CargoZone.Type ZoneType for this CTLD instance. |
|
CTLD:AddCTLDZone(Name, Type, Color, Active, HasBeacon, Shiplength, Shipwidth) |
User function - Creates and adds a #CTLD.CargoZone zone for this CTLD instance. |
CTLD:AddCTLDZoneFromAirbase(AirbaseName, Type, Color, Active, HasBeacon) |
User function - Creates and adds a #CTLD.CargoZone zone for this CTLD instance from an Airbase or FARP name. |
User function - Add generic crate-type loadable as cargo. |
|
User function - Add generic repair crates loadable as cargo. |
|
(User) Add a PLAYERTASK - FSM events will check success |
|
CTLD:AddStaticsCargo(Name, Mass, Stock, SubCategory, DontShowInMenu, Location) |
User function - Add generic static-type loadable as cargo. |
User - function to add stock of a certain crates type |
|
User - function to add stock of a certain crates type |
|
User - function to add stock of a certain troops type |
|
CTLD:AddTroopsCargo(Name, Templates, Type, NoTroops, PerTroopMass, Stock, SubCategory) |
User function - Add generic troop type loadable as cargo. |
User function - Add a #CTLD.CargoZoneType zone for this CTLD instance. |
|
(Internal) Autoload if we can do crates, have capacity free and are in a load zone. |
|
(Internal) Check if a unit is in a load zone and is hovering in parameters. |
|
(Internal) Run through all pilots and see if we autoload. |
|
(Internal) Housekeeping dropped beacons. |
|
Name of the class. |
|
(Internal) Run through DroppedTroops and capture alive units |
|
User function - Deactivate Name #CTLD.CargoZoneType ZoneType for this CTLD instance. |
|
(Internal) Function to create a dropped beacon |
|
User function - Get a generic static-type loadable as #CTLD_CARGO object. |
|
User - function to get a table of crates in stock |
|
User - function to get a table of statics cargo in stock |
|
User - function to get a table of troops in stock |
|
(User) Inject static cargo objects. |
|
(Internal) Inject crates and static cargo objects. |
|
CTLD:InjectTroops(Zone, Cargo, Surfacetypes, PreciseLocation, Structure) |
(User) Pre-populate troops in the field. |
CTLD:InjectVehicles(Zone, Cargo, Surfacetypes, PreciseLocation, Structure) |
(User) Pre-populate vehicles in the field. |
(Internal) Check if a Hercules is flying in parameters for air drops. |
|
(Internal) Check if a unit is hovering in parameters. |
|
(Internal) Function to check if a unit is a Hercules C-130 or a Bronco. |
|
(Internal) Function to check if a unit is a CH-47 |
|
(Internal) Check if a unit is above ground. |
|
(Internal) Function to see if a unit is in a specific zone type. |
|
Triggers the FSM event "Save". |
|
Instantiate a new CTLD. |
|
CTLD:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle) |
FSM Function OnAfterCratesBuild. |
CTLD:OnAfterCratesBuildStarted(From, Event, To, Group, Unit) |
FSM Function OnAfterCratesBuildStarted. |
CTLD:OnAfterCratesDropped(From, Event, To, Group, Unit, Cargotable) |
FSM Function OnAfterCratesDropped. |
CTLD:OnAfterCratesPickedUp(From, Event, To, Group, Unit, Cargo) |
FSM Function OnAfterCratesPickedUp. |
CTLD:OnAfterCratesRepairStarted(From, Event, To, Group, Unit) |
FSM Function OnAfterCratesRepairStarted. |
CTLD:OnAfterCratesRepaired(From, Event, To, Group, Unit, Vehicle) |
FSM Function OnAfterCratesRepaired. |
FSM Function OnAfterLoad. |
|
FSM Function OnAfterSave. |
|
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. |
FSM Function OnAfterTroopsRTB. |
|
CTLD:OnBeforeCratesBuild(From, Event, To, Group, Unit, Vehicle) |
FSM Function OnBeforeCratesBuild. |
CTLD:OnBeforeCratesBuildStarted(From, Event, To, Group, Unit) |
FSM Function OnBeforeCratesBuildStarted. |
CTLD:OnBeforeCratesDropped(From, Event, To, Group, Unit, Cargotable) |
FSM Function OnBeforeCratesDropped. |
CTLD:OnBeforeCratesPickedUp(From, Event, To, Group, Unit, Cargo) |
FSM Function OnBeforeCratesPickedUp. |
CTLD:OnBeforeCratesRepairStarted(From, Event, To, Group, Unit) |
FSM Function OnBeforeCratesRepairStarted. |
CTLD:OnBeforeCratesRepaired(From, Event, To, Group, Unit, Vehicle) |
FSM Function OnBeforeCratesRepaired. |
CTLD:OnBeforeTroopsDeployed(From, Event, To, Group, Unit, Troops) |
FSM Function OnBeforeTroopsDeployed. |
CTLD:OnBeforeTroopsExtracted(From, Event, To, Group, Unit, Cargo) |
FSM Function OnBeforeTroopsExtracted. |
CTLD:OnBeforeTroopsPickedUp(From, Event, To, Group, Unit, Cargo) |
FSM Function OnBeforeTroopsPickedUp. |
CTLD:OnBeforeTroopsRTB(From, Event, To, Group, Unit, ZoneName, ZoneObject) |
FSM Function OnBeforeTroopsRTB. |
(User) Pre-load crates into a helo, e.g. |
|
(User) Pre-load troops into a helo, e.g. |
|
User - function to remove stock of a certain crates type |
|
User - function to remove stock of a certain statics type |
|
User - function to remove stock of a certain troops type |
|
User - Function to add onw SET_GROUP Set-up for pilot filtering and assignment. |
|
Set folder path where the CTLD sound files are located within you mission (miz) file. |
|
User - function to set the stock of a certain crates type |
|
User - function to set the stock of a certain statics type |
|
User - function to set the stock of a certain troops type |
|
(User) Set drop zone radius for troop drops in meters. |
|
User - Function to add/adjust unittype capabilities. |
|
User function - Drop a smoke or flare at current location. |
|
User function - Start smoke/flare in a zone close to the Unit. |
|
Triggers the FSM event "Start". |
|
Triggers the FSM event "Status". |
|
Triggers the FSM event "Stop". |
|
[Deprecated] - Function to add/adjust unittype capabilities. |
|
CTLD:_AddRadioBeacon(Name, Sound, Mhz, Modulation, IsShip, IsDropped) |
(Internal) Add radio beacon to zone. |
(Internal) Function to build nearby crates. |
|
CTLD:_BuildObjectFromCrates(Group, Unit, Build, Repair, RepairLocation) |
(Internal) Function to actually SPAWN buildables in the mission. |
(Internal) Check on engineering teams |
|
[Internal] Function to check if a template exists in the mission. |
|
(Internal) Housekeeping - Cleanup crates when build |
|
(Internal) Function to clean up tracked cargo crates |
|
(Internal) Event handler function |
|
(Internal) Function to extract (load from the field) troops into a heli. |
|
(Internal) Find a crates CTLD_CARGO object in stock |
|
CTLD:_FindCratesNearby(_group, _unit, _dist, _ignoreweight, ignoretype) |
(Internal) Function to find and return nearby crates. |
(Internal) Find a troops CTLD_CARGO object in stock |
|
(Internal) Function to generate valid FM Frequencies |
|
(Internal) Function to generate valid UHF Frequencies |
|
(Internal) Populate table with available VHF beacon frequencies. |
|
(Internal) Function to spawn crates in front of the heli. |
|
(Internal) Return distance in meters between two coordinates. |
|
(Internal) Function to obtain a valid FM frequency. |
|
(Internal) Function to calculate max loadable mass left over. |
|
(Internal) Function to obtain a valid UHF frequency. |
|
(Internal) Function to get capabilities of a chopper |
|
(Internal) Function to get current loaded mass |
|
CTLD:_GetUnitPositions(Coordinate, Radius, Heading, Template) |
(Internal) Function to set troops positions of a template to a nice circle |
(Internal) Function to obtain a valid VHF frequency. |
|
(Internal) Function to list loaded cargo. |
|
(Internal) Function to find and list nearby crates. |
|
(Internal) Function to list loaded cargo. |
|
(Internal) Function to show list of radio beacons |
|
(Internal) Function to get and load nearby crates. |
|
(Internal) Function to load troops into a heli. |
|
(Internal) Function to move group to WP zone. |
|
(Internal) Pre-load crates into a helo. |
|
(Internal) Housekeeping - Function to refresh F10 menus. |
|
(Internal) Function to refresh radio beacons |
|
(Internal) Function to repair nearby vehicles / FOBs |
|
CTLD:_RepairObjectFromCrates(Group, Unit, Crates, Build, Number, Engineering) |
(Internal) Function to repair an object. |
(Internal) Function to message a group. |
|
(Internal) List if a Herc unit is flying in parameters. |
|
(Internal) List if a unit is hovering in parameters. |
|
(Internal) Function to unload crates from heli. |
|
(Internal) Function to unload troops from heli. |
|
(Internal) Function to calculate and set Unit internal cargo mass |
|
Triggers the FSM event "Load" after a delay. |
|
Triggers the FSM event "Save" after a delay. |
|
Triggers the FSM event "Start" after a delay. |
|
Triggers the FSM event "Status" after a delay. |
|
Triggers the FSM event "Stop" after a delay. |
|
Coalition side number, e.g. |
|
Class id string for output to DCS log file. |
|
CTLD:onafterCratesBuild(From, Event, To, Group, Unit, Vehicle) |
(Internal) FSM Function onafterCratesBuild. |
On after "Load" event. |
|
On after "Save" event. |
|
(Internal) FSM Function onafterStart. |
|
(Internal) FSM Function onafterStatus. |
|
(Internal) FSM Function onafterStop. |
|
CTLD:onafterTroopsDeployed(From, Event, To, Group, Unit, Troops, Type) |
(Internal) FSM Function onafterTroopsDeployed. |
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. |
On before "Load" event. |
|
On before "Save" event. |
|
(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, ZoneName, ZoneObject) |
(Internal) FSM Function onbeforeTroopsRTB. |
Verbosity level. |
|
CTLD class version. |
|
Fields and Methods inherited from FSM | Description |
---|---|
Adds an End state. |
|
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task. |
|
Adds a score for the FSM to be achieved. |
|
Adds a score for the FSM_PROCESS to be achieved. |
|
Add a new transition rule to the FSM. |
|
Call scheduler. |
|
Name of the class. |
|
Get current state. |
|
Returns the End states. |
|
Returns a table of the SubFSM rules defined within the FSM. |
|
Returns a table with the scores defined. |
|
Returns the start state of the FSM. |
|
Get current state. |
|
Returns a table with the Subs defined. |
|
Returns a table of the transition rules defined within the FSM. |
|
Check if FSM is in state. |
|
Load call backs. |
|
Creates a new FSM object. |
|
Scores. |
|
Sets the start state of the FSM. |
|
Add to map. |
|
Call handler. |
|
Create transition. |
|
Delayed transition. |
|
Event map. |
|
Go sub. |
|
Handler. |
|
Is end state. |
|
Sub maps. |
|
Check if can do an event. |
|
Check if cannot do an event. |
|
Current state name. |
|
Check if FSM is in state. |
|
Options. |
|
Subs. |
Fields and Methods inherited from BASE | Description |
---|---|
The ID number of the class. |
|
The name of the class. |
|
The name of the class concatenated with the ID number of the class. |
|
Clear the state of an object. |
|
CTLD:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
CTLD:CreateEventCrash(EventTime, Initiator, IniObjectCategory) |
Creation of a Crash Event. |
CTLD:CreateEventDead(EventTime, Initiator, IniObjectCategory) |
Creation of a Dead Event. |
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event. |
|
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event. |
|
Creation of a |
|
Creation of a Remove Unit Event. |
|
Creation of a Takeoff Event. |
|
Creation of a Crash Event. |
|
Log an exception which will be traced always. |
|
Returns the event dispatcher |
|
Remove all subscribed events |
|
Trace a function call. |
|
Trace a function call level 2. |
|
Trace a function call level 3. |
|
Get the ClassID of the class instance. |
|
Get the ClassName of the class instance. |
|
Get the ClassName + ClassID of the class instance. |
|
Get the Class Core.Event processing Priority. |
|
This is the worker method to retrieve the Parent class. |
|
Get a Value given a Key from the Object. |
|
Subscribe to a DCS Event. |
|
Log an information which will be traced always. |
|
This is the worker method to inherit from a parent class. |
|
This is the worker method to check if an object is an (sub)instance of a class. |
|
Enquires if tracing is on (for the class). |
|
BASE constructor. |
|
Occurs when an Event for an object is triggered. |
|
BDA. |
|
Occurs when a ground unit captures either an airbase or a farp. |
|
Occurs when any object is spawned into the mission. |
|
Occurs when any aircraft crashes into the ground and is completely destroyed. |
|
Occurs when an object is dead. |
|
Unknown precisely what creates this event, likely tied into newer damage model. |
|
Discard chair after ejection. |
|
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo. |
|
Occurs when a dynamic cargo crate is removed. |
|
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo. |
|
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when any aircraft shuts down its engines. |
|
Occurs when any aircraft starts its engines. |
|
Occurs whenever an object is hit by a weapon. |
|
Occurs when any system fails on a human controlled aircraft. |
|
Occurs on the death of a unit. |
|
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up. |
|
Landing quality mark. |
|
Occurs when a new mark was added. |
|
Occurs when a mark text was changed. |
|
Occurs when a mark was removed. |
|
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu. |
|
Weapon add. |
|
Occurs when the pilot of an aircraft is killed. |
|
Occurs when a player enters a slot and takes control of an aircraft. |
|
Occurs when any player assumes direct control of a unit. |
|
Occurs when any player relieves control of a unit to the AI. |
|
Occurs when an aircraft connects with a tanker and begins taking on fuel. |
|
Occurs when an aircraft is finished taking fuel. |
|
Occurs when any modification to the "Score" as seen on the debrief menu would occur. |
|
Occurs when any unit stops firing its weapon. |
|
Occurs when any unit begins firing a weapon that has a high rate of fire. |
|
Occurs whenever any unit in a mission fires a weapon. |
|
Occurs when an aircraft takes off from an airbase, farp, or ship. |
|
Trigger zone. |
|
Occurs when the game thinks an object is destroyed. |
|
Schedule a new time event. |
|
CTLD:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...) |
Schedule a new time event. |
Stops the Schedule. |
|
Set the Class Core.Event processing Priority. |
|
Set a state or property of the Object given a Key and a Value. |
|
Trace a function logic level 1. |
|
Trace a function logic level 2. |
|
Trace a function logic level 3. |
|
Trace all methods in MOOSE |
|
Set tracing for a class |
|
Set tracing for a specific method of class |
|
Set trace level |
|
Set trace off. |
|
Set trace on. |
|
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. |
|
UnSubscribe to a DCS event. |
|
CTLD:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
(Internal) Serialize arguments |
|
CTLD:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
The main event handling function... |
Fields and Methods inherited from CTLD.Buildable | Description |
---|---|
Is buildable or not. |
|
Found crates. |
|
Name of the object. |
|
Required crates. |
|
Template names for this build. |
|
Type enumerator (for moves). |
Fields and Methods inherited from CTLD.CargoZone | Description |
---|---|
Active or not. |
|
Smoke color for zone, e.g. SMOKECOLOR.Red. |
|
Beacon info as #CTLD.ZoneBeacon |
|
Create and run radio beacons if active. |
|
Name of Zone. |
|
For ships - length of ship |
|
For ships - width of ship |
|
For dropped beacons - time this was created |
|
Type of zone, i.e. load,drop,move,ship |
|
Beacon info as #CTLD.ZoneBeacon |
|
Beacon info as #CTLD.ZoneBeacon |
Fields and Methods inherited from CTLD.CargoZoneType | Description |
---|---|
Fields and Methods inherited from CTLD.LoadedCargo | Description |
---|---|
Fields and Methods inherited from CTLD.RadioModulation | Description |
---|---|
Fields and Methods inherited from CTLD.UnitTypeCapabilities | Description |
---|---|
Max loadable kgs of cargo. |
|
Number of crates transportable. |
|
Can transport crate. |
|
Number of troop units transportable. |
|
Can transport troops. |
|
Unit type. |
Fields and Methods inherited from CTLD.ZoneBeacon | Description |
---|---|
-- in mHz |
|
-- i.e.CTLD.RadioModulation.FM or CTLD.RadioModulation.AM |
|
-- Name of zone for the coordinate |
Fields and Methods inherited from CTLD_CARGO | Description |
---|---|
Add mark |
|
Add Stock. |
|
Add specific unit types to this CARGO (restrict what types can pick this up). |
|
Query directly loadable. |
|
Enumerator of Type. |
|
Class name. |
|
Crates needed to build. |
|
Show this item in menu or not. |
|
Query number of crates or troopsize. |
|
Query ID. |
|
Query Location. |
|
Get mark |
|
Query Mass. |
|
Query Name. |
|
Get overall mass of a cargo object, i.e. |
|
Query type. |
|
Get Resource Map information table |
|
Get the specific static type and shape from this CARGO if set. |
|
Get Stock. |
|
Query Subcategory |
|
Query Templates. |
|
Query type. |
|
True if dropped from heli. |
|
Flag for moving. |
|
Query has moved. |
|
ID of this cargo. |
|
Query crate type for REPAIR |
|
Query crate type for STATIC |
|
Query if cargo has been loaded. |
|
Flag for direct loading. |
|
Location (if set) where to get this cargo item. |
|
Name for menu. |
|
Function to create new CTLD_CARGO object. |
|
Mass in kg. |
|
Representation of cargo in the mission. |
|
Remove Stock. |
|
Resource Map information table if it has been set for static cargo items. |
|
Set HasMoved. |
|
Add Resource Map information table |
|
CTLD_CARGO:SetStaticTypeAndShape(TypeName, ShapeName, Category) |
Add specific static type and shape to this CARGO. |
Set Stock. |
|
Set WasDropped. |
|
Individual static category if set. |
|
Individual shape if set. |
|
Individual type if set. |
|
Number of builds available, -1 for unlimited. |
|
Sub-category name. |
|
Table of #POSITIONABLE objects. |
|
Table of unit types able to pick this cargo up. |
|
Check if a specific unit can carry this CARGO (restrict what types can pick this up). |
|
Query was dropped. |
|
Wipe mark |
Fields and Methods inherited from BASE | Description |
---|---|
The ID number of the class. |
|
The name of the class. |
|
The name of the class concatenated with the ID number of the class. |
|
Clear the state of an object. |
|
CTLD_CARGO:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
CTLD_CARGO:CreateEventCrash(EventTime, Initiator, IniObjectCategory) |
Creation of a Crash Event. |
CTLD_CARGO:CreateEventDead(EventTime, Initiator, IniObjectCategory) |
Creation of a Dead Event. |
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event. |
|
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event. |
|
Creation of a |
|
Creation of a Remove Unit Event. |
|
Creation of a Takeoff Event. |
|
Creation of a Crash Event. |
|
Log an exception which will be traced always. |
|
Returns the event dispatcher |
|
Remove all subscribed events |
|
Trace a function call. |
|
Trace a function call level 2. |
|
Trace a function call level 3. |
|
Get the ClassID of the class instance. |
|
Get the ClassName of the class instance. |
|
Get the ClassName + ClassID of the class instance. |
|
Get the Class Core.Event processing Priority. |
|
This is the worker method to retrieve the Parent class. |
|
Get a Value given a Key from the Object. |
|
Subscribe to a DCS Event. |
|
Log an information which will be traced always. |
|
This is the worker method to inherit from a parent class. |
|
This is the worker method to check if an object is an (sub)instance of a class. |
|
Enquires if tracing is on (for the class). |
|
BASE constructor. |
|
Occurs when an Event for an object is triggered. |
|
BDA. |
|
Occurs when a ground unit captures either an airbase or a farp. |
|
Occurs when any object is spawned into the mission. |
|
Occurs when any aircraft crashes into the ground and is completely destroyed. |
|
Occurs when an object is dead. |
|
Unknown precisely what creates this event, likely tied into newer damage model. |
|
Discard chair after ejection. |
|
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo. |
|
Occurs when a dynamic cargo crate is removed. |
|
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo. |
|
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when any aircraft shuts down its engines. |
|
Occurs when any aircraft starts its engines. |
|
Occurs whenever an object is hit by a weapon. |
|
Occurs when any system fails on a human controlled aircraft. |
|
Occurs on the death of a unit. |
|
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up. |
|
Landing quality mark. |
|
Occurs when a new mark was added. |
|
Occurs when a mark text was changed. |
|
Occurs when a mark was removed. |
|
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu. |
|
Weapon add. |
|
Occurs when the pilot of an aircraft is killed. |
|
Occurs when a player enters a slot and takes control of an aircraft. |
|
Occurs when any player assumes direct control of a unit. |
|
Occurs when any player relieves control of a unit to the AI. |
|
Occurs when an aircraft connects with a tanker and begins taking on fuel. |
|
Occurs when an aircraft is finished taking fuel. |
|
Occurs when any modification to the "Score" as seen on the debrief menu would occur. |
|
Occurs when any unit stops firing its weapon. |
|
Occurs when any unit begins firing a weapon that has a high rate of fire. |
|
Occurs whenever any unit in a mission fires a weapon. |
|
Occurs when an aircraft takes off from an airbase, farp, or ship. |
|
Trigger zone. |
|
Occurs when the game thinks an object is destroyed. |
|
Schedule a new time event. |
|
CTLD_CARGO:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...) |
Schedule a new time event. |
Stops the Schedule. |
|
Set the Class Core.Event processing Priority. |
|
Set a state or property of the Object given a Key and a Value. |
|
Trace a function logic level 1. |
|
Trace a function logic level 2. |
|
Trace a function logic level 3. |
|
Trace all methods in MOOSE |
|
Set tracing for a class |
|
Set tracing for a specific method of class |
|
Set trace level |
|
Set trace off. |
|
Set trace on. |
|
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. |
|
UnSubscribe to a DCS event. |
|
CTLD_CARGO:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
(Internal) Serialize arguments |
|
CTLD_CARGO:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
The main event handling function... |
Fields and Methods inherited from CTLD_CARGO.Enum | Description |
---|---|
Fields and Methods inherited from CTLD_ENGINEERING | Description |
---|---|
(Internal) Arrived at crates in reach. |
|
(Internal) Set build status. |
|
(Internal) Set done status. |
|
(Internal) Get the status |
|
(Internal) Check the negative status |
|
(Internal) Check the status |
|
(Internal) Move towards crates in reach. |
|
Create a new instance. |
|
(Internal) Search for crates in reach. |
|
(Internal) Set the status |
|
(Internal) Set start status. |
|
(Internal) Set stop status. |
|
(Internal) Return distance in meters between two coordinates. |
|
Fields and Methods inherited from BASE | Description |
---|---|
The ID number of the class. |
|
The name of the class. |
|
The name of the class concatenated with the ID number of the class. |
|
Clear the state of an object. |
|
CTLD_ENGINEERING:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
CTLD_ENGINEERING:CreateEventCrash(EventTime, Initiator, IniObjectCategory) |
Creation of a Crash Event. |
CTLD_ENGINEERING:CreateEventDead(EventTime, Initiator, IniObjectCategory) |
Creation of a Dead Event. |
CTLD_ENGINEERING:CreateEventDynamicCargoLoaded(DynamicCargo) |
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event. |
CTLD_ENGINEERING:CreateEventDynamicCargoRemoved(DynamicCargo) |
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event. |
CTLD_ENGINEERING:CreateEventDynamicCargoUnloaded(DynamicCargo) |
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event. |
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event. |
|
Creation of a |
|
CTLD_ENGINEERING:CreateEventRemoveUnit(EventTime, Initiator) |
Creation of a Remove Unit Event. |
Creation of a Takeoff Event. |
|
Creation of a Crash Event. |
|
Log an exception which will be traced always. |
|
Returns the event dispatcher |
|
Remove all subscribed events |
|
Trace a function call. |
|
Trace a function call level 2. |
|
Trace a function call level 3. |
|
Get the ClassID of the class instance. |
|
Get the ClassName of the class instance. |
|
Get the ClassName + ClassID of the class instance. |
|
Get the Class Core.Event processing Priority. |
|
This is the worker method to retrieve the Parent class. |
|
Get a Value given a Key from the Object. |
|
Subscribe to a DCS Event. |
|
Log an information which will be traced always. |
|
This is the worker method to inherit from a parent class. |
|
This is the worker method to check if an object is an (sub)instance of a class. |
|
Enquires if tracing is on (for the class). |
|
BASE constructor. |
|
Occurs when an Event for an object is triggered. |
|
BDA. |
|
Occurs when a ground unit captures either an airbase or a farp. |
|
Occurs when any object is spawned into the mission. |
|
Occurs when any aircraft crashes into the ground and is completely destroyed. |
|
Occurs when an object is dead. |
|
Unknown precisely what creates this event, likely tied into newer damage model. |
|
CTLD_ENGINEERING:OnEventDiscardChairAfterEjection(EventData) |
Discard chair after ejection. |
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo. |
|
Occurs when a dynamic cargo crate is removed. |
|
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo. |
|
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when any aircraft shuts down its engines. |
|
Occurs when any aircraft starts its engines. |
|
Occurs whenever an object is hit by a weapon. |
|
Occurs when any system fails on a human controlled aircraft. |
|
Occurs on the death of a unit. |
|
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up. |
|
Landing quality mark. |
|
Occurs when a new mark was added. |
|
Occurs when a mark text was changed. |
|
Occurs when a mark was removed. |
|
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu. |
|
Weapon add. |
|
Occurs when the pilot of an aircraft is killed. |
|
Occurs when a player enters a slot and takes control of an aircraft. |
|
Occurs when any player assumes direct control of a unit. |
|
Occurs when any player relieves control of a unit to the AI. |
|
Occurs when an aircraft connects with a tanker and begins taking on fuel. |
|
Occurs when an aircraft is finished taking fuel. |
|
Occurs when any modification to the "Score" as seen on the debrief menu would occur. |
|
Occurs when any unit stops firing its weapon. |
|
Occurs when any unit begins firing a weapon that has a high rate of fire. |
|
Occurs whenever any unit in a mission fires a weapon. |
|
Occurs when an aircraft takes off from an airbase, farp, or ship. |
|
Trigger zone. |
|
Occurs when the game thinks an object is destroyed. |
|
CTLD_ENGINEERING:ScheduleOnce(Start, SchedulerFunction, ...) |
Schedule a new time event. |
CTLD_ENGINEERING:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...) |
Schedule a new time event. |
Stops the Schedule. |
|
Set the Class Core.Event processing Priority. |
|
Set a state or property of the Object given a Key and a Value. |
|
Trace a function logic level 1. |
|
Trace a function logic level 2. |
|
Trace a function logic level 3. |
|
Trace all methods in MOOSE |
|
Set tracing for a class |
|
Set tracing for a specific method of class |
|
Set trace level |
|
Set trace off. |
|
Set trace on. |
|
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. |
|
UnSubscribe to a DCS event. |
|
CTLD_ENGINEERING:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
(Internal) Serialize arguments |
|
CTLD_ENGINEERING:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
The main event handling function... |
Fields and Methods inherited from CTLD_HERCULES | Description |
---|---|
CTLD_HERCULES:Calculate_Cargo_Drop_initiator_Heading(Cargo_Drop_initiator) |
[Internal] Function to calc initiator heading |
CTLD_HERCULES:Calculate_Cargo_Drop_initiator_NorthCorrection(point) |
[Internal] Function to calc north correction |
[Internal] Function to calculate object height |
|
[Internal] Function to initialize dropped cargo |
|
CTLD_HERCULES:Cargo_SpawnDroppedAsCargo(Cargo_Type_name, Cargo_Drop_Position, _name, _pos) |
[Internal] Function to spawn cargo by type at position |
[Internal] Function to spawn a group |
|
[Internal] Spawn cargo objects |
|
[Internal] Function to spawn static cargo |
|
[Internal] Function to track cargo objects |
|
[Internal] Function to check availability of templates |
|
[Internal] Function to check surface type |
|
[User] Instantiate a new object |
|
[Internal] Function to change cargotype per group (Wrench) |
|
[Internal] Function to spawn a soldier group of 10 units |
|
[Internal] Function to capture BIRTH event |
|
[Internal] Function to capture SHOT event |
|
Fields and Methods inherited from BASE | Description |
---|---|
The ID number of the class. |
|
The name of the class. |
|
The name of the class concatenated with the ID number of the class. |
|
Clear the state of an object. |
|
CTLD_HERCULES:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
CTLD_HERCULES:CreateEventCrash(EventTime, Initiator, IniObjectCategory) |
Creation of a Crash Event. |
CTLD_HERCULES:CreateEventDead(EventTime, Initiator, IniObjectCategory) |
Creation of a Dead Event. |
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event. |
|
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event. |
|
Creation of a |
|
Creation of a Remove Unit Event. |
|
Creation of a Takeoff Event. |
|
Creation of a Crash Event. |
|
Log an exception which will be traced always. |
|
Returns the event dispatcher |
|
Remove all subscribed events |
|
Trace a function call. |
|
Trace a function call level 2. |
|
Trace a function call level 3. |
|
Get the ClassID of the class instance. |
|
Get the ClassName of the class instance. |
|
Get the ClassName + ClassID of the class instance. |
|
Get the Class Core.Event processing Priority. |
|
This is the worker method to retrieve the Parent class. |
|
Get a Value given a Key from the Object. |
|
Subscribe to a DCS Event. |
|
Log an information which will be traced always. |
|
This is the worker method to inherit from a parent class. |
|
This is the worker method to check if an object is an (sub)instance of a class. |
|
Enquires if tracing is on (for the class). |
|
BASE constructor. |
|
Occurs when an Event for an object is triggered. |
|
BDA. |
|
Occurs when a ground unit captures either an airbase or a farp. |
|
Occurs when any object is spawned into the mission. |
|
Occurs when any aircraft crashes into the ground and is completely destroyed. |
|
Occurs when an object is dead. |
|
Unknown precisely what creates this event, likely tied into newer damage model. |
|
Discard chair after ejection. |
|
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo. |
|
Occurs when a dynamic cargo crate is removed. |
|
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo. |
|
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when any aircraft shuts down its engines. |
|
Occurs when any aircraft starts its engines. |
|
Occurs whenever an object is hit by a weapon. |
|
Occurs when any system fails on a human controlled aircraft. |
|
Occurs on the death of a unit. |
|
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up. |
|
Landing quality mark. |
|
Occurs when a new mark was added. |
|
Occurs when a mark text was changed. |
|
Occurs when a mark was removed. |
|
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu. |
|
Weapon add. |
|
Occurs when the pilot of an aircraft is killed. |
|
Occurs when a player enters a slot and takes control of an aircraft. |
|
Occurs when any player assumes direct control of a unit. |
|
Occurs when any player relieves control of a unit to the AI. |
|
Occurs when an aircraft connects with a tanker and begins taking on fuel. |
|
Occurs when an aircraft is finished taking fuel. |
|
Occurs when any modification to the "Score" as seen on the debrief menu would occur. |
|
Occurs when any unit stops firing its weapon. |
|
Occurs when any unit begins firing a weapon that has a high rate of fire. |
|
Occurs whenever any unit in a mission fires a weapon. |
|
Occurs when an aircraft takes off from an airbase, farp, or ship. |
|
Trigger zone. |
|
Occurs when the game thinks an object is destroyed. |
|
Schedule a new time event. |
|
CTLD_HERCULES:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...) |
Schedule a new time event. |
Stops the Schedule. |
|
Set the Class Core.Event processing Priority. |
|
Set a state or property of the Object given a Key and a Value. |
|
Trace a function logic level 1. |
|
Trace a function logic level 2. |
|
Trace a function logic level 3. |
|
Trace all methods in MOOSE |
|
Set tracing for a class |
|
Set tracing for a specific method of class |
|
Set trace level |
|
Set trace off. |
|
Set trace on. |
|
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. |
|
UnSubscribe to a DCS event. |
|
CTLD_HERCULES:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
(Internal) Serialize arguments |
|
CTLD_HERCULES:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
The main event handling function... |
Fields and Methods inherited from CTLD_HERCULES.CargoObject | Description |
---|---|
CTLD_HERCULES.CargoObject.destroy_cargo_dropped_without_parachute |
|
Fields and Methods inherited from CTLD_HERCULES.Types | Description |
---|---|
Name of cargo type, container (boolean) in container or not. |
- CTLD class, extends Core.Base#BASE, Core.Fsm#FSM
Field(s)
Cargo
Name of the class.
list/load crates in this radius
search distance for crates to build or repair
factor for troops extraction, i.e. CrateDistance * Extractfactor
for troop/cargo drop via chute
280 kph or 150kn eq 77 mps
for troop/cargo drop via chute
pack objects in this radius
Folderpath.
radio beacons
Smokes and Flares
allow re-pickup crates
shape of the container
Coalition side number, e.g. coalition.side.RED
.
country of crates spawned
Parachuted herc cargo is not unpacked automatically but placed as crate to be unpacked
#1570
Chinook
added support Hercules Mod
load and save dropped TROOPS
slingload
Class id string for output to DCS log file.
disallow building in loadzones
enfore engineer build only?
zones stuff
for opening doors
place spawned crates in front of aircraft
noob catch
message suppression
sub categories
Verbosity level.
CTLD class version.
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.
#CTLD.CargoZoneType ZoneType
Type of zone this belongs to.
#boolean NewState
(Optional) Set to true to activate, false to switch off.
User function - Creates 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?
#number Shiplength
Length of Ship for shipzones
#number Shipwidth
Width of Ship for shipzones
Return value:
self
User function - Creates and adds a #CTLD.CargoZone zone for this CTLD instance from an Airbase or FARP name.
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 AirbaseName
Name of the Airbase, can be e.g. AIRBASE.Caucasus.Beslan or "Beslan". For FARPs, this will be the UNIT name.
#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.
#CTLD_CARGO.Enum Type
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
#number Stock
Number of buildable groups in stock. Nil for unlimited.
#string SubCategory
Name of sub-category (optional).
#boolean DontShowInMenu
(optional) If set to "true" this won't show up in the menu.
Core.Zone#ZONE Location
(optional) If set, the cargo item is only available here. Can be a #ZONE object or the name of a zone as #string.
#string UnitTypes
Unit type names (optional). If set, only these unit types can pick up the cargo, e.g. "UH-1H" or {"UH-1H","OH58D"}.
#string Category
Static category name (optional). If set, spawn cargo crate with an alternate category type, e.g. "Cargos".
#string TypeName
Static type name (optional). If set, spawn cargo crate with an alternate type shape, e.g. "iso_container".
#string ShapeName
Static shape name (optional). If set, spawn cargo crate with an alternate type sub-shape, e.g. "iso_container_cargo".
Return value:
self
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. MUST be the same as given in AddCratesCargo(..)
!
#CTLD_CARGO.Enum Type
Type of cargo, here REPAIR.
#number NoCrates
Number of crates needed to build this cargo.
#number PerCrateMass
Mass in kg of each crate
#number Stock
Number of groups in stock. Nil for unlimited.
#string SubCategory
Name of the sub-category (optional).
#boolean DontShowInMenu
(optional) If set to "true" this won't show up in the menu.
Core.Zone#ZONE Location
(optional) If set, the cargo item is only available here. Can be a #ZONE object or the name of a zone as #string.
#string UnitTypes
Unit type names (optional). If set, only these unit types can pick up the cargo, e.g. "UH-1H" or {"UH-1H","OH58D"}
#string Category
Static category name (optional). If set, spawn cargo crate with an alternate category type, e.g. "Cargos".
#string TypeName
Static type name (optional). If set, spawn cargo crate with an alternate type shape, e.g. "iso_container".
#string ShapeName
Static shape name (optional). If set, spawn cargo crate with an alternate type sub-shape, e.g. "iso_container_cargo".
Return value:
self
(User) Add a PLAYERTASK - FSM events will check success
User function - Add generic static-type loadable as cargo.
This type will create cargo that needs to be loaded, moved and dropped.
Defined in:
CTLD
Parameters:
#string Name
Unique name of this type of cargo as set in the mission editor (note: UNIT name!), e.g. "Ammunition-1".
#number Mass
Mass in kg of each static in kg, e.g. 100.
#number Stock
Number of groups in stock. Nil for unlimited.
#string SubCategory
Name of sub-category (optional).
#boolean DontShowInMenu
(optional) If set to "true" this won't show up in the menu.
Core.Zone#ZONE Location
(optional) If set, the cargo item is only available here. Can be a #ZONE object or the name of a zone as #string.
Return value:
CargoObject
User - function to add stock of a certain crates type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to add.
Return value:
self
User - function to add stock of a certain crates type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to add.
Return value:
self
User - function to add stock of a certain troops type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to add.
Return value:
self
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.
#CTLD_CARGO.Enum Type
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
#number Stock
Number of groups in stock. Nil for unlimited.
#string SubCategory
Name of sub-category (optional).
User function - Add a #CTLD.CargoZoneType zone for this CTLD instance.
(Internal) Autoload if we can do crates, have capacity free and are in a load zone.
(Internal) Check if a unit is in a load zone and is hovering in parameters.
(Internal) Run through all pilots and see if we autoload.
(Internal) Housekeeping dropped beacons.
(Internal) Run through DroppedTroops and capture alive units
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.
#CTLD.CargoZoneType ZoneType
Type of zone this belongs to.
(Internal) Function to create a dropped beacon
User function - Get a generic static-type loadable as #CTLD_CARGO object.
Defined in:
CTLD
Parameters:
#string Name
Unique Unit(!) name of this type of cargo as set in the mission editor (not: GROUP name!), e.g. "Ammunition-1".
#number Mass
Mass in kg of each static in kg, e.g. 100.
Return value:
Cargo object
User - function to get a table of crates in stock
Defined in:
CTLD
Return value:
#table:
Table Table of Stock, indexed by cargo type name
User - function to get a table of statics cargo in stock
Defined in:
CTLD
Return value:
#table:
Table Table of Stock, indexed by cargo type name
User - function to get a table of troops in stock
Defined in:
CTLD
Return value:
#table:
Table Table of Stock, indexed by cargo type name
(User) Inject static cargo objects.
Defined in:
CTLD
Parameters:
Core.Zone#ZONE Zone
Zone to spawn in. Will be a somewhat random coordinate.
#string Template
Unit(!) name of the static cargo object to be used as template.
#number Mass
Mass of the static in kg.
Return value:
self
(Internal) Inject crates and static cargo objects.
Defined in:
CTLD
Parameters:
Core.Zone#ZONE Zone
Zone to spawn in.
#CTLD_CARGO Cargo
The cargo type to spawn.
#boolean RandomCoord
Randomize coordinate.
#boolean FromLoad
Create only one crate per cargo type, as we are re-creating dropped crates that CTLD has saved prior.
Return value:
self
(User) Pre-populate troops in the field.
Defined in:
CTLD
Parameters:
Core.Zone#ZONE Zone
The zone where to drop the troops.
Ops.CTLD#CTLD_CARGO Cargo
The #CTLD_CARGO object to spawn.
#table Surfacetypes
(Optional) Table of surface types. Can also be a single surface type. We will try max 1000 times to find the right type!
#boolean PreciseLocation
(Optional) Don't try to get a random position in the zone but use the dead center. Caution not to stack up stuff on another!
#string Structure
(Optional) String object describing the current structure of the injected group; mainly for load/save to keep current state setup.
Return value:
self
Usage:
Use this function to pre-populate the field with Troops or Engineers at a random coordinate in a zone:
-- create a matching #CTLD_CARGO type
local InjectTroopsType = CTLD_CARGO:New(nil,"Infantry",{"Inf12"},CTLD_CARGO.Enum.TROOPS,true,true,12,nil,false,80)
-- get a #ZONE object
local dropzone = ZONE:New("InjectZone") -- Core.Zone#ZONE
-- and go:
my_ctld:InjectTroops(dropzone,InjectTroopsType,{land.SurfaceType.LAND})
(User) Pre-populate vehicles in the field.
Defined in:
CTLD
Parameters:
Core.Zone#ZONE Zone
The zone where to drop the troops.
Ops.CTLD#CTLD_CARGO Cargo
The #CTLD_CARGO object to spawn.
#table Surfacetypes
(Optional) Table of surface types. Can also be a single surface type. We will try max 1000 times to find the right type!
#boolean PreciseLocation
(Optional) Don't try to get a random position in the zone but use the dead center. Caution not to stack up stuff on another!
#string Structure
(Optional) String object describing the current structure of the injected group; mainly for load/save to keep current state setup.
Return value:
self
Usage:
Use this function to pre-populate the field with Vehicles or FOB at a random coordinate in a zone:
-- create a matching #CTLD_CARGO type
local InjectVehicleType = CTLD_CARGO:New(nil,"Humvee",{"Humvee"},CTLD_CARGO.Enum.VEHICLE,true,true,1,nil,false,1000)
-- get a #ZONE object
local dropzone = ZONE:New("InjectZone") -- Core.Zone#ZONE
-- and go:
my_ctld:InjectVehicles(dropzone,InjectVehicleType)
(Internal) Check if a Hercules is flying in parameters for air drops.
(Internal) Check if a unit is hovering in parameters.
(Internal) Function to check if a unit is a Hercules C-130 or a Bronco.
(Internal) Function to check if a unit is a CH-47
(Internal) Check if a unit is above ground.
(Internal) Function to see if a unit is in a specific zone type.
Defined in:
CTLD
Parameters:
Wrapper.Unit#UNIT Unit
Unit
#CTLD.CargoZoneType Zonetype
Zonetype
Return values:
#boolean:
Outcome Is in zone or not
#string:
name Closest zone name
zone Closest Core.Zone#ZONE object
#number:
distance Distance to closest zone
#number:
width Radius of zone or width of ship
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.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Vehicle
The #GROUP object of the vehicle or FOB build.
Return value:
self
FSM Function OnAfterCratesBuildStarted.
Info event that a build has been started.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Return value:
self
FSM Function OnAfterCratesDropped.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#table Cargotable
Table of #CTLD_CARGO objects dropped. Can be a Wrapper.DynamicCargo#DYNAMICCARGO object, if ground crew unloaded!
Return value:
self
FSM Function OnAfterCratesPickedUp.
Defined in:
CTLD
Parameters:
#string From
State .
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#CTLD_CARGO Cargo
Cargo crate. Can be a Wrapper.DynamicCargo#DYNAMICCARGO object, if ground crew loaded!
Return value:
self
FSM Function OnAfterCratesRepairStarted.
Info event that a repair has been started.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Return value:
self
FSM Function OnAfterCratesRepaired.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Vehicle
The #GROUP object of the vehicle or FOB repaired.
Return value:
self
FSM Function OnAfterLoad.
Defined in:
CTLD
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string path
(Optional) Path where the file is located. Default is the DCS root installation folder or your "Saved Games\DCS" folder if the lfs module is desanitized.
#string filename
(Optional) File name for loading. Default is "CTLD_
FSM Function OnAfterSave.
Defined in:
CTLD
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string path
(Optional) Path where the file is saved. Default is the DCS root installation folder or your "Saved Games\DCS" folder if the lfs module is desanitized.
#string filename
(Optional) File name for saving. Default is "CTLD_
FSM Function OnAfterTroopsDeployed.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Troops
Troops #GROUP Object.
Return value:
self
FSM Function OnAfterTroopsExtracted.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
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.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
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.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
FSM Function OnBeforeCratesBuild.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Vehicle
The #GROUP object of the vehicle or FOB build.
Return value:
self
FSM Function OnBeforeCratesBuildStarted.
Info event that a build has been started.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Return value:
self
FSM Function OnBeforeCratesDropped.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#table Cargotable
Table of #CTLD_CARGO objects dropped. Can be a Wrapper.DynamicCargo#DYNAMICCARGO object, if ground crew unloaded!
Return value:
self
FSM Function OnBeforeCratesPickedUp.
Defined in:
CTLD
Parameters:
#string From
State .
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#CTLD_CARGO Cargo
Cargo crate. Can be a Wrapper.DynamicCargo#DYNAMICCARGO object, if ground crew loaded!
Return value:
self
FSM Function OnBeforeCratesRepairStarted.
Info event that a repair has been started.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Return value:
self
FSM Function OnBeforeCratesRepaired.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Vehicle
The #GROUP object of the vehicle or FOB repaired.
Return value:
self
FSM Function OnBeforeTroopsDeployed.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Troops
Troops #GROUP Object.
Return value:
self
FSM Function OnBeforeTroopsExtracted.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#CTLD_CARGO Cargo
Cargo troops.
Return value:
self
FSM Function OnBeforeTroopsPickedUp.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#CTLD_CARGO Cargo
Cargo troops.
Return value:
self
FSM Function OnBeforeTroopsRTB.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#string ZoneName
Name of the Zone where the Troops have been RTB'd.
Core.Zone#ZONE_Radius ZoneObject
of the Zone where the Troops have been RTB'd.
(User) Pre-load crates into a helo, e.g.
for airstart. Unit must be alive in-game, i.e. player has taken the slot!
Defined in:
CTLD
Parameters:
Wrapper.Unit#UNIT Unit
The unit to load into, can be handed as Wrapper.Client#CLIENT object
#string Cratesname
The name of the cargo to be loaded. Must be created prior in the CTLD setup!
#number NumberOfCrates
(Optional) Number of crates to be loaded. Default - all necessary to build this object. Might overload the helo!
Return value:
self
Usage:
local client = UNIT:FindByName("Helo-1-1")
if client and client:IsAlive() then
myctld:PreloadCrates(client,"Humvee")
end
(User) Pre-load troops into a helo, e.g.
for airstart. Unit must be alive in-game, i.e. player has taken the slot!
Defined in:
CTLD
Parameters:
Wrapper.Unit#UNIT Unit
The unit to load into, can be handed as Wrapper.Client#CLIENT object
#string Troopname
The name of the Troops to be loaded. Must be created prior in the CTLD setup!
Return value:
self
Usage:
local client = UNIT:FindByName("Helo-1-1")
if client and client:IsAlive() then
myctld:PreloadTroops(client,"Infantry")
end
User - function to remove stock of a certain crates type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to add.
Return value:
self
User - function to remove stock of a certain statics type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to add.
Return value:
self
User - function to remove stock of a certain troops type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to add.
Return value:
self
User - Function to add onw SET_GROUP Set-up for pilot filtering and assignment.
Needs to be set before starting the CTLD instance.
Defined in:
CTLD
Parameter:
The SET_GROUP object created by the mission designer/user to represent the CTLD pilot groups.
Return value:
self
Set folder path where the CTLD sound files are located within you mission (miz) file.
The default path is "l10n/DEFAULT/" but sound files simply copied there will be removed by DCS the next time you save the mission. However, if you create a new folder inside the miz file, which contains the sounds, it will not be deleted and can be used.
Defined in:
CTLD
Parameter:
#string FolderPath
The path to the sound files, e.g. "CTLD_Soundfiles/".
Return value:
self
User - function to set the stock of a certain crates type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to be available. Nil equals unlimited
Return value:
self
User - function to set the stock of a certain statics type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to be available. Nil equals unlimited
Return value:
self
User - function to set the stock of a certain troops type
Defined in:
CTLD
Parameters:
#string Name
Name as defined in the generic cargo.
#number Number
Number of units/groups to be available. Nil equals unlimited
Return value:
self
(User) Set drop zone radius for troop drops in meters.
Minimum distance is 25m for security reasons.
Defined in:
CTLD
Parameter:
#number Radius
The radius to use.
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. Default false.
#boolean Cantroops
Unit can load troops. Default false.
#number Cratelimit
Unit can carry number of crates. Default 0.
#number Trooplimit
Unit can carry number of troops. Default 0.
#number Length
Unit lenght (in metres) for the load radius. Default 20.
#number Maxcargoweight
Maxmimum weight in kgs this helo can carry. Default 500.
User function - Drop a smoke or flare at current location.
Defined in:
CTLD
Parameters:
Wrapper.Unit#UNIT Unit
The Unit.
#boolean Flare
If true, flare instead.
#number SmokeColor
Color enumerator for smoke, e.g. SMOKECOLOR.Red
User function - Start smoke/flare in a zone close to the Unit.
Defined in:
CTLD
Parameters:
Wrapper.Unit#UNIT Unit
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 "Stop".
Stops the CTLD and all its event handlers.
Defined in:
CTLD
[Deprecated] - Function to add/adjust unittype capabilities.
Has been replaced with SetUnitCapabilities()
- pls use the new one going forward!
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. Default false.
#boolean Cantroops
Unit can load troops. Default false.
#number Cratelimit
Unit can carry number of crates. Default 0.
#number Trooplimit
Unit can carry number of troops. Default 0.
#number Length
Unit lenght (in metres) for the load radius. Default 20.
#number Maxcargoweight
Maxmimum weight in kgs this helo can carry. Default 500.
(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.
#boolean IsShip
If true zone is a ship.
#boolean IsDropped
If true, this isn't a zone but a dropped beacon
(Internal) Function to build nearby crates.
Defined in:
CTLD
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Unit#UNIT Unit
#boolean Engineering
If true build is by an engineering team.
(Internal) Function to actually SPAWN buildables in the mission.
Defined in:
CTLD
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Group#UNIT Unit
#CTLD.Buildable Build
#boolean Repair
If true this is a repair and not a new build
Core.Point#COORDINATE RepairLocation
Location for repair (e.g. where the destroyed unit was)
(Internal) Check on engineering teams
[Internal] Function to check if a template exists in the mission.
Defined in:
CTLD
Parameter:
#table temptable
Table of string names
Return value:
#boolean:
outcome
(Internal) Housekeeping - Cleanup crates when build
Defined in:
CTLD
Parameters:
#table Crates
Table of #CTLD_CARGO objects near the unit.
#CTLD.Buildable Build
Table build object.
#number Number
Number of objects in Crates (found) to limit search.
(Internal) Function to clean up tracked cargo crates
Defined in:
CTLD
Parameter:
crateIdsToRemove
(Internal) Event handler function
(Internal) Function to extract (load from the field) troops into a heli.
(Internal) Find a crates CTLD_CARGO object in stock
Defined in:
CTLD
Parameter:
#string Name
of the object
Return value:
Cargo object, nil if it cannot be found
(Internal) Function to find and return nearby crates.
Defined in:
CTLD
Parameters:
Wrapper.Group#GROUP _group
Group
Wrapper.Unit#UNIT _unit
Unit
#number _dist
Distance
#boolean _ignoreweight
Find everything in range, ignore loadable weight
#boolean ignoretype
Find everything in range, ignore loadable type name
Return values:
#table:
Crates Table of crates
#number:
Number Number of crates found
#table:
CratesGC Table of crates possibly loaded by GC
#number:
NumberGC Number of crates possibly loaded by GC
Defined in:
CTLD
Parameters:
Group
Unit
Repairtype
(Internal) Find a troops CTLD_CARGO object in stock
Defined in:
CTLD
Parameter:
#string Name
of the object
Return value:
Cargo object, nil if it cannot be found
(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:
Wrapper.Group#GROUP Group
Wrapper.Unit#UNIT Unit
#CTLD_CARGO Cargo
#number number
Number of crates to generate (for dropping)
#boolean drop
If true we're dropping from heli rather than loading.
#boolean pack
If true we're packing crates from a template rather than loading or dropping
(Internal) Return distance in meters between two coordinates.
Defined in:
CTLD
Parameters:
Core.Point#COORDINATE _point1
Coordinate one
Core.Point#COORDINATE _point2
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 calculate max loadable mass left over.
Defined in:
CTLD
Parameter:
Wrapper.Unit#UNIT Unit
Return value:
#number:
maxloadable Max loadable mass in kg
(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:
Wrapper.Unit#UNIT Unit
The unit
Return value:
#table:
Capabilities Table of caps
(Internal) Function to get current loaded mass
(Internal) Function to set troops positions of a template to a nice circle
Defined in:
CTLD
Parameters:
Core.Point#COORDINATE Coordinate
Start coordinate to use
#number Radius
Radius to be used
#number Heading
Heading starting with
#string Template
The group template name
Return value:
#table:
Positions The positions table
(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.
(Internal) Function to find and list nearby crates.
Defined in:
CTLD
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Unit#UNIT Unit
_group
_unit
Return value:
self
(Internal) Function to list loaded cargo.
(Internal) Function to show list of radio beacons
(Internal) Function to get and load nearby crates.
(Internal) Function to load troops into a heli.
Defined in:
CTLD
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Unit#UNIT Unit
#CTLD_CARGO Cargotype
#boolean Inject
(Internal) Function to move group to WP zone.
Defined in:
CTLD
Parameters:
Group
Unit
(Internal) Pre-load crates into a helo.
Do not use standalone!
Defined in:
CTLD
Parameters:
Wrapper.Group#GROUP Group
The group to load into, can be handed as Wrapper.Client#CLIENT object
Wrapper.Unit#UNIT Unit
The unit to load into, can be handed as Wrapper.Client#CLIENT object
#CTLD_CARGO Cargo
The Cargo crate object to load
#number NumberOfCrates
(Optional) Number of crates to be loaded. Default - all necessary to build this object. Might overload the helo!
Return value:
self
(Internal) Housekeeping - Function to refresh F10 menus.
(Internal) Function to find and Remove nearby crates. @param #CTLD self @param Wrapper.Group#GROUP Group @param Wrapper.Unit#UNIT Unit @return #CTLD self
Defined in:
CTLD
Parameters:
_group
_unit
(Internal) Function to repair nearby vehicles / FOBs
Defined in:
CTLD
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Unit#UNIT Unit
#boolean Engineering
If true, this is an engineering role
(Internal) Function to repair an object.
Defined in:
CTLD
Parameters:
Wrapper.Group#GROUP Group
Wrapper.Unit#UNIT Unit
#table Crates
Table of #CTLD_CARGO objects near the unit.
#CTLD.Buildable Build
Table build object.
#number Number
Number of objects in Crates (found) to limit search.
#boolean Engineering
If true it is an Engineering repair.
(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.
Wrapper.Group#GROUP Group
The group receiving the message.
(Internal) List if a Herc unit is flying in parameters.
(Internal) List if a unit is hovering in parameters.
(Internal) Function to unload crates from heli.
(Internal) Function to unload troops from heli.
(Internal) Function to calculate and set Unit internal cargo mass
Triggers the FSM event "Load" after a delay.
Defined in:
CTLD
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "Save" after a delay.
Defined in:
CTLD
Parameter:
#number delay
Delay in seconds.
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 onafterCratesBuild.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Vehicle
The #GROUP object of the vehicle or FOB build.
Return value:
self
On after "Load" event.
Loads dropped units from file.
Defined in:
CTLD
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string path
(Optional) Path where the file is located. Default is the DCS root installation folder or your "Saved Games\DCS" folder if the lfs module is desanitized.
#string filename
(Optional) File name for loading. Default is "CTLD_
On after "Save" event.
Player data is saved to file.
Defined in:
CTLD
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string path
Path where the file is saved. If nil, file is saved in the DCS root installtion directory or your "Saved Games" folder if lfs was desanitized.
#string filename
(Optional) File name for saving. Default is Default is "CTLD_
(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 onafterTroopsDeployed.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Troops
Troops #GROUP Object.
#CTLD.CargoZoneType Type
Type of Cargo deployed
Return value:
self
(Internal) FSM Function onbeforeCratesBuild.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Vehicle
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.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#table Cargotable
Table of #CTLD_CARGO objects dropped. Can be a Wrapper.DynamicCargo#DYNAMICCARGO object, if ground crew unloaded!
Return value:
self
(Internal) FSM Function onbeforeCratesPickedUp.
Defined in:
CTLD
Parameters:
#string From
State .
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#CTLD_CARGO Cargo
Cargo crate. Can be a Wrapper.DynamicCargo#DYNAMICCARGO object, if ground crew loaded!
Return value:
self
On before "Load" event.
Checks if io and lfs and the file are available.
Defined in:
CTLD
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string path
(Optional) Path where the file is located. Default is the DCS root installation folder or your "Saved Games\DCS" folder if the lfs module is desanitized.
#string filename
(Optional) File name for loading. Default is "CTLD_
On before "Save" event.
Checks if io and lfs are available.
Defined in:
CTLD
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string path
(Optional) Path where the file is saved. Default is the DCS root installation folder or your "Saved Games\DCS" folder if the lfs module is desanitized.
#string filename
(Optional) File name for saving. Default is "CTLD_
(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.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Troops
Troops #GROUP Object.
Return value:
self
(Internal) FSM Function onbeforeTroopsExtracted.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
Wrapper.Group#GROUP Troops
Troops #GROUP Object.
Return value:
self
(Internal) FSM Function onbeforeTroopsPickedUp.
Defined in:
CTLD
Parameters:
#string From
State.
#string Event
Trigger.
#string To
State.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
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.
Wrapper.Group#GROUP Group
Group Object.
Wrapper.Unit#UNIT Unit
Unit Object.
#string ZoneName
Name of the Zone where the Troops have been RTB'd.
Core.Zone#ZONE_Radius ZoneObject
of the Zone where the Troops have been RTB'd.
Return value:
self
Field(s)
Cargo
Name of the class.
list/load crates in this radius
search distance for crates to build or repair
factor for troops extraction, i.e. CrateDistance * Extractfactor
for troop/cargo drop via chute
280 kph or 150kn eq 77 mps
for troop/cargo drop via chute
pack objects in this radius
Folderpath.
radio beacons
Smokes and Flares
allow re-pickup crates
shape of the container
Coalition side number, e.g. coalition.side.RED
.
country of crates spawned
Parachuted herc cargo is not unpacked automatically but placed as crate to be unpacked
#1570
Chinook
added support Hercules Mod
load and save dropped TROOPS
slingload
Class id string for output to DCS log file.
disallow building in loadzones
enfore engineer build only?
zones stuff
for opening doors
place spawned crates in front of aircraft
noob catch
message suppression
sub categories
Verbosity level.
CTLD class version.
Function(s)
Adds an End state.
Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.
Defined in:
Parameters:
#table From
Can contain a string indicating the From state or a table of strings containing multiple From states.
#string Event
The Event name.
Core.Fsm#FSM_PROCESS Process
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.
Returns the End states.
Returns a table of the SubFSM rules defined within the FSM.
Returns a table with the scores defined.
Returns the start state of the FSM.
Get current state.
Returns a table with the Subs defined.
Returns a table of the transition rules defined within the FSM.
Check if FSM is in state.
Defined in:
Parameter:
#string State
State name.
Return value:
#boolean:
If true, FSM is in this state.
Load call backs.
Sets the start state of the FSM.
Add to map.
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.
Go sub.
Defined in:
Parameters:
#string ParentFrom
Parent from state.
#string ParentEvent
Parent event name.
Return value:
#table:
Subs.
Handler.
Is end state.
Defined in:
Parameter:
#string Current
Current state name.
Return values:
#table:
FSM parent.
#string:
Event name.
Sub maps.
Check if can do an event.
Defined in:
Parameter:
#string e
Event name.
Return values:
#boolean:
If true, FSM can do the event.
#string:
To state.
Check if cannot do an event.
Defined in:
Parameter:
#string e
Event name.
Return value:
#boolean:
If true, FSM cannot do the event.
Check if FSM is in state.
Defined in:
Parameters:
#string State
State name.
state
Return value:
#boolean:
If true, FSM is in this state.
Field(s)
Cargo
Name of the class.
list/load crates in this radius
search distance for crates to build or repair
factor for troops extraction, i.e. CrateDistance * Extractfactor
for troop/cargo drop via chute
280 kph or 150kn eq 77 mps
for troop/cargo drop via chute
pack objects in this radius
Folderpath.
radio beacons
Smokes and Flares
allow re-pickup crates
shape of the container
Coalition side number, e.g. coalition.side.RED
.
country of crates spawned
Parachuted herc cargo is not unpacked automatically but placed as crate to be unpacked
#1570
Chinook
added support Hercules Mod
load and save dropped TROOPS
slingload
Class id string for output to DCS log file.
disallow building in loadzones
enfore engineer build only?
zones stuff
for opening doors
place spawned crates in front of aircraft
noob catch
message suppression
sub categories
Verbosity level.
CTLD class version.
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.
IniObjectCategory
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.
IniObjectCategory
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT
event.
Creation of a Remove Unit Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Takeoff Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
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.
Log an exception which will be traced always.
Can be anywhere within the function logic.
Returns the event dispatcher
Trace a function call.
Must be at the beginning of the function logic.
Trace a function call level 2.
Must be at the beginning of the function logic.
Trace a function call level 3.
Must be at the beginning of the function logic.
Get the ClassID of the class instance.
Get the ClassName of the class instance.
Get the ClassName + ClassID of the class instance.
The ClassName + ClassID is formatted as '%s#%09d'.
Get the Class Core.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.
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()
Get a Value given a Key from the Object.
Note that if the Object is destroyed, set to nil, 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:
Core.Event#EVENTS EventID
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.
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).
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
Occurs when an Event for an object is triggered.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.
Occurs when a ground unit captures either an airbase or a farp.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any object is spawned into the mission.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned
Occurs when any aircraft crashes into the ground and is completely destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed
Occurs when an object is dead.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is dead.
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.
Discard chair after ejection.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a dynamic cargo crate is removed.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has ejected
Occurs when any aircraft shuts down its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.
Occurs when any aircraft starts its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.
Occurs whenever an object is hit by a weapon.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.
Occurs when any system fails on a human controlled aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that had the failure
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that killed the target
- target: Target Object
- weapon: Weapon Object
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has landed place: Object that the unit landed on. Can be an Airbase Object, FARP, or Ships
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- 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.
Occurs when a new mark was added.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark text was changed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark was removed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Weapon add.
Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.
Occurs when a player enters a slot and takes control of an aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any player assumes direct control of a unit.
Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is being taken control of.
Occurs when any player relieves control of a unit to the AI.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the player left.
Occurs when an aircraft connects with a tanker and begins taking on fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.
Occurs when an aircraft is finished taking fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was receiving fuel.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when any unit stops firing its weapon.
Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was doing the shooting.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is doing the shooting. target: The unit that is being targeted.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when an aircraft takes off from an airbase, farp, or ship.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships
Occurs when the game thinks an object is destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that is was destroyed.
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:
#string:
The Schedule ID 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:
#string:
The Schedule ID of the planned schedule.
Stops the Schedule.
Defined in:
Parameter:
#string SchedulerID
(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.
Set the Class Core.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.
Set a state or property of the Object given a Key and a Value.
Note that if the Object is destroyed, set to nil, 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.
Trace a function logic level 2.
Can be anywhere within the function logic.
Trace a function logic level 3.
Can be anywhere within the function logic.
Trace all methods in MOOSE
Set tracing for a class
Set tracing for a specific method of class
Set trace off.
Set trace on.
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.
Trace a function call.
This function is private.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
(Internal) Serialize arguments
Trace a function logic.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
The main event handling function...
This function captures all events generated for the class.
Buildable table info.
Field(s)
Is buildable or not.
Found crates.
Name of the object.
Required crates.
Template names for this build.
Function(s)
Zone Info.
Field(s)
Active or not.
Smoke color for zone, e.g. SMOKECOLOR.Red.
Beacon info as #CTLD.ZoneBeacon
Create and run radio beacons if active.
Name of Zone.
For ships - length of ship
For ships - width of ship
For dropped beacons - time this was created
Type of zone, i.e. load,drop,move,ship
Beacon info as #CTLD.ZoneBeacon
Beacon info as #CTLD.ZoneBeacon
Function(s)
Zone Type Info.
Field(s)
Function(s)
Field(s)
Function(s)
Radio Modulation
Field(s)
Function(s)
Unit capabilities.
Field(s)
Max loadable kgs of cargo.
Number of crates transportable.
Can transport crate.
Number of troop units transportable.
Can transport troops.
Unit type.
Function(s)
Radio Beacons
Field(s)
-- in mHz
-- i.e.CTLD.RadioModulation.FM or CTLD.RadioModulation.AM
-- Name of zone for the coordinate
Function(s)
- CTLD_CARGO class, extends Core.Base#BASE
Field(s)
Enumerator of Type.
Class name.
Crates needed to build.
Show this item in menu or not.
True if dropped from heli.
Flag for moving.
ID of this cargo.
Flag for direct loading.
Name for menu.
Mass in kg.
Resource Map information table if it has been set for static cargo items.
Individual static category if set.
Individual shape if set.
Individual type if set.
Number of builds available, -1 for unlimited.
Sub-category name.
Table of #POSITIONABLE objects.
Table of unit types able to pick this cargo up.
Function(s)
Add mark
Add Stock.
Defined in:
CTLD_CARGO
Parameter:
#number Number
to add, none if nil.
Return value:
self
Add specific unit types to this CARGO (restrict what types can pick this up).
Defined in:
CTLD_CARGO
Parameter:
#string UnitTypes
Unit type name, can also be a #list<#string> table of unit type names.
Return value:
self
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 Location.
Get mark
Defined in:
CTLD_CARGO
Parameter:
Mark
Return value:
#string:
Mark
Get overall mass of a cargo object, i.e.
crates needed x mass per crate
Defined in:
CTLD_CARGO
Return value:
#number:
mass
Query type.
Get Resource Map information table
Defined in:
CTLD_CARGO
Return value:
#table:
ResourceMap
Get the specific static type and shape from this CARGO if set.
Defined in:
CTLD_CARGO
Return values:
#string:
Category
#string:
TypeName
#string:
ShapeName
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.
#CTLD_CARGO.Enum Sorte
Enumerator of Type.
#boolean HasBeenMoved
Flag for moving.
#boolean LoadDirectly
Flag for direct loading.
#number CratesNeeded
Crates needed to build.
Wrapper.Positionable#POSITIONABLE Positionable
Representation of cargo in the mission.
#boolean Dropped
Cargo/Troops have been unloaded from a chopper.
#number PerCrateMass
Mass in kg
#number Stock
Number of builds available, nil for unlimited
#string Subcategory
Name of subcategory, handy if using > 10 types to load.
#boolean DontShowInMenu
Show this item in menu or not (default: false == show it).
Core.Zone#ZONE Location
(optional) Where the cargo is available (one location only).
Return value:
self
Remove Stock.
Defined in:
CTLD_CARGO
Parameter:
#number Number
to reduce, none if nil.
Return value:
self
Add Resource Map information table
Add specific static type and shape to this CARGO.
Defined in:
CTLD_CARGO
Parameters:
#string TypeName
#string ShapeName
Category
Return value:
self
Set Stock.
Defined in:
CTLD_CARGO
Parameter:
#number Number
to set, nil means unlimited.
Return value:
self
Set WasDropped.
Defined in:
CTLD_CARGO
Parameter:
#boolean dropped
Check if a specific unit can carry this CARGO (restrict what types can pick this up).
Query was dropped.
Defined in:
CTLD_CARGO
Return value:
#boolean:
Has been dropped.
Field(s)
Enumerator of Type.
Class name.
Crates needed to build.
Show this item in menu or not.
True if dropped from heli.
Flag for moving.
ID of this cargo.
Flag for direct loading.
Name for menu.
Mass in kg.
Resource Map information table if it has been set for static cargo items.
Individual static category if set.
Individual shape if set.
Individual type if set.
Number of builds available, -1 for unlimited.
Sub-category name.
Table of #POSITIONABLE objects.
Table of unit types able to pick this cargo up.
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.
IniObjectCategory
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.
IniObjectCategory
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT
event.
Creation of a Remove Unit Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Takeoff Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
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.
Log an exception which will be traced always.
Can be anywhere within the function logic.
Returns the event dispatcher
Remove all subscribed events
Trace a function call.
Must be at the beginning of the function logic.
Trace a function call level 2.
Must be at the beginning of the function logic.
Trace a function call level 3.
Must be at the beginning of the function logic.
Get the ClassID of the class instance.
Get the ClassName of the class instance.
Get the ClassName + ClassID of the class instance.
The ClassName + ClassID is formatted as '%s#%09d'.
Get the Class Core.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.
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()
Get a Value given a Key from the Object.
Note that if the Object is destroyed, set to nil, 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:
Core.Event#EVENTS EventID
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.
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).
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
Occurs when an Event for an object is triggered.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.
Occurs when a ground unit captures either an airbase or a farp.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any object is spawned into the mission.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned
Occurs when any aircraft crashes into the ground and is completely destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed
Occurs when an object is dead.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is dead.
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.
Discard chair after ejection.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a dynamic cargo crate is removed.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has ejected
Occurs when any aircraft shuts down its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.
Occurs when any aircraft starts its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.
Occurs whenever an object is hit by a weapon.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.
Occurs when any system fails on a human controlled aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that had the failure
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that killed the target
- target: Target Object
- weapon: Weapon Object
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has landed place: Object that the unit landed on. Can be an Airbase Object, FARP, or Ships
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- 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.
Occurs when a new mark was added.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark text was changed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark was removed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Weapon add.
Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.
Occurs when a player enters a slot and takes control of an aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any player assumes direct control of a unit.
Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is being taken control of.
Occurs when any player relieves control of a unit to the AI.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the player left.
Occurs when an aircraft connects with a tanker and begins taking on fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.
Occurs when an aircraft is finished taking fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was receiving fuel.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when any unit stops firing its weapon.
Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was doing the shooting.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is doing the shooting. target: The unit that is being targeted.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when an aircraft takes off from an airbase, farp, or ship.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships
Occurs when the game thinks an object is destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that is was destroyed.
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:
#string:
The Schedule ID 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:
#string:
The Schedule ID of the planned schedule.
Stops the Schedule.
Defined in:
Parameter:
#string SchedulerID
(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.
Set the Class Core.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.
Set a state or property of the Object given a Key and a Value.
Note that if the Object is destroyed, set to nil, 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.
Trace a function logic level 2.
Can be anywhere within the function logic.
Trace a function logic level 3.
Can be anywhere within the function logic.
Trace all methods in MOOSE
Set tracing for a class
Set tracing for a specific method of class
Set trace off.
Set trace on.
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.
Trace a function call.
This function is private.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
(Internal) Serialize arguments
Trace a function logic.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
The main event handling function...
This function captures all events generated for the class.
Define cargo types.
Field(s)
Function(s)
- CTLD_ENGINEERING class, extends Core.Base#BASE
Field(s)
wait this many secs before trying a crate again
Function(s)
(Internal) Arrived at crates in reach.
Stop group.
(Internal) Set build status.
(Internal) Set done status.
(Internal) Get the status
Defined in:
CTLD_ENGINEERING
Return value:
#string:
State
(Internal) Check the negative status
Defined in:
CTLD_ENGINEERING
Parameter:
#string State
Return value:
#boolean:
Outcome
(Internal) Check the status
Defined in:
CTLD_ENGINEERING
Parameter:
#string State
Return value:
#boolean:
Outcome
(Internal) Move towards crates in reach.
Create a new instance.
Defined in:
CTLD_ENGINEERING
Parameters:
#string Name
#string GroupName
Name of Engineering #GROUP object
Wrapper.Group#GROUP HeliGroup
HeliGroup
Wrapper.Unit#UNIT HeliUnit
HeliUnit
Return value:
self
(Internal) Search for crates in reach.
Defined in:
CTLD_ENGINEERING
Parameters:
#table crates
Table of found crate Ops.CTLD#CTLD_CARGO objects.
#number number
Number of crates found.
Return value:
self
(Internal) Set the status
(Internal) Set start status.
(Internal) Set stop status.
(Internal) Return distance in meters between two coordinates.
Defined in:
CTLD_ENGINEERING
Parameters:
Core.Point#COORDINATE _point1
Coordinate one
Core.Point#COORDINATE _point2
Coordinate two
Return value:
#number:
Distance in meters or -1
Field(s)
wait this many secs before trying a crate again
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.
IniObjectCategory
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.
IniObjectCategory
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT
event.
Creation of a Remove Unit Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Takeoff Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
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.
Log an exception which will be traced always.
Can be anywhere within the function logic.
Returns the event dispatcher
Remove all subscribed events
Trace a function call.
Must be at the beginning of the function logic.
Trace a function call level 2.
Must be at the beginning of the function logic.
Trace a function call level 3.
Must be at the beginning of the function logic.
Get the ClassID of the class instance.
Get the ClassName of the class instance.
Get the ClassName + ClassID of the class instance.
The ClassName + ClassID is formatted as '%s#%09d'.
Get the Class Core.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.
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()
Get a Value given a Key from the Object.
Note that if the Object is destroyed, set to nil, 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:
Core.Event#EVENTS EventID
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.
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).
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
Occurs when an Event for an object is triggered.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.
Occurs when a ground unit captures either an airbase or a farp.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any object is spawned into the mission.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned
Occurs when any aircraft crashes into the ground and is completely destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed
Occurs when an object is dead.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is dead.
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.
Discard chair after ejection.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a dynamic cargo crate is removed.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has ejected
Occurs when any aircraft shuts down its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.
Occurs when any aircraft starts its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.
Occurs whenever an object is hit by a weapon.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.
Occurs when any system fails on a human controlled aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that had the failure
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that killed the target
- target: Target Object
- weapon: Weapon Object
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has landed place: Object that the unit landed on. Can be an Airbase Object, FARP, or Ships
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- 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.
Occurs when a new mark was added.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark text was changed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark was removed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Weapon add.
Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.
Occurs when a player enters a slot and takes control of an aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any player assumes direct control of a unit.
Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is being taken control of.
Occurs when any player relieves control of a unit to the AI.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the player left.
Occurs when an aircraft connects with a tanker and begins taking on fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.
Occurs when an aircraft is finished taking fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was receiving fuel.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when any unit stops firing its weapon.
Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was doing the shooting.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is doing the shooting. target: The unit that is being targeted.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when an aircraft takes off from an airbase, farp, or ship.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships
Occurs when the game thinks an object is destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that is was destroyed.
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:
#string:
The Schedule ID 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:
#string:
The Schedule ID of the planned schedule.
Stops the Schedule.
Defined in:
Parameter:
#string SchedulerID
(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.
Set the Class Core.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.
Set a state or property of the Object given a Key and a Value.
Note that if the Object is destroyed, set to nil, 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.
Trace a function logic level 2.
Can be anywhere within the function logic.
Trace a function logic level 3.
Can be anywhere within the function logic.
Trace all methods in MOOSE
Set tracing for a class
Set tracing for a specific method of class
Set trace level
Set trace off.
Set trace on.
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.
Trace a function call.
This function is private.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
(Internal) Serialize arguments
Trace a function logic.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
The main event handling function...
This function captures all events generated for the class.
- CTLD_HERCULES class, extends Core.Base#BASE
Field(s)
template for a group of 10 paratroopers
Function(s)
[Internal] Function to calc initiator heading
Defined in:
CTLD_HERCULES
Parameter:
Wrapper.Group#GROUP Cargo_Drop_initiator
Return value:
#number:
north corrected heading
[Internal] Function to calc north correction
Defined in:
CTLD_HERCULES
Parameter:
Core.Point#POINT_Vec3 point
Position Vec3
Return value:
#number:
north correction
[Internal] Function to calculate object height
Defined in:
CTLD_HERCULES
Parameter:
Wrapper.Group#GROUP group
The group for which to calculate the height
Return value:
#number:
height over ground
[Internal] Function to initialize dropped cargo
Defined in:
CTLD_HERCULES
Parameters:
Wrapper.Group#GROUP Initiator
#table Cargo_Contents
Table 'weapon' from event data
#string Cargo_Type_name
Name of this cargo
#boolean Container_Enclosed
Is container?
#boolean SoldierGroup
Is soldier group?
#boolean ParatrooperGroupSpawnInit
Is paratroopers?
Return value:
self
[Internal] Function to spawn cargo by type at position
Defined in:
CTLD_HERCULES
Parameters:
#string Cargo_Type_name
Core.Point#POINT_VEC3 Cargo_Drop_Position
_name
_pos
Return value:
self
[Internal] Function to spawn a group
Defined in:
CTLD_HERCULES
Parameters:
Wrapper.Group#GROUP Cargo_Drop_initiator
Core.Point#POINT_VEC3 Cargo_Drop_Position
#string Cargo_Type_name
#number CargoHeading
#number Cargo_Country
Return value:
self
[Internal] Spawn cargo objects
Defined in:
CTLD_HERCULES
Parameters:
Wrapper.Group#GROUP Cargo_Drop_initiator
#number Cargo_Drop_Direction
Core.Point#COORDINATE Cargo_Content_position
#string Cargo_Type_name
#boolean Cargo_over_water
#boolean Container_Enclosed
#boolean ParatrooperGroupSpawn
#boolean offload_cargo
#boolean all_cargo_survive_to_the_ground
#boolean all_cargo_gets_destroyed
#boolean destroy_cargo_dropped_without_parachute
#number Cargo_Country
Return value:
self
[Internal] Function to spawn static cargo
Defined in:
CTLD_HERCULES
Parameters:
Wrapper.Group#GROUP Cargo_Drop_initiator
Core.Point#POINT_VEC3 Cargo_Drop_Position
#string Cargo_Type_name
#number CargoHeading
#boolean dead
#number Cargo_Country
Return value:
self
[Internal] Function to track cargo objects
Defined in:
CTLD_HERCULES
Parameters:
Wrapper.Group#GROUP initiator
Return value:
#number:
height over ground
[Internal] Function to check availability of templates
[Internal] Function to check surface type
Defined in:
CTLD_HERCULES
Parameters:
Wrapper.Group#GROUP group
The group for which to calculate the height
object
Return value:
#number:
height over ground
[User] Instantiate a new object
Defined in:
CTLD_HERCULES
Parameters:
#string Coalition
Coalition side, "red", "blue" or "neutral"
#string Alias
Name of this instance
Ops.CTLD#CTLD CtldObject
CTLD instance to link into
Return value:
self
Usage:
Integrate to your CTLD instance like so, where `my_ctld` is a previously created CTLD instance:
my_ctld.enableHercules = false -- avoid dual loading via CTLD F10 and F8 ground crew
local herccargo = CTLD_HERCULES:New("blue", "Hercules Test", my_ctld)
You also need:
* A template called "Infantry" for 10 Paratroopers (as set via herccargo.infantrytemplate).
* Depending on what you are loading with the help of the ground crew, there are 42 more templates for the various vehicles that are loadable.
There's a **quick check output in the `dcs.log`** which tells you what's there and what not.
E.g.:
...Checking template for APC BTR-82A Air [24998lb] (BTR-82A) ... MISSING)
...Checking template for ART 2S9 NONA Skid [19030lb] (SAU 2-C9) ... MISSING)
...Checking template for EWR SBORKA Air [21624lb] (Dog Ear radar) ... MISSING)
...Checking template for Transport Tigr Air [15900lb] (Tigr_233036) ... OK)
Expected template names are the ones in the rounded brackets.
### HINTS
The script works on the EVENTS.Shot trigger, which is used by the mod when you **drop cargo from the Hercules while flying**. Unloading on the ground does
not achieve anything here. If you just want to unload on the ground, use the normal Moose CTLD.
**Do not use** the **splash damage** script together with this, your cargo will just explode when reaching the ground!
### Airdrops
There are two ways of airdropping:
1) Very low and very slow (>5m and <10m AGL) - here you can drop stuff which has "Skid" at the end of the cargo name (loaded via F8 Ground Crew menu)
2) Higher up and slow (>100m AGL) - here you can drop paratroopers and cargo which has "Air" at the end of the cargo name (loaded via F8 Ground Crew menu)
### General
Use either this method to integrate the Hercules **or** the one from the "normal" CTLD. Never both!
[Internal] Function to change cargotype per group (Wrench)
Defined in:
CTLD_HERCULES
Parameters:
#number key
Carrier key id
#string cargoType
Type of cargo
#number cargoNum
Number of cargo objects
Return value:
self
[Internal] Function to spawn a soldier group of 10 units
Defined in:
CTLD_HERCULES
Parameters:
Wrapper.Group#GROUP Cargo_Drop_initiator
Core.Point#POINT_VEC3 Cargo_Drop_Position
#string Cargo_Type_name
#number CargoHeading
#number Cargo_Country
#number GroupSpacing
Return value:
self
[Internal] Function to capture BIRTH event
[Internal] Function to capture SHOT event
Defined in:
CTLD_HERCULES
Parameter:
Core.Event#EVENTDATA Cargo_Drop_Event
The event data
Return value:
self
Field(s)
template for a group of 10 paratroopers
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.
IniObjectCategory
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.
IniObjectCategory
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT
event.
Creation of a Remove Unit Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
Creation of a Takeoff Event.
Defined in:
Parameters:
DCS#Time EventTime
The time stamp of the event.
DCS#Object Initiator
The initiating object of the event.
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.
Log an exception which will be traced always.
Can be anywhere within the function logic.
Returns the event dispatcher
Remove all subscribed events
Trace a function call.
Must be at the beginning of the function logic.
Trace a function call level 2.
Must be at the beginning of the function logic.
Trace a function call level 3.
Must be at the beginning of the function logic.
Get the ClassID of the class instance.
Get the ClassName of the class instance.
Get the ClassName + ClassID of the class instance.
The ClassName + ClassID is formatted as '%s#%09d'.
Get the Class Core.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.
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()
Get a Value given a Key from the Object.
Note that if the Object is destroyed, set to nil, 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:
Core.Event#EVENTS EventID
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.
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).
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
Occurs when an Event for an object is triggered.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.
Occurs when a ground unit captures either an airbase or a farp.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any object is spawned into the mission.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned
Occurs when any aircraft crashes into the ground and is completely destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed
Occurs when an object is dead.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is dead.
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.
Discard chair after ejection.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a dynamic cargo crate is removed.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has ejected
Occurs when any aircraft shuts down its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.
Occurs when any aircraft starts its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.
Occurs whenever an object is hit by a weapon.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.
Occurs when any system fails on a human controlled aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that had the failure
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that killed the target
- target: Target Object
- weapon: Weapon Object
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has landed place: Object that the unit landed on. Can be an Airbase Object, FARP, or Ships
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- 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.
Occurs when a new mark was added.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark text was changed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark was removed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Weapon add.
Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.
Occurs when a player enters a slot and takes control of an aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any player assumes direct control of a unit.
Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is being taken control of.
Occurs when any player relieves control of a unit to the AI.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the player left.
Occurs when an aircraft connects with a tanker and begins taking on fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.
Occurs when an aircraft is finished taking fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was receiving fuel.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when any unit stops firing its weapon.
Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was doing the shooting.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is doing the shooting. target: The unit that is being targeted.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when an aircraft takes off from an airbase, farp, or ship.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships
Occurs when the game thinks an object is destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that is was destroyed.
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:
#string:
The Schedule ID 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:
#string:
The Schedule ID of the planned schedule.
Stops the Schedule.
Defined in:
Parameter:
#string SchedulerID
(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.
Set the Class Core.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.
Set a state or property of the Object given a Key and a Value.
Note that if the Object is destroyed, set to nil, 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.
Trace a function logic level 2.
Can be anywhere within the function logic.
Trace a function logic level 3.
Can be anywhere within the function logic.
Trace all methods in MOOSE
Set tracing for a class
Set tracing for a specific method of class
Set trace off.
Set trace on.
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.
Trace a function call.
This function is private.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
(Internal) Serialize arguments
Trace a function logic.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
The main event handling function...
This function captures all events generated for the class.
Cargo Object
Field(s)
pallets gets destroyed in water
Function(s)
Define cargo types.
Field(s)
Name of cargo type, container (boolean) in container or not.