Banner Image

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

  • MOOSE-based Helicopter CSAR Operations for Players.
#CSAR 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

  • 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)

CSAR , extends Core.Fsm#FSM
Fields and Methods inherited from CSAR Description

CSAR.ADFRadioPwr

CSAR:AddPlayerTask(PlayerTask)

(User) Add a PLAYERTASK - FSM events will check success

CSAR.AircraftType

CSAR.BeaconTimer

CSAR.CSARVoice

CSAR.CSARVoiceMS

CSAR.CallsignTranslations

CSAR.ClassName

Name of the class.

CSAR.FARPRescueDistance

CSAR.FreeVHFFrequencies

CSAR.Keepnumber

CSAR:Load()

Triggers the FSM event "Save".

CSAR:New(Coalition, Template, Alias)

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.

CSAR:OnAfterKIA(From, Event, To, Pilotname)

On After "KIA" event.

CSAR:OnAfterLanded(From, Event, To, HeliName, Airbase)

On After "Landed" event.

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

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.

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

FSM Function OnAfterSave.

CSAR.PilotWeight

CSAR.PlayerTaskQueue

CSAR.SRSCulture

CSAR.SRSGPathToCredentials

CSAR.SRSGender

CSAR.SRSModulation

CSAR.SRSPath

CSAR.SRSQueue

CSAR.SRSVoice

CSAR.SRSVolume

CSAR.SRSchannel

CSAR.SRSport

CSAR:SetCallSignOptions(ShortCallsign, Keepnumber, CallsignTranslations)

[User] Set callsign options for TTS output.

CSAR:SetOwnSetPilotGroups(Set)

User - Function to add onw SET_GROUP Set-up for pilot filtering and assignment.

CSAR.ShortCallsign

CSAR:SpawnCASEVAC(Point, Coalition, Description, Nomessage, Unitname, Typename, Forcedesc)

Function to add a CSAR object into the scene at a zone coordinate.

CSAR:SpawnCSARAtZone(Zone, Coalition, Description, RandomPoint, Nomessage, Unitname, Typename, Forcedesc)

Function to add a CSAR object into the scene at a zone coordinate.

CSAR:Start()

Triggers the FSM event "Start".

CSAR:Status()

Triggers the FSM event "Status".

CSAR.UsedVHFFrequencies

CSAR.UserSetGroup

Set of CSAR heli groups as designed by the mission designer (if any set).

CSAR:_AddBeaconToGroup(_group, _freq, _name)

(Internal) Function to add beacon to downed pilot.

CSAR:_AddCsar(_coalition, _country, _point, _typeName, _unitName, _playerName, _freq, noMessage, _description, forcedesc)

(Internal) Function to spawn a CSAR object into the scene.

CSAR:_AddMedevacMenuItem()

(Internal) Populate F10 menu for CSAR players.

CSAR:_AddSpecialOptions(group)

(Internal) Add options to a downed pilot

CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedGroup, _woundedGroupName)

(Internal) Function to check if heli is close to group.

CSAR:_CheckDownedPilotTable()

(Internal) Function called before Status() event.

CSAR:_CheckNameInDownedPilots(name)

(Internal) Check if a name is in downed pilot table

CSAR:_CheckOnboard(_unitName)

(Internal) Display onboarded rescued pilots.

CSAR:_CheckWoundedGroupStatus(heliname, woundedgroupname)

(Internal) Check state of wounded group.

CSAR:_CountActiveDownedPilots()

(Internal) Helper function to count active downed pilots.

CSAR:_CreateDownedPilotTrack(Group, Groupname, Side, OriginalUnit, Description, Typename, Frequency, Playername, Wetfeet, BeaconName)

(Internal) Function to insert downed pilot tracker object.

CSAR:_DisplayActiveSAR(_unitName)

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

CSAR:_DoubleEjection(_unitname)

(Internal) Function to check for dupe eject events.

CSAR:_EventHandler(EventData)

(Internal) Event handler.

CSAR:_GenerateADFFrequency()

(Internal) Pop frequency from prepopulated table.

CSAR:_GenerateVHFrequencies()

(Internal) Populate table with available beacon frequencies.

CSAR:_GetClockDirection(_heli, _group)

(Internal) Function to determine clockwise direction for flares.

CSAR:_GetClosestDownedPilot(_heli)

