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. |
|
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. |
|
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. |
|
Check if FSM is in state. |
|
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!
table of CSAR unit 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!
counter for saved pilots
added 0.1.11r1
counter for successful rescue landings at FARP/AFB/MASH
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!
table of CSAR unit 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!
counter for saved pilots
added 0.1.11r1
counter for successful rescue landings at FARP/AFB/MASH
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.
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.