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 , extends Core.Base#BASE
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.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

Call scheduler.

CSAR.ClassName

Name of the class.

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

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

Current state name.

CSAR.endstates

CSAR:is(State, state)

Check if FSM is in state.

CSAR.options

Options.

CSAR.subs

Subs.

Fields and Methods inherited from BASE Description

CSAR.ClassID

The ID number of the class.

CSAR.ClassName

The name of the class.

CSAR.ClassNameAndID

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

CSAR:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

CSAR:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

CSAR:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

CSAR:CreateEventDynamicCargoLoaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

CSAR:CreateEventDynamicCargoRemoved(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

CSAR:CreateEventDynamicCargoUnloaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

CSAR:CreateEventNewDynamicCargo(DynamicCargo)

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

CSAR:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

CSAR:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

CSAR:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

CSAR:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

CSAR:E(Arguments)

Log an exception which will be traced always.

CSAR:EventDispatcher()

Returns the event dispatcher

CSAR:EventRemoveAll()

Remove all subscribed events

CSAR:F(Arguments)

Trace a function call.

CSAR:F2(Arguments)

Trace a function call level 2.

CSAR:F3(Arguments)

Trace a function call level 3.

CSAR:GetClassID()

Get the ClassID of the class instance.

CSAR:GetClassName()

Get the ClassName of the class instance.

CSAR:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

CSAR:GetEventPriority()

Get the Class Core.Event processing Priority.

CSAR:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

CSAR:GetState(Object, Key)

Get a Value given a Key from the Object.

CSAR:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

CSAR:I(Arguments)

Log an information which will be traced always.

CSAR:Inherit(Child, Parent)

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

CSAR:IsInstanceOf(ClassName)

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

CSAR:IsTrace()

Enquires if tracing is on (for the class).

CSAR:New()

BASE constructor.

CSAR:OnEvent(EventData)

Occurs when an Event for an object is triggered.

CSAR:OnEventBDA(EventData)

BDA.

CSAR:OnEventBaseCaptured(EventData)

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

CSAR:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

CSAR:OnEventCrash(EventData)

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

CSAR:OnEventDead(EventData)

Occurs when an object is dead.

CSAR:OnEventDetailedFailure(EventData)

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

CSAR:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

CSAR:OnEventDynamicCargoLoaded(EventData)

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

CSAR:OnEventDynamicCargoRemoved(EventData)

Occurs when a dynamic cargo crate is removed.

CSAR:OnEventDynamicCargoUnloaded(EventData)

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

CSAR:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

CSAR:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

CSAR:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

CSAR:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

CSAR:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

CSAR:OnEventKill(EventData)

Occurs on the death of a unit.

CSAR:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.

CSAR:OnEventLandingAfterEjection(EventData)

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

CSAR:OnEventLandingQualityMark(EventData)

Landing quality mark.

CSAR:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

CSAR:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

CSAR:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

CSAR:OnEventMissionEnd(EventData)

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

CSAR:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

CSAR:OnEventNewDynamicCargo(EventData)

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

CSAR:OnEventParatrooperLanding(EventData)

Weapon add.

CSAR:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

CSAR:OnEventPlayerEnterAircraft(EventData)

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

CSAR:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

CSAR:OnEventPlayerLeaveUnit(EventData)

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

CSAR:OnEventRefueling(EventData)

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

CSAR:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

CSAR:OnEventScore(EventData)

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

CSAR:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

CSAR:OnEventShootingStart(EventData)

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

CSAR:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

CSAR:OnEventTakeoff(EventData)

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

CSAR:OnEventTriggerZone(EventData)

Trigger zone.

CSAR:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

CSAR:ScheduleStop(SchedulerID)

Stops the Schedule.

CSAR.Scheduler

CSAR:SetEventPriority(EventPriority)

Set the Class Core.Event processing Priority.

CSAR:SetState(Object, Key, Value)

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

CSAR:T(Arguments)

Trace a function logic level 1.

CSAR:T2(Arguments)

Trace a function logic level 2.

CSAR:T3(Arguments)

Trace a function logic level 3.

CSAR:TraceAll(TraceAll)

Trace all methods in MOOSE

CSAR:TraceClass(Class)

Set tracing for a class

CSAR:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

CSAR:TraceLevel(Level)

Set trace level

CSAR:TraceOff()

Set trace off.

CSAR:TraceOn()

Set trace on.

CSAR:TraceOnOff(TraceOnOff)

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

CSAR:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

CSAR._

CSAR:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

CSAR:_Serialize(Arguments)

(Internal) Serialize arguments

CSAR:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

CSAR.__

CSAR:onEvent(event)

The main event handling function...

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

#table CSAR.downedPilots

Replacement woundedGroups

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

added 0.1.11r1

#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

#table CSAR.downedPilots

Replacement woundedGroups

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

added 0.1.11r1

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

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

#table CSAR.downedPilots

Replacement woundedGroups

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

added 0.1.11r1

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

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

Creation of a Remove Unit Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Takeoff Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Log an exception which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#string:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

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

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the Class Core.Event processing Priority.

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

Defined in:

Return value:

#number:

The Core.Event processing Priority.

This is the worker method to retrieve the Parent class.

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

self:GetParent(self):ParentMethod()

Defined in:

Parameters:

#BASE Child

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

#BASE FromClass

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

Return value:

Get a Value given a Key from the Object.

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

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

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

Return value:

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

Subscribe to a DCS Event.

Defined in:

Parameters:

Event ID.

#function EventFunction

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

Return value:

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

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

Defined in:

Parameters:

Child

is the Child class that inherits.

#BASE Parent

is the Parent class that the Child inherits from.

Return value:

Child

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

Examples:

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

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

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

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

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

Defined in:

Parameter:

ClassName

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

Return value:

#boolean:

Enquires if tracing is on (for the class).

Defined in:

Return value:

#boolean:

BASE constructor.

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

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

Defined in:

Return value:

Occurs when an Event for an object is triggered.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that captured the base place: The airbase that was captured, can be a FARP or Airbase. When calling place:getCoalition() the faction will already be the new owning faction.

Defined in:

Parameter:

The EventData structure.

Occurs when any object is spawned into the mission.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

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

Will update this page when new information become available.

  • initiator: The unit that had the failure.

Defined in:

Parameter:

The EventData structure.

Discard chair after ejection.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a dynamic cargo crate is removed.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.

Defined in:

Parameter:

The EventData structure.

Occurs when any system fails on a human controlled aircraft.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs on the death of a unit.

Contains more and different information. Similar to unit_lost it will occur for aircraft before the aircraft crash event occurs. Have a look at the class Core.Event#EVENT as these are just the prototypes.

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

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.

initiator : The unit that has landed place: Object that the unit landed on. Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

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

Event does not occur if the pilot lands in the water and sub combs to Davey Jones Locker. Have a look at the class Core.Event#EVENT as these are just the prototypes.

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

Defined in:

Parameter:

The EventData structure.

Landing quality mark.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when the pilot of an aircraft is killed.

Can occur either if the player is alive and crashes or if a weapon kills the pilot without completely destroying the plane. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the player left.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

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

There is no information on what values the score was changed to. Event is likely similar to player_comment in this regard. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was doing the shooting.

Defined in:

Parameter:

The EventData structure.

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

Most common with aircraft cannons (GAU-8), autocannons, and machine guns. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is doing the shooting. target: The unit that is being targeted.

Defined in:

Parameter:

The EventData structure.

Occurs whenever any unit in a mission fires a weapon.

But not any machine gun or autocannon based weapon, those are handled by EVENT.ShootingStart. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Trigger zone.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

  • initiator: The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Schedule a new time event.

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

Defined in:

Parameters:

#number Start

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

#function SchedulerFunction

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

#table ...

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

Return value:

#string:

The Schedule ID of the planned schedule.

Schedule a new time event.

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

Defined in:

Parameters:

#number Start

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

#number Repeat

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

#number RandomizeFactor

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

#number Stop

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

#function SchedulerFunction

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

#table ...

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

Return value:

#string:

The Schedule ID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#string SchedulerID

(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.

Set the Class Core.Event processing Priority.

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

Defined in:

Parameter:

#number EventPriority

The Core.Event processing Priority.

Return value:

self

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

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

Defined in:

Parameters:

Object

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

Key

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

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

true = trace all methods in MOOSE.

Set tracing for a class

Defined in:

Parameter:

#string Class

Class name.

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

Class name.

#string Method

Method.

Set trace level

Defined in:

Parameter:

#number Level

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

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

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

Defined in:

Parameter:

#boolean TraceOnOff

Switch the tracing on or off.

Usage:


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

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

UnSubscribe to a DCS event.

Defined in:

Parameter:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

The main event handling function...

This function captures all events generated for the class.

Defined in:

Parameter:

DCS#Event event

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)