(Internal) Find the closest downed pilot to a heli.

CSAR:_GetClosestMASH(_heli)

(Internal) Determine distance to closest MASH.

CSAR:_GetCustomCallSign(UnitName)

(Internal) Check if a name is in downed pilot table and remove it.

CSAR:_GetDistance(_point1, _point2)

(Internal) Return distance in meters between two coordinates.

CSAR:_GetPositionOfWounded(_woundedGroup)

(Internal) Function to get string of a group's position.

CSAR:_GetSARHeli(_unitname, _unitName)

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

CSAR:_IsLoadingDoorOpen(unit_name)

(internal) Function to check if the heli door(s) are open.

CSAR:_OrderGroupToMoveToPoint(_leader, _destination)

(Internal) Move group to destination.

CSAR:_PickupUnit(_heliUnit, _pilotName, _woundedGroup, _woundedGroupName)

(Internal) Function to pickup the wounded pilot from the ground.

CSAR:_PilotsOnboard(_heliName)

(Internal) Count pilots on board.

CSAR:_PopSmokeForGroup(_woundedGroupName, _woundedLeader)

(Internal) Function to pop a smoke at a wounded pilot's positions.

CSAR:_ReachedPilotLimit()

(Internal) Helper to decide if we're over max limit.

CSAR:_RefreshRadioBeacons()

(Internal) Helper function to (re-)add beacon to downed pilot.

CSAR:_RemoveNameFromDownedPilots(name, force)

(Internal) Check if a name is in downed pilot table and remove it.

CSAR:_ReqIRStrobe(_unitName)

(Internal) Request IR Strobe at closest downed pilot.

CSAR:_Reqsmoke(_unitName)

(Internal) Request smoke at closest downed pilot.

CSAR:_RescuePilots(_heliUnit)

(Internal) Mark pilot as rescued and remove from tables.

CSAR:_ScheduledSARFlight(heliname, groupname, isairport, noreschedule)

(Internal) Monitor in-flight returning groups.

CSAR:_SignalFlare(_unitName)

(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).

CSAR:_SpawnCsarAtZone(_zone, _coalition, _description, _randomPoint, _nomessage, unitname, typename, forcedesc)

(Internal) Function to add a CSAR object into the scene at a zone coordinate.

CSAR:_SpawnPilotInField(country, point, frequency, wetfeet)

(Internal) Spawn a downed pilot

CSAR:_UpdateUnitCargoMass(_heliName)

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

CSAR:__Load(delay)

Triggers the FSM event "Load" after a delay.

CSAR:__Save(delay)

Triggers the FSM event "Save" after a delay.

CSAR:__Start(delay)

Triggers the FSM event "Start" after a delay.

CSAR:__Status(delay, self)

Triggers the FSM event "Status" after a delay.

CSAR:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

CSAR.addedTo

CSAR.alias

CSAR.allheligroupset

Set of CSAR heli groups.

CSAR.allowDownedPilotCAcontrol

CSAR.allowFARPRescue

CSAR.allowbronco

CSAR.approachdist_far

CSAR.approachdist_near

CSAR.autosmoke

CSAR.autosmokedistance

CSAR.beaconRefresher

CSAR.coalition

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

CSAR.coalitiontxt

CSAR.coordinate

CSAR.coordtype

CSAR.countryblue

CSAR.countryneutral

CSAR.countryred

CSAR.csarOncrash

CSAR.csarPrefix

CSAR.csarUnits

CSAR.csarUsePara

CSAR.downedPilots

CSAR.downedpilotcounter

CSAR.enableForAI

CSAR.enableLoadSave

CSAR.extractDistance

CSAR.filename

CSAR.filepath

CSAR.heliCloseMessage

CSAR.heliVisibleMessage

CSAR.hoverStatus

CSAR.immortalcrew

CSAR.inTransitGroups

CSAR.index

CSAR.invisiblecrew

CSAR.landedStatus

CSAR.lastCrash

CSAR.lid

Class id string for output to DCS log file.

CSAR.limitmaxdownedpilots

CSAR.loadDistance

CSAR.loadtimemax

CSAR.mash

CSAR.mashprefix

CSAR.max_units

CSAR.maxdownedpilots

CSAR.messageTime

CSAR.msrs

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

On after "Load" event.

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

On after "Save" event.

CSAR:onafterStart(From, Event, To)

