Module Ops.CSAR
Ops - Combat Search and Rescue.
CSAR - MOOSE based Helicopter CSAR Operations.
Missions:--- Ops -- Combat Search and Rescue.
CSAR - MOOSE based Helicopter CSAR Operations.
Missions:
CSAR - Combat Search & Rescue
Main Features:
- MOOSE-based Helicopter CSAR Operations for Players.
Author: Applevangelist (Moose Version), Ciribob (original), Thanks to: Shadowze, Cammel (testing), The Chosen One (Persistence)
Global(s)
Global CSAR |
Combat search and rescue (CSAR) are search and rescue operations that are carried out during war that are within or near combat zones. (Wikipedia) CSAR Concept
|
Combat search and rescue (CSAR) are search and rescue operations that are carried out during war that are within or near combat zones. (Wikipedia)
CSAR Concept
- MOOSE-based Helicopter CSAR Operations for Players.
- Object oriented refactoring of Ciribob's fantastic CSAR script.
- No need for extra MIST loading.
- Additional events to tailor your mission.
- Optional SpawnCASEVAC to create casualties without beacon (e.g. handling dead ground vehicles and create CASVAC requests).
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 a late-activated single infantry unit as template in the mission editor and name it e.g. "Downed Pilot".
Example sound files are here: Moose Sound
1. Basic Setup
A basic setup example is the following:
-- Instantiate and start a CSAR for the blue side, with template "Downed Pilot" and alias "Luftrettung"
local my_csar = CSAR:New(coalition.side.BLUE,"Downed Pilot","Luftrettung")
-- options
my_csar.immortalcrew = true -- downed pilot spawn is immortal
my_csar.invisiblecrew = false -- downed pilot spawn is visible
-- start the FSM
my_csar:__Start(5)
2. Options
The following options are available (with their defaults). Only set the ones you want changed:
mycsar.allowDownedPilotCAcontrol = false -- Set to false if you don\'t want to allow control by Combined Arms.
mycsar.allowFARPRescue = true -- allows pilots to be rescued by landing at a FARP or Airbase. Else MASH only!
mycsar.FARPRescueDistance = 1000 -- you need to be this close to a FARP or Airport for the pilot to be rescued.
mycsar.autosmoke = false -- automatically smoke a downed pilot\'s location when a heli is near.
mycsar.autosmokedistance = 1000 -- distance for autosmoke
mycsar.coordtype = 1 -- Use Lat/Long DDM (0), Lat/Long DMS (1), MGRS (2), Bullseye imperial (3) or Bullseye metric (4) for coordinates.
mycsar.csarOncrash = false -- (WIP) If set to true, will generate a downed pilot when a plane crashes as well.
mycsar.enableForAI = false -- set to false to disable AI pilots from being rescued.
mycsar.pilotRuntoExtractPoint = true -- Downed pilot will run to the rescue helicopter up to mycsar.extractDistance in meters.
mycsar.extractDistance = 500 -- Distance the downed pilot will start to run to the rescue helicopter.
mycsar.immortalcrew = true -- Set to true to make wounded crew immortal.
mycsar.invisiblecrew = false -- Set to true to make wounded crew insvisible.
mycsar.loadDistance = 75 -- configure distance for pilots to get into helicopter in meters.
mycsar.mashprefix = {"MASH"} -- prefixes of #GROUP objects used as MASHes.
mycsar.max_units = 6 -- max number of pilots that can be carried if #CSAR.AircraftType is undefined.
mycsar.messageTime = 15 -- Time to show messages for in seconds. Doubled for long messages.
mycsar.radioSound = "beacon.ogg" -- the name of the sound file to use for the pilots\' radio beacons.
mycsar.smokecolor = 4 -- Color of smokemarker, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue.
mycsar.useprefix = true -- Requires CSAR helicopter #GROUP names to have the prefix(es) defined below.
mycsar.csarPrefix = { "helicargo", "MEDEVAC"} -- #GROUP name prefixes used for useprefix=true - DO NOT use # in helicopter names in the Mission Editor!
mycsar.verbose = 0 -- set to > 1 for stats output for debugging.
-- limit amount of downed pilots spawned by **ejection** events
mycsar.limitmaxdownedpilots = true
mycsar.maxdownedpilots = 10
-- allow to set far/near distance for approach and optionally pilot must open doors
mycsar.approachdist_far = 5000 -- switch do 10 sec interval approach mode, meters
mycsar.approachdist_near = 3000 -- switch to 5 sec interval approach mode, meters
mycsar.pilotmustopendoors = false -- switch to true to enable check of open doors
mycsar.suppressmessages = false -- switch off all messaging if you want to do your own
mycsar.rescuehoverheight = 20 -- max height for a hovering rescue in meters
mycsar.rescuehoverdistance = 10 -- max distance for a hovering rescue in meters
-- Country codes for spawned pilots
mycsar.countryblue= country.id.USA
mycsar.countryred = country.id.RUSSIA
mycsar.countryneutral = country.id.UN_PEACEKEEPERS
mycsar.topmenuname = "CSAR" -- set the menu entry name
mycsar.ADFRadioPwr = 1000 -- ADF Beacons sending with 1KW as default
mycsar.PilotWeight = 80 -- Loaded pilots weigh 80kgs each
mycsar.AllowIRStrobe = false -- Allow a menu item to request an IR strobe to find a downed pilot at night (requires NVGs to see it).
mycsar.IRStrobeRuntime = 300 -- If an IR Strobe is activated, it runs for 300 seconds (5 mins).
2.1 Create own SET_GROUP to manage CTLD Pilot groups
-- Parameter: Set The SET_GROUP object created by the mission designer/user to represent the CSAR pilot groups.
-- Needs to be set before starting the CSAR instance.
local myset = SET_GROUP:New():FilterPrefixes("Helikopter"):FilterCoalitions("red"):FilterStart()
mycsar:SetOwnSetPilotGroups(myset)
2.2 SRS Features and Other Features
mycsar.useSRS = false -- Set true to use FF\'s SRS integration
mycsar.SRSPath = "C:\\Progra~1\\DCS-SimpleRadio-Standalone\\" -- adjust your own path in your SRS installation -- server(!)
mycsar.SRSchannel = 300 -- radio channel
mycsar.SRSModulation = radio.modulation.AM -- modulation
mycsar.SRSport = 5002 -- and SRS Server port
mycsar.SRSCulture = "en-GB" -- SRS voice culture
mycsar.SRSVoice = nil -- SRS voice for downed pilot, relevant for Google TTS
mycsar.SRSGPathToCredentials = nil -- Path to your Google credentials json file, set this if you want to use Google TTS
mycsar.SRSVolume = 1 -- Volume, between 0 and 1
mycsar.SRSGender = "male" -- male or female voice
mycsar.CSARVoice = MSRS.Voices.Google.Standard.en_US_Standard_A -- SRS voice for CSAR Controller, relevant for Google TTS
mycsar.CSARVoiceMS = MSRS.Voices.Microsoft.Hedda -- SRS voice for CSAR Controller, relevant for MS Desktop TTS
mycsar.coordinate -- Coordinate from which CSAR TTS is sending. Defaults to a random MASH object position
--
mycsar.csarUsePara = false -- If set to true, will use the LandingAfterEjection Event instead of Ejection. Requires mycsar.enableForAI to be set to true. --shagrat
mycsar.wetfeettemplate = "man in floating thingy" -- if you use a mod to have a pilot in a rescue float, put the template name in here for wet feet spawns. Note: in conjunction with csarUsePara this might create dual ejected pilots in edge cases.
mycsar.allowbronco = false -- set to true to use the Bronco mod as a CSAR plane
mycsar.CreateRadioBeacons = true -- set to false to disallow creating ADF radio beacons.
3. Results
Number of successful landings with save pilots and aggregated number of saved pilots is stored in these variables in the object:
mycsar.rescues -- number of successful landings *with* saved pilots
mycsar.rescuedpilots -- aggregated number of pilots rescued from the field (of *all* players)
4. Events
The class comes with a number of FSM-based events that missions designers can use to shape their mission. These are:
4.1. PilotDown.
The event is triggered when a new downed pilot is detected. Use e.g. `function my_csar:OnAfterPilotDown(...)` to link into this event:
function my_csar:OnAfterPilotDown(from, event, to, spawnedgroup, frequency, groupname, coordinates_text)
... your code here ...
end
4.2. Approach.
A CSAR helicpoter is closing in on a downed pilot. Use e.g. `function my_csar:OnAfterApproach(...)` to link into this event:
function my_csar:OnAfterApproach(from, event, to, heliname, groupname)
... your code here ...
end
4.3. Boarded.
The pilot has been boarded to the helicopter. Use e.g. `function my_csar:OnAfterBoarded(...)` to link into this event:
function my_csar:OnAfterBoarded(from, event, to, heliname, groupname, description)
... your code here ...
end
4.4. Returning.
The CSAR helicopter is ready to return to an Airbase, FARP or MASH. Use e.g. `function my_csar:OnAfterReturning(...)` to link into this event:
function my_csar:OnAfterReturning(from, event, to, heliname, groupname)
... your code here ...
end
4.5. Rescued.
The CSAR helicopter has landed close to an Airbase/MASH/FARP and the pilots are safe. Use e.g. `function my_csar:OnAfterRescued(...)` to link into this event:
function my_csar:OnAfterRescued(from, event, to, heliunit, heliname, pilotssaved)
... your code here ...
end
5. Spawn downed pilots at location to be picked up.
If missions designers want to spawn downed pilots into the field, e.g. at mission begin to give the helicopter guys works, they can do this like so:
-- Create downed "Pilot Wagner" in #ZONE "CSAR_Start_1" at a random point for the blue coalition
my_csar:SpawnCSARAtZone( "CSAR_Start_1", coalition.side.BLUE, "Pilot Wagner", true )
--Create a casualty and CASEVAC request from a "Point" (VEC2) for the blue coalition --shagrat
my_csar:SpawnCASEVAC(Point, coalition.side.BLUE)
6. Save and load downed pilots - Persistance
You can save and later load back downed pilots 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:
mycsar.enableLoadSave = true -- allow auto-saving and loading of files
mycsar.saveinterval = 600 -- save every 10 minutes
mycsar.filename = "missionsave.csv" -- example filename
mycsar.filepath = "C:\\Users\\myname\\Saved Games\\DCS\Missions\\MyMission" -- example path
Then use an initial load at the beginning of your mission:
mycsar:__Load(10)
Caveat: Dropped troop noMessage and forcedesc parameters aren't saved.
Type(s)
Fields and Methods inherited from CSAR | Description |
---|---|
(User) Add a PLAYERTASK - FSM events will check success |
|
Name of the class. |
|
Triggers the FSM event "Save". |
|
Create a new CSAR object and start the FSM. |
|
CSAR:OnAfterApproach(From, Event, To, Heliname, Woundedgroupname) |
On After "Aproach" event. |
CSAR:OnAfterBoarded(From, Event, To, Heliname, Woundedgroupname, Description) |
On After "Boarded" event. |
On After "KIA" event. |
|
On After "Landed" event. |
|
FSM Function OnAfterLoad. |
|
CSAR:OnAfterPilotDown(From, Event, To, Group, Frequency, Leadername, CoordinatesText, Playername) |
On After "PilotDown" event. |
CSAR:OnAfterRescued(From, Event, To, HeliUnit, HeliName, PilotsSaved) |
On After "Rescued" event. |
CSAR:OnAfterReturning(From, Event, To, Heliname, Woundedgroupname) |
On After "Returning" event. |
FSM Function OnAfterSave. |
|
CSAR:SetCallSignOptions(ShortCallsign, Keepnumber, CallsignTranslations) |
[User] Set callsign options for TTS output. |
User - Function to add onw SET_GROUP Set-up for pilot filtering and assignment. |
|
CSAR:SpawnCASEVAC(Point, Coalition, Description, Nomessage, Unitname, Typename, Forcedesc) |
Function to add a CSAR object into the scene at a zone coordinate. |
Function to add a CSAR object into the scene at a zone coordinate. |
|
Triggers the FSM event "Start". |
|
Triggers the FSM event "Status". |
|
Set of CSAR heli groups as designed by the mission designer (if any set). |
|
(Internal) Function to add beacon to downed pilot. |
|
(Internal) Function to spawn a CSAR object into the scene. |
|
(Internal) Populate F10 menu for CSAR players. |
|
(Internal) Add options to a downed pilot |
|
CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedGroup, _woundedGroupName) |
(Internal) Function to check if heli is close to group. |
(Internal) Function called before Status() event. |
|
(Internal) Check if a name is in downed pilot table |
|
(Internal) Display onboarded rescued pilots. |
|
(Internal) Check state of wounded group. |
|
(Internal) Helper function to count active downed pilots. |
|
(Internal) Function to insert downed pilot tracker object. |
|
(Internal) Display active SAR tasks to player. |
|
CSAR:_DisplayMessageToSAR(_unit, _text, _time, _clear, _speak, _override) |
(Internal) Display message to single Unit. |
CSAR:_DisplayToAllSAR(_message, _side, _messagetime, ToSRS, ToScreen) |
(Internal) Display info to all SAR groups. |
(Internal) Function to check for dupe eject events. |
|
(Internal) Event handler. |
|
(Internal) Pop frequency from prepopulated table. |
|
(Internal) Populate table with available beacon frequencies. |
|
(Internal) Function to determine clockwise direction for flares. |
|
(Internal) Find the closest downed pilot to a heli. |
|
(Internal) Determine distance to closest MASH. |
|
(Internal) Check if a name is in downed pilot table and remove it. |
|
(Internal) Return distance in meters between two coordinates. |
|
(Internal) Function to get string of a group's position. |
|
(Internal) Check and return Wrappe.Unit#UNIT based on the name if alive. |
|
CSAR:_InitSARForPilot(_downedGroup, _GroupName, _freq, _nomessage, _playername) |
(Internal) Initialize the action for a pilot. |
(internal) Function to check if the heli door(s) are open. |
|
(Internal) Move group to destination. |
|
CSAR:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupName) |
(Internal) Function to pickup the wounded pilot from the ground. |
(Internal) Count pilots on board. |
|
(Internal) Function to pop a smoke at a wounded pilot's positions. |
|
(Internal) Helper to decide if we're over max limit. |
|
(Internal) Helper function to (re-)add beacon to downed pilot. |
|
(Internal) Check if a name is in downed pilot table and remove it. |
|
(Internal) Request IR Strobe at closest downed pilot. |
|
(Internal) Request smoke at closest downed pilot. |
|
(Internal) Mark pilot as rescued and remove from tables. |
|
CSAR:_ScheduledSARFlight(heliname, groupname, isairport, noreschedule) |
(Internal) Monitor in-flight returning groups. |
(Internal) Fire a flare at the point of a downed pilot. |
|
CSAR:_SpawnCASEVAC(_Point, _coalition, _description, _nomessage, unitname, typename, forcedesc) |
(Internal) Function to add a CSAR object into the scene at a Point coordinate (VEC_2). |
(Internal) Function to add a CSAR object into the scene at a zone coordinate. |
|
(Internal) Spawn a downed pilot |
|
(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. |
|
Set of CSAR heli groups. |
|
Coalition side number, e.g. |
|
Class id string for output to DCS log file. |
|
On after "Load" event. |
|
On after "Save" event. |
|
(Internal) Function called after Start() event. |
|
(Internal) Function called after Status() event. |
|
(Internal) Function called after Stop() event. |
|
CSAR:onbeforeApproach(From, Event, To, Heliname, Woundedgroupname) |
(Internal) Function called before Approach() event. |
CSAR:onbeforeBoarded(From, Event, To, Heliname, Woundedgroupname) |
(Internal) Function called before Boarded() event. |
(Internal) Function called before Landed() event. |
|
On before "Load" event. |
|
CSAR:onbeforePilotDown(From, Event, To, Group, Frequency, Leadername, CoordinatesText, Playername) |
(Internal) Function called before PilotDown() event. |
CSAR:onbeforeRescued(From, Event, To, HeliUnit, HeliName, PilotsSaved) |
(Internal) Function called before Rescued() event. |
CSAR:onbeforeReturning(From, Event, To, Heliname, Woundedgroupname, IsAirport, IsAirPort) |
(Internal) Function called before Returning() event. |
On before "Save" event. |
|
(Internal) Function called before Status() event. |
|
Verbosity level. |
|
CSAR 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. |
|
CSAR:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
CSAR:CreateEventCrash(EventTime, Initiator, IniObjectCategory) |
Creation of a Crash Event. |
CSAR: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. |
|
CSAR: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. |
|
CSAR:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
(Internal) Serialize arguments |
|
CSAR:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
The main event handling function... |
Fields and Methods inherited from CSAR.AircraftType | Description |
---|---|
Unit type name. |
Fields and Methods inherited from CSAR.DownedPilot | Description |
---|---|
Name of radio beacon - if any. |
|
Group is alive or dead/rescued. |
|
Description. |
|
Frequency of the NDB. |
|
Spawned group object. |
|
Pilot index. |
|
Name of the spawned group. |
|
Name of the original unit. |
|
Player name if applicable. |
|
Coalition. |
|
Timestamp for approach process. |
|
Typename of Unit. |
|
Group is spawned over (deep) water. |
- CSAR class, extends Core.Base#BASE, Core.Fsm#FSM
Field(s)
Name of the class.
you need to be this close to a FARP or Airport for the pilot to be rescued.
added 1.0.16
male or female
modulation
adjust your own path in your server(!)
volume 0.0 to 1.0
radio channel
port
Set of CSAR heli groups as designed by the mission designer (if any set).
tables, mainly for tracking actions
Set to false if you don't want to allow control by Combined arms.
allows pilot to be rescued by landing at a FARP or Airbase
set to true to use the Bronco mod as a CSAR plane
switch do 10 sec interval approach mode, meters
switch to 5 sec interval approach mode, meters
automatically smoke location when heli is near
distance for autosmoke added 0.1.4
seconds
Coalition side number, e.g. coalition.side.RED
.
Use Lat/Long DDM (0), Lat/Long DMS (1), MGRS (2), Bullseye imperial (3) or Bullseye metric (4) for coordinates.
added 0.1.12
If set to true, will generate a csar when a plane crashes as well.
prefixes used for useprefix=true - DON'T use # in names!
shagrat set to true, will use the LandingAfterEjection Event instead of Ejection
set to false to disable AI units from being rescued.
load and save downed pilots
Distance the Downed pilot will run to the rescue helicopter
tracks heli close message ie heli < 500m distance
tracks if the first message has been sent of the heli being visible
tracks status of a helis hover above a downed pilot
Set to true to make wounded crew immortal
contain a table for each SAR with all units he has with the original names
Set to true to make wounded crew insvisible
Class id string for output to DCS log file.
configure distance for pilot to get in helicopter in meters.
seconds
currently only GROUP objects, maybe support STATICs also?
prefixes used to find MASHes
max number of pilots that can be carried
Time to show longer messages for in seconds
Downed Pilot will run to the rescue helicopter up to self.extractDistance METERS
switch to true to enable check on open doors
the name of the sound file to use for the Pilot radio beacons. If this isnt added to the mission BEACONS WONT WORK!
added 0.1.11r1
tracks smoke markers for groups
Color of smokemarker for blue side, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue
Use FF's SRS integration
Use the Prefixed defined below, Requires Unit have the Prefix defined below
Verbosity level.
CSAR class version.
contains the new group of units
Function(s)
(User) Add a PLAYERTASK - FSM events will check success
Create a new CSAR object and start the FSM.
Defined in:
CSAR
Parameters:
#number Coalition
Coalition side. Can also be passed as a string "red", "blue" or "neutral".
#string Template
Name of the late activated infantry unit standing in for the downed pilot.
#string Alias
An optional alias how this object is called in the logs etc.
Return value:
self
On After "Aproach" event.
Heli close to downed Pilot.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string Heliname
Name of the helicopter group.
#string Woundedgroupname
Name of the downed pilot's group.
On After "Boarded" event.
Downed pilot boarded heli.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string Heliname
Name of the helicopter group.
#string Woundedgroupname
Name of the downed pilot's group.
#string Description
Descriptive name of the group.
On After "KIA" event.
Pilot is dead.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string Pilotname
Name of the pilot KIA.
On After "Landed" event.
Heli landed at an airbase.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string HeliName
Name of the #UNIT which has landed.
Wrapper.Airbase#AIRBASE Airbase
Airbase where the heli landed.
FSM Function OnAfterLoad.
Defined in:
CSAR
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 "CSAR_
On After "PilotDown" event.
Downed Pilot detected.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Group#GROUP Group
Group object of the downed pilot.
#number Frequency
Beacon frequency in kHz.
#string Leadername
Name of the #UNIT of the downed pilot.
#string CoordinatesText
String of the position of the pilot. Format determined by self.coordtype.
#string Playername
Player name if any given. Might be nil!
On After "Rescued" event.
Pilot(s) have been brought to the MASH/FARP/AFB.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
Wrapper.Unit#UNIT HeliUnit
Unit of the helicopter.
#string HeliName
Name of the helicopter group.
#number PilotsSaved
Number of the saved pilots on board when landing.
On After "Returning" event.
Heli can return home with downed pilot(s).
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event.
#string To
To state.
#string Heliname
Name of the helicopter group.
#string Woundedgroupname
Name of the downed pilot's group.
FSM Function OnAfterSave.
Defined in:
CSAR
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 "CSAR_
[User] Set callsign options for TTS output.
See Wrapper.Group#GROUP.GetCustomCallSign() on how to set customized callsigns.
Defined in:
CSAR
Parameters:
#boolean ShortCallsign
If true, only call out the major flight number
#boolean Keepnumber
If true, keep the customized callsign in the #GROUP name for players as-is, no amendments or numbers.
#table CallsignTranslations
(optional) Table to translate between DCS standard callsigns and bespoke ones. Does not apply if using customized callsigns from playername or group name.
Return value:
self
User - Function to add onw SET_GROUP Set-up for pilot filtering and assignment.
Needs to be set before starting the CSAR instance.
Defined in:
CSAR
Parameter:
The SET_GROUP object created by the mission designer/user to represent the CSAR pilot groups.
Return value:
self
Function to add a CSAR object into the scene at a zone coordinate.
For mission designers wanting to add e.g. PoWs to the scene.
Defined in:
CSAR
Parameters:
Core.Point#COORDINATE Point
#number Coalition
Coalition.
#string Description
(optional) Description.
#boolean Nomessage
(optional) If true, don't send a message to SAR.
#string Unitname
(optional) Name of the lost unit.
#string Typename
(optional) Type of plane.
#boolean Forcedesc
(optional) Force to use the description passed only for the pilot track entry. Use to have fully custom names.
Usage:
If missions designers want to spawn downed pilots into the field, e.g. at mission begin, to give the helicopter guys work, they can do this like so:
-- Create casualty "CASEVAC" at coordinate Core.Point#COORDINATE for the blue coalition.
my_csar:SpawnCASEVAC( coordinate, coalition.side.BLUE )
Function to add a CSAR object into the scene at a zone coordinate.
For mission designers wanting to add e.g. PoWs to the scene.
Defined in:
CSAR
Parameters:
#string Zone
Name of the zone. Can also be passed as a (normal, round) ZONE object.
#number Coalition
Coalition.
#string Description
(optional) Description.
#boolean RandomPoint
(optional) Random yes or no.
#boolean Nomessage
(optional) If true, don't send a message to SAR.
#string Unitname
(optional) Name of the lost unit.
#string Typename
(optional) Type of plane.
#boolean Forcedesc
(optional) Force to use the description passed only for the pilot track entry. Use to have fully custom names.
Usage:
If missions designers want to spawn downed pilots into the field, e.g. at mission begin, to give the helicopter guys work, they can do this like so:
-- Create downed "Pilot Wagner" in #ZONE "CSAR_Start_1" at a random point for the blue coalition
my_csar:SpawnCSARAtZone( "CSAR_Start_1", coalition.side.BLUE, "Wagner", true, false, "Charly-1-1", "F5E" )
Triggers the FSM event "Start".
Starts the CSAR. Initializes parameters and starts event handlers.
Defined in:
CSAR
(Internal) Function to add beacon to downed pilot.
Defined in:
CSAR
Parameters:
Wrapper.Group#GROUP _group
Group #GROUP object.
#number _freq
Frequency to use
#string _name
Beacon Name to use
Return value:
self
(Internal) Function to spawn a CSAR object into the scene.
Defined in:
CSAR
Parameters:
#number _coalition
Coalition
DCS#country.id _country
Country ID
Core.Point#COORDINATE _point
Coordinate
#string _typeName
Typename
#string _unitName
Unitname
#string _playerName
Playername
#number _freq
Frequency
#boolean noMessage
#string _description
Description
#boolean forcedesc
Use the description only for the pilot track entry
(Internal) Add options to a downed pilot
(Internal) Function to check if heli is close to group.
Defined in:
CSAR
Parameters:
#number _distance
Wrapper.Unit#UNIT _heliUnit
#string _heliName
Wrapper.Group#GROUP _woundedGroup
#string _woundedGroupName
Return value:
#boolean:
Outcome
(Internal) Check if a name is in downed pilot table
Defined in:
CSAR
Parameter:
#string name
Name to search for.
Return values:
(Internal) Display onboarded rescued pilots.
Defined in:
CSAR
Parameter:
#string _unitName
Name of the chopper
(Internal) Check state of wounded group.
Defined in:
CSAR
Parameters:
#string heliname
heliname
#string woundedgroupname
woundedgroupname
(Internal) Helper function to count active downed pilots.
Defined in:
CSAR
Return value:
#number:
Number of pilots in the field.
(Internal) Function to insert downed pilot tracker object.
Defined in:
CSAR
Parameters:
Wrapper.Group#GROUP Group
The #GROUP object
#string Groupname
Name of the spawned group.
#number Side
Coalition.
#string OriginalUnit
Name of original Unit.
#string Description
Descriptive text.
#string Typename
Typename of unit.
#number Frequency
Frequency of the NDB in Hz
#string Playername
Name of Player (if applicable)
#boolean Wetfeet
Ejected over water
BeaconName
Return value:
self.
(Internal) Display active SAR tasks to player.
Defined in:
CSAR
Parameter:
#string _unitName
Unit to display to
(Internal) Display message to single Unit.
Defined in:
CSAR
Parameters:
Wrapper.Unit#UNIT _unit
Unit #UNIT to display to.
#string _text
Text of message.
#number _time
Message show duration.
#boolean _clear
(optional) Clear screen.
#boolean _speak
(optional) Speak message via SRS.
#boolean _override
(optional) Override message suppression
(Internal) Display info to all SAR groups.
Defined in:
CSAR
Parameters:
#string _message
Message to display.
#number _side
Coalition of message.
#number _messagetime
How long to show.
#boolean ToSRS
If true or nil, send to SRS TTS
#boolean ToScreen
If true or nil, send to Screen
(Internal) Function to check for dupe eject events.
Defined in:
CSAR
Parameter:
#string _unitname
Name of unit.
Return value:
#boolean:
Outcome
(Internal) Pop frequency from prepopulated table.
Defined in:
CSAR
Return value:
#number:
frequency
(Internal) Populate table with available beacon frequencies.
Defined in:
CSAR
(Internal) Function to determine clockwise direction for flares.
Defined in:
CSAR
Parameters:
Wrapper.Unit#UNIT _heli
The Helicopter
Wrapper.Group#GROUP _group
The downed Group
Return value:
#number:
direction
(Internal) Find the closest downed pilot to a heli.
Defined in:
CSAR
Parameter:
Wrapper.Unit#UNIT _heli
Helicopter #UNIT
Return value:
#table:
Table of results
(Internal) Determine distance to closest MASH.
(Internal) Check if a name is in downed pilot table and remove it.
Defined in:
CSAR
Parameter:
#string UnitName
Return value:
#string:
CallSign
(Internal) Return distance in meters between two coordinates.
Defined in:
CSAR
Parameters:
Core.Point#COORDINATE _point1
Coordinate one
Core.Point#COORDINATE _point2
Coordinate two
Return value:
#number:
Distance in meters
(Internal) Function to get string of a group's position.
Defined in:
CSAR
Parameter:
Wrapper.Controllable#CONTROLLABLE _woundedGroup
Group or Unit object.
Return value:
#string:
Coordinates as Text
(Internal) Check and return Wrappe.Unit#UNIT based on the name if alive.
Defined in:
CSAR
Parameters:
#string _unitname
Name of Unit
_unitName
Return value:
The unit or nil
(Internal) Initialize the action for a pilot.
Defined in:
CSAR
Parameters:
Wrapper.Group#GROUP _downedGroup
The group to rescue.
#string _GroupName
Name of the Group
#number _freq
Beacon frequency.
#boolean _nomessage
Send message true or false.
#string _playername
Name of the downed pilot if any
(internal) Function to check if the heli door(s) are open.
Thanks to Shadowze.
Defined in:
CSAR
Parameter:
#string unit_name
Name of unit.
Return value:
#boolean:
outcome The outcome.
(Internal) Move group to destination.
(Internal) Function to pickup the wounded pilot from the ground.
Defined in:
CSAR
Parameters:
Wrapper.Unit#UNIT _heliUnit
Object of the group.
#string _pilotName
Name of the pilot.
Wrapper.Group#GROUP _woundedGroup
Object of the group.
#string _woundedGroupName
Name of the group.
(Internal) Count pilots on board.
Defined in:
CSAR
Parameter:
#string _heliName
Return value:
#number:
count
(Internal) Function to pop a smoke at a wounded pilot's positions.
Defined in:
CSAR
Parameters:
#string _woundedGroupName
Name of the group.
Wrapper.Group#GROUP _woundedLeader
Object of the group.
(Internal) Helper to decide if we're over max limit.
Defined in:
CSAR
Return value:
#boolean:
True or false.
(Internal) Helper function to (re-)add beacon to downed pilot.
(Internal) Check if a name is in downed pilot table and remove it.
Defined in:
CSAR
Parameters:
#string name
Name to search for.
#boolean force
Force removal.
Return value:
#boolean:
Outcome.
(Internal) Request IR Strobe at closest downed pilot.
Defined in:
CSAR
Parameter:
#string _unitName
Name of the helicopter
(Internal) Request smoke at closest downed pilot.
Defined in:
CSAR
Parameter:
#string _unitName
Name of the helicopter
(Internal) Mark pilot as rescued and remove from tables.
(Internal) Monitor in-flight returning groups.
Defined in:
CSAR
Parameters:
#string heliname
Heli name
#string groupname
Group name
#boolean isairport
If true, EVENT.Landing took place at an airport or FARP
#boolean noreschedule
If true, do not try to reschedule this is distances are not ok (coming from landing event)
(Internal) Fire a flare at the point of a downed pilot.
Defined in:
CSAR
Parameter:
#string _unitName
Name of the unit.
(Internal) Function to add a CSAR object into the scene at a Point coordinate (VEC_2).
For mission designers wanting to add e.g. casualties to the scene, that don't use beacons.
Defined in:
CSAR
Parameters:
Core.Point#COORDINATE _Point
#number _coalition
Coalition.
#string _description
(optional) Description.
#boolean _nomessage
(optional) If true, don't send a message to SAR.
#string unitname
(optional) Name of the lost unit.
#string typename
(optional) Type of plane.
#boolean forcedesc
(optional) Force to use the description passed only for the pilot track entry. Use to have fully custom names.
(Internal) Function to add a CSAR object into the scene at a zone coordinate.
For mission designers wanting to add e.g. PoWs to the scene.
Defined in:
CSAR
Parameters:
#string _zone
Name of the zone. Can also be passed as a (normal, round) ZONE object.
#number _coalition
Coalition.
#string _description
(optional) Description.
#boolean _randomPoint
(optional) Random yes or no.
#boolean _nomessage
(optional) If true, don't send a message to SAR.
#string unitname
(optional) Name of the lost unit.
#string typename
(optional) Type of plane.
#boolean forcedesc
(optional) Force to use the description passed only for the pilot track entry. Use to have fully custom names.
(Internal) Spawn a downed pilot
Defined in:
CSAR
Parameters:
#number country
Country for template.
Core.Point#COORDINATE point
Coordinate to spawn at.
#number frequency
Frequency of the pilot's beacon
#boolean wetfeet
Spawn is over water
Return values:
(Internal) Function to calculate and set Unit internal cargo mass
Triggers the FSM event "Load" after a delay.
Defined in:
CSAR
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "Save" after a delay.
Defined in:
CSAR
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "Start" after a delay.
Starts the CSAR. Initializes parameters and starts event handlers.
Defined in:
CSAR
Parameter:
#number delay
Delay in seconds.
Triggers the FSM event "Status" after a delay.
Defined in:
CSAR
Parameters:
#number delay
Delay in seconds.
--- Triggers the FSM event "Load".
#CSAR self
Triggers the FSM event "Stop" after a delay.
Stops the CSAR and all its event handlers.
Defined in:
CSAR
Parameter:
#number delay
Delay in seconds.
On after "Load" event.
Loads dropped units from file.
Defined in:
CSAR
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 "CSAR_
On after "Save" event.
Player data is saved to file.
Defined in:
CSAR
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 "CSAR_
(Internal) Function called after Start() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
(Internal) Function called after Status() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
(Internal) Function called after Stop() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
(Internal) Function called before Approach() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
#string Heliname
Name of the helicopter group.
#string Woundedgroupname
Name of the downed pilot's group.
(Internal) Function called before Boarded() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
#string Heliname
Name of the helicopter group.
#string Woundedgroupname
Name of the downed pilot's group.
(Internal) Function called before Landed() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
#string HeliName
Name of the #UNIT which has landed.
Wrapper.Airbase#AIRBASE Airbase
Airbase where the heli landed.
On before "Load" event.
Checks if io and lfs and the file are available.
Defined in:
CSAR
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 "CSAR_
(Internal) Function called before PilotDown() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
Wrapper.Group#GROUP Group
Group object of the downed pilot.
#number Frequency
Beacon frequency in kHz.
#string Leadername
Name of the #UNIT of the downed pilot.
#string CoordinatesText
String of the position of the pilot. Format determined by self.coordtype.
#string Playername
Player name if any given. Might be nil!
(Internal) Function called before Rescued() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
Wrapper.Unit#UNIT HeliUnit
Unit of the helicopter.
#string HeliName
Name of the helicopter group.
#number PilotsSaved
Number of the saved pilots on board when landing.
(Internal) Function called before Returning() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
#string Heliname
Name of the helicopter group.
#string Woundedgroupname
Name of the downed pilot's group.
#boolean IsAirport
True if heli has landed on an AFB (from event land).
IsAirPort
On before "Save" event.
Checks if io and lfs are available.
Defined in:
CSAR
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 "CSAR_
(Internal) Function called before Status() event.
Defined in:
CSAR
Parameters:
#string From
From state.
#string Event
Event triggered.
#string To
To state.
Field(s)
Name of the class.
you need to be this close to a FARP or Airport for the pilot to be rescued.
added 1.0.16
male or female
modulation
adjust your own path in your server(!)
volume 0.0 to 1.0
radio channel
port
Set of CSAR heli groups as designed by the mission designer (if any set).
tables, mainly for tracking actions
Set to false if you don't want to allow control by Combined arms.
allows pilot to be rescued by landing at a FARP or Airbase
set to true to use the Bronco mod as a CSAR plane
switch do 10 sec interval approach mode, meters
switch to 5 sec interval approach mode, meters
automatically smoke location when heli is near
distance for autosmoke added 0.1.4
seconds
Coalition side number, e.g. coalition.side.RED
.
Use Lat/Long DDM (0), Lat/Long DMS (1), MGRS (2), Bullseye imperial (3) or Bullseye metric (4) for coordinates.
added 0.1.12
If set to true, will generate a csar when a plane crashes as well.
prefixes used for useprefix=true - DON'T use # in names!
shagrat set to true, will use the LandingAfterEjection Event instead of Ejection
set to false to disable AI units from being rescued.
load and save downed pilots
Distance the Downed pilot will run to the rescue helicopter
tracks heli close message ie heli < 500m distance
tracks if the first message has been sent of the heli being visible
tracks status of a helis hover above a downed pilot
Set to true to make wounded crew immortal
contain a table for each SAR with all units he has with the original names
Set to true to make wounded crew insvisible
Class id string for output to DCS log file.
configure distance for pilot to get in helicopter in meters.
seconds
currently only GROUP objects, maybe support STATICs also?
prefixes used to find MASHes
max number of pilots that can be carried
Time to show longer messages for in seconds
Downed Pilot will run to the rescue helicopter up to self.extractDistance METERS
switch to true to enable check on open doors
the name of the sound file to use for the Pilot radio beacons. If this isnt added to the mission BEACONS WONT WORK!
added 0.1.11r1
tracks smoke markers for groups
Color of smokemarker for blue side, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue
Use FF's SRS integration
Use the Prefixed defined below, Requires Unit have the Prefix defined below
Verbosity level.
CSAR class version.
contains the new group of units
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)
Name of the class.
you need to be this close to a FARP or Airport for the pilot to be rescued.
added 1.0.16
male or female
modulation
adjust your own path in your server(!)
volume 0.0 to 1.0
radio channel
port
Set of CSAR heli groups as designed by the mission designer (if any set).
tables, mainly for tracking actions
Set to false if you don't want to allow control by Combined arms.
allows pilot to be rescued by landing at a FARP or Airbase
set to true to use the Bronco mod as a CSAR plane
switch do 10 sec interval approach mode, meters
switch to 5 sec interval approach mode, meters
automatically smoke location when heli is near
distance for autosmoke added 0.1.4
seconds
Coalition side number, e.g. coalition.side.RED
.
Use Lat/Long DDM (0), Lat/Long DMS (1), MGRS (2), Bullseye imperial (3) or Bullseye metric (4) for coordinates.
added 0.1.12
If set to true, will generate a csar when a plane crashes as well.
prefixes used for useprefix=true - DON'T use # in names!
shagrat set to true, will use the LandingAfterEjection Event instead of Ejection
set to false to disable AI units from being rescued.
load and save downed pilots
Distance the Downed pilot will run to the rescue helicopter
tracks heli close message ie heli < 500m distance
tracks if the first message has been sent of the heli being visible
tracks status of a helis hover above a downed pilot
Set to true to make wounded crew immortal
contain a table for each SAR with all units he has with the original names
Set to true to make wounded crew insvisible
Class id string for output to DCS log file.
configure distance for pilot to get in helicopter in meters.
seconds
currently only GROUP objects, maybe support STATICs also?
prefixes used to find MASHes
max number of pilots that can be carried
Time to show longer messages for in seconds
Downed Pilot will run to the rescue helicopter up to self.extractDistance METERS
switch to true to enable check on open doors
the name of the sound file to use for the Pilot radio beacons. If this isnt added to the mission BEACONS WONT WORK!
added 0.1.11r1
tracks smoke markers for groups
Color of smokemarker for blue side, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue
Use FF's SRS integration
Use the Prefixed defined below, Requires Unit have the Prefix defined below
Verbosity level.
CSAR class version.
contains the new group of units
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.
All slot / Limit settings
Field(s)
Unit type name.
Function(s)
Downed pilots info.
Field(s)
Name of radio beacon - if any.
Group is alive or dead/rescued.
Description.
Frequency of the NDB.
Pilot index.
Name of the spawned group.
Name of the original unit.
Player name if applicable.
Coalition.
Timestamp for approach process.
Typename of Unit.
Group is spawned over (deep) water.