(Internal) Function called after Start() event.

CSAR:onafterStatus(From, Event, To)

(Internal) Function called after Status() event.

CSAR:onafterStop(From, Event, To)

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

CSAR:onbeforeLanded(From, Event, To, HeliName, Airbase)

(Internal) Function called before Landed() event.

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

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.

CSAR:onbeforeSave(From, Event, To, path, filename)

On before "Save" event.

CSAR:onbeforeStatus(From, Event, To)

(Internal) Function called before Status() event.

CSAR.pilotRuntoExtractPoint

CSAR.pilotmustopendoors

CSAR.radioSound

CSAR.rescuedpilots

CSAR.rescuehoverdistance

CSAR.rescuehoverheight

CSAR.rescues

CSAR.saveinterval

CSAR.smokeMarkers

CSAR.smokecolor

CSAR.suppressmessages

CSAR.takenOff

CSAR.template

CSAR.useSRS

CSAR.useprefix

CSAR.usewetfeet

CSAR.verbose

Verbosity level.

CSAR.version

CSAR class version.

CSAR.wetfeettemplate

CSAR.woundedGroups

Fields and Methods inherited from FSM Description

CSAR:AddEndState(State)

Adds an End state.

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

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

CSAR:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

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

Adds a score for the FSM_PROCESS to be achieved.

CSAR:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

CSAR.CallScheduler

CSAR.Events

CSAR:GetCurrentState()

Get current state.

CSAR:GetEndStates()

Returns the End states.

CSAR:GetProcess(From, Event)

CSAR:GetProcesses()

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

CSAR:GetScores()

Returns a table with the scores defined.

CSAR:GetStartState()

Returns the start state of the FSM.

CSAR:GetState()

Get current state.

CSAR:GetSubs()

Returns a table with the Subs defined.

CSAR:GetTransitions()

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

CSAR:Is(State)

Check if FSM is in state.

CSAR:LoadCallBacks(CallBackTable)

Load call backs.

CSAR:New()

Creates a new FSM object.

CSAR.Scores

CSAR:SetProcess(From, Event, Fsm)

CSAR:SetStartState(State)

Sets the start state of the FSM.

CSAR._EndStates

CSAR._EventSchedules

CSAR._Processes

CSAR._Scores

CSAR._StartState

CSAR._Transitions

CSAR:_add_to_map(Map, Event)

Add to map.

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

Call handler.

CSAR:_create_transition(EventName)

Create transition.

CSAR:_delayed_transition(EventName)

Delayed transition.

CSAR:_eventmap(Events, EventStructure)

Event map.

CSAR:_gosub(ParentFrom, ParentEvent)

Go sub.

CSAR:_handler(EventName, ...)

Handler.

CSAR:_isendstate(Current)

Is end state.

CSAR:_submap(subs, sub, name)

Sub maps.

CSAR:can(e)

Check if can do an event.

CSAR:cannot(e)

Check if cannot do an event.

CSAR.current

CSAR.endstates

CSAR:is(State, state)

Check if FSM is in state.

CSAR.options

CSAR.subs

Fields and Methods inherited from CSAR.DownedPilot Description

CSAR.DownedPilot.BeaconName

Name of radio beacon - if any.

CSAR.DownedPilot.alive

Group is alive or dead/rescued.

CSAR.DownedPilot.desc

Description.

CSAR.DownedPilot.frequency

Frequency of the NDB.

CSAR.DownedPilot.group

Spawned group object.

CSAR.DownedPilot.index

Pilot index.

CSAR.DownedPilot.name

Name of the spawned group.

CSAR.DownedPilot.originalUnit

Name of the original unit.

CSAR.DownedPilot.player

Player name if applicable.

CSAR.DownedPilot.side

Coalition.

CSAR.DownedPilot.timestamp

Timestamp for approach process.

CSAR.DownedPilot.typename

Typename of Unit.

CSAR.DownedPilot.wetfeet

Group is spawned over (deep) water.

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

Field(s)

#string CSAR.ClassName

Name of the class.

#number CSAR.FARPRescueDistance

you need to be this close to a FARP or Airport for the pilot to be rescued.

#number CSAR.PilotWeight

added 1.0.16

#string CSAR.SRSCulture
#string CSAR.SRSGender

male or female

CSAR.SRSModulation

modulation

#string CSAR.SRSPath

adjust your own path in your server(!)

#number CSAR.SRSVolume

volume 0.0 to 1.0

#number CSAR.SRSchannel

radio channel

#number CSAR.SRSport

port

Core.Set#SET_GROUP CSAR.UserSetGroup

Set of CSAR heli groups as designed by the mission designer (if any set).

#table CSAR.addedTo

tables, mainly for tracking actions

Core.Set#SET_GROUP CSAR.allheligroupset

Set of CSAR heli groups.

#boolean CSAR.allowDownedPilotCAcontrol

Set to false if you don't want to allow control by Combined arms.

#boolean CSAR.allowFARPRescue

allows pilot to be rescued by landing at a FARP or Airbase

#boolean CSAR.allowbronco

set to true to use the Bronco mod as a CSAR plane

#number CSAR.approachdist_far

switch do 10 sec interval approach mode, meters

#number CSAR.approachdist_near

switch to 5 sec interval approach mode, meters

#boolean CSAR.autosmoke

automatically smoke location when heli is near

#number CSAR.autosmokedistance

distance for autosmoke added 0.1.4

#number CSAR.beaconRefresher

seconds

#number CSAR.coalition

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

#number CSAR.coordtype

Use Lat/Long DDM (0), Lat/Long DMS (1), MGRS (2), Bullseye imperial (3) or Bullseye metric (4) for coordinates.

CSAR.countryblue

added 0.1.12

#boolean CSAR.csarOncrash

If set to true, will generate a csar when a plane crashes as well.

#table CSAR.csarPrefix

prefixes used for useprefix=true - DON'T use # in names!

#table CSAR.csarUnits

table of CSAR unit names

#boolean CSAR.csarUsePara

shagrat set to true, will use the LandingAfterEjection Event instead of Ejection

#boolean CSAR.enableForAI

set to false to disable AI units from being rescued.

#boolean CSAR.enableLoadSave

load and save downed pilots

#number CSAR.extractDistance

Distance the Downed pilot will run to the rescue helicopter

#table CSAR.heliCloseMessage

tracks heli close message ie heli < 500m distance

#table CSAR.heliVisibleMessage

tracks if the first message has been sent of the heli being visible

#table CSAR.hoverStatus

tracks status of a helis hover above a downed pilot

#boolean CSAR.immortalcrew

Set to true to make wounded crew immortal

#table CSAR.inTransitGroups

contain a table for each SAR with all units he has with the original names

#boolean CSAR.invisiblecrew

Set to true to make wounded crew insvisible

#string CSAR.lid

Class id string for output to DCS log file.

#number CSAR.loadDistance

configure distance for pilot to get in helicopter in meters.

#number CSAR.loadtimemax

seconds

CSAR.mash

currently only GROUP objects, maybe support STATICs also?

#table CSAR.mashprefix

prefixes used to find MASHes

#number CSAR.max_units

max number of pilots that can be carried

#number CSAR.messageTime

Time to show longer messages for in seconds

#boolean CSAR.pilotRuntoExtractPoint

Downed Pilot will run to the rescue helicopter up to self.extractDistance METERS

#boolean CSAR.pilotmustopendoors

switch to true to enable check on open doors

#string CSAR.radioSound

the name of the sound file to use for the Pilot radio beacons. If this isnt added to the mission BEACONS WONT WORK!

#number CSAR.rescuedpilots

counter for saved pilots

#number CSAR.rescuehoverheight

added 0.1.11r1

#number CSAR.rescues

counter for successful rescue landings at FARP/AFB/MASH

#table CSAR.smokeMarkers

tracks smoke markers for groups

#number CSAR.smokecolor

Color of smokemarker for blue side, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue

#table CSAR.takenOff
#boolean CSAR.useSRS

Use FF's SRS integration

#boolean CSAR.useprefix

Use the Prefixed defined below, Requires Unit have the Prefix defined below

#boolean CSAR.usewetfeet
#number CSAR.verbose

Verbosity level.

#string CSAR.version

CSAR class version.

#table CSAR.woundedGroups

contains the new group of units

Function(s)

(User) Add a PLAYERTASK - FSM events will check success

Defined in:

CSAR

Parameter:

Return value:

self

Triggers the FSM event "Save".

Defined in:

CSAR

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.

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__Persist.csv".

On After "PilotDown" event.

Downed Pilot detected.

Defined in:

CSAR

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

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.

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__Persist.csv".

[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:

#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

Triggers the FSM event "Status".

Defined in:

CSAR

(Internal) Function to add beacon to downed pilot.

Defined in:

CSAR

Parameters:

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

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) Populate F10 menu for CSAR players.

Defined in:

CSAR

(Internal) Add options to a downed pilot

Defined in:

CSAR

Parameter:

Group to use.

(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) Function called before Status() event.

Defined in:

CSAR

(Internal) Check if a name is in downed pilot table

Defined in:

CSAR

Parameter:

#string name

Name to search for.

Return values:

#boolean:

Outcome.

Table if found else nil.

(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:

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:

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) Event handler.

Defined in:

CSAR

Parameter:

EventData

(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:

The Helicopter

The downed Group

Return value:

#number:

direction

(Internal) Find the closest downed pilot to a heli.

Defined in:

CSAR

Parameter:

Helicopter #UNIT

Return value:

#table:

Table of results

(Internal) Determine distance to closest MASH.

Defined in:

CSAR

Parameter:

Helicopter #UNIT

Return value:

self

(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:

Coordinate one

Coordinate two

Return value:

#number:

Distance in meters

(Internal) Function to get string of a group's position.

Defined in:

CSAR

Parameter:

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.

Defined in:

CSAR

Parameters:

Core.Point#COORDINATE _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.

Defined in:

CSAR

Return value:

self

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

Defined in:

CSAR

Parameter:

Wrapper.Unit#UNIT _heliUnit

(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:

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

Coordinate to spawn at.

#number frequency

Frequency of the pilot's beacon

#boolean wetfeet

Spawn is over water

Return values:

group The #GROUP object.

#string:

alias The alias name.

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

Defined in:

CSAR

Parameter:

#string _heliName

Unit name

Return value:

self

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__Persist.csv".

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__Persist.csv".

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

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__Persist.csv".

(Internal) Function called before PilotDown() event.

Defined in:

CSAR

Parameters:

#string From

From state.

#string Event

Event triggered.

#string To

To state.

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.

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__Persist.csv".

(Internal) Function called before Status() event.

Defined in:

CSAR

Parameters:

#string From

From state.

#string Event

Event triggered.

#string To

To state.

Field(s)

#string CSAR.ClassName

Name of the class.

#number CSAR.FARPRescueDistance

you need to be this close to a FARP or Airport for the pilot to be rescued.

#number CSAR.PilotWeight

added 1.0.16

#string CSAR.SRSCulture
#string CSAR.SRSGender

male or female

CSAR.SRSModulation

modulation

#string CSAR.SRSPath

adjust your own path in your server(!)

#number CSAR.SRSVolume

volume 0.0 to 1.0

#number CSAR.SRSchannel

radio channel

#number CSAR.SRSport

port

Core.Set#SET_GROUP CSAR.UserSetGroup

Set of CSAR heli groups as designed by the mission designer (if any set).

#table CSAR.addedTo

tables, mainly for tracking actions

Core.Set#SET_GROUP CSAR.allheligroupset

Set of CSAR heli groups.

#boolean CSAR.allowDownedPilotCAcontrol

Set to false if you don't want to allow control by Combined arms.

#boolean CSAR.allowFARPRescue

allows pilot to be rescued by landing at a FARP or Airbase

#boolean CSAR.allowbronco

set to true to use the Bronco mod as a CSAR plane

#number CSAR.approachdist_far

switch do 10 sec interval approach mode, meters

#number CSAR.approachdist_near

switch to 5 sec interval approach mode, meters

#boolean CSAR.autosmoke

automatically smoke location when heli is near

#number CSAR.autosmokedistance

distance for autosmoke added 0.1.4

#number CSAR.beaconRefresher

seconds

#number CSAR.coalition

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

#number CSAR.coordtype

Use Lat/Long DDM (0), Lat/Long DMS (1), MGRS (2), Bullseye imperial (3) or Bullseye metric (4) for coordinates.

CSAR.countryblue

added 0.1.12

#boolean CSAR.csarOncrash

If set to true, will generate a csar when a plane crashes as well.

#table CSAR.csarPrefix

prefixes used for useprefix=true - DON'T use # in names!

#table CSAR.csarUnits

table of CSAR unit names

#boolean CSAR.csarUsePara

shagrat set to true, will use the LandingAfterEjection Event instead of Ejection

#boolean CSAR.enableForAI

set to false to disable AI units from being rescued.

#boolean CSAR.enableLoadSave

load and save downed pilots

#number CSAR.extractDistance

Distance the Downed pilot will run to the rescue helicopter

#table CSAR.heliCloseMessage

tracks heli close message ie heli < 500m distance

#table CSAR.heliVisibleMessage

tracks if the first message has been sent of the heli being visible

#table CSAR.hoverStatus

tracks status of a helis hover above a downed pilot

#boolean CSAR.immortalcrew

Set to true to make wounded crew immortal

#table CSAR.inTransitGroups

contain a table for each SAR with all units he has with the original names

#boolean CSAR.invisiblecrew

Set to true to make wounded crew insvisible

#string CSAR.lid

Class id string for output to DCS log file.

#number CSAR.loadDistance

configure distance for pilot to get in helicopter in meters.

#number CSAR.loadtimemax

seconds

CSAR.mash

currently only GROUP objects, maybe support STATICs also?

#table CSAR.mashprefix

prefixes used to find MASHes

#number CSAR.max_units

max number of pilots that can be carried

#number CSAR.messageTime

Time to show longer messages for in seconds

#boolean CSAR.pilotRuntoExtractPoint

Downed Pilot will run to the rescue helicopter up to self.extractDistance METERS

#boolean CSAR.pilotmustopendoors

switch to true to enable check on open doors

#string CSAR.radioSound

the name of the sound file to use for the Pilot radio beacons. If this isnt added to the mission BEACONS WONT WORK!

#number CSAR.rescuedpilots

counter for saved pilots

#number CSAR.rescuehoverheight

added 0.1.11r1

#number CSAR.rescues

counter for successful rescue landings at FARP/AFB/MASH

#table CSAR.smokeMarkers

tracks smoke markers for groups

#number CSAR.smokecolor

Color of smokemarker for blue side, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue

#table CSAR.takenOff
#boolean CSAR.useSRS

Use FF's SRS integration

#boolean CSAR.useprefix

Use the Prefixed defined below, Requires Unit have the Prefix defined below

#boolean CSAR.usewetfeet
#number CSAR.verbose

Verbosity level.

#string CSAR.version

CSAR class version.

#table CSAR.woundedGroups

contains the new group of units

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

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

Defined in:

Parameters:

#table From

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

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

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

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

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

#string ScoreText

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

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

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

#string ScoreText

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

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

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

Defined in:

Parameters:

#table From

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

#string Event

The Event name.

#string To

The To state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

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

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

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

Defined in:

Return value:

#table:

Transitions.

Check if FSM is in state.

Defined in:

Parameter:

#string State

State name.

Return value:

#boolean:

If true, FSM is in this state.

Load call backs.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

Call handler.

Defined in:

Parameters:

#string step

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

#string trigger

Trigger.

#table params

Parameters.

#string EventName

Event name.

Return value:

Value.

Create transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Delayed transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Event map.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

Check if can do an event.

Defined in:

Parameter:

#string e

Event name.

Return values:

#boolean:

If true, FSM can do the event.

#string:

To state.

Check if cannot do an event.

Defined in:

Parameter:

#string e

Event name.

Return value:

#boolean:

If true, FSM cannot do the event.

Check if FSM is in state.

Defined in:

Parameters:

#string State

State name.

state

Return value:

#boolean:

If true, FSM is in this state.

Downed pilots info.

Field(s)

#string CSAR.DownedPilot.BeaconName

Name of radio beacon - if any.

#boolean CSAR.DownedPilot.alive

Group is alive or dead/rescued.

#string CSAR.DownedPilot.desc

Description.

#number CSAR.DownedPilot.frequency

Frequency of the NDB.

#number CSAR.DownedPilot.index

Pilot index.

#string CSAR.DownedPilot.name

Name of the spawned group.

#string CSAR.DownedPilot.originalUnit

Name of the original unit.

#string CSAR.DownedPilot.player

Player name if applicable.

#number CSAR.DownedPilot.side

Coalition.

#number CSAR.DownedPilot.timestamp

Timestamp for approach process.

#string CSAR.DownedPilot.typename

Typename of Unit.

#boolean CSAR.DownedPilot.wetfeet

Group is spawned over (deep) water.

Function(s)