Banner Image

Module Ops.RescueHelo

Ops - Rescue helicopter for carrier operations.

Recue helicopter for carrier operations.

Main Features:

  • Close formation with carrier.
  • No restrictions regarding carrier waypoints and heading.
  • Automatic respawning on empty fuel for 24/7 operations.
  • Automatic rescuing of crashed or ejected pilots in the vicinity of the carrier.
  • Multiple helos at different carriers due to object oriented approach.
  • Finite State Machine (FSM) implementation.

Known (DCS) Issues

  • CH-53E does only report 27.5% fuel even if fuel is set to 100% in the ME. See bug report
  • CH-53E does not accept USS Tarawa as landing airbase (even it can be spawned on it).
  • Helos dont move away from their landing position on carriers.

Author: funkyfranky

Contributions: Flightcontrol (AI.AI_Formation class being used here)

Global(s)

Global RESCUEHELO

Rescue Helo


Recue Helo

The rescue helo will fly in close formation with another unit, which is typically an aircraft carrier.

#RESCUEHELO RESCUEHELO

Rescue Helo


Recue Helo

The rescue helo will fly in close formation with another unit, which is typically an aircraft carrier.

It's mission is to rescue crashed or ejected pilots. Well, and to look cool...

Simple Script

In the mission editor you have to set up a carrier unit, which will act as "mother". In the following, this unit will be named "USS Stennis".

Secondly, you need to define a rescue helicopter group in the mission editor and set it to "LATE ACTIVATED". The name of the group we'll use is "Recue Helo".

The basic script is very simple and consists of only two lines.

 RescueheloStennis=RESCUEHELO:New(UNIT:FindByName("USS Stennis"), "Rescue Helo")
 RescueheloStennis:Start()

The first line will create a new #RESCUEHELO object via RESCUEHELO.New and the second line starts the process by calling RESCUEHELO.Start.

NOTE that it is very important to define the RESCUEHELO object as global variable. Otherwise, the lua garbage collector will kill the formation for unknown reasons!

By default, the helo will be spawned on the USS Stennis with hot engines. Then it will take off and go on station on the starboard side of the boat.

Once the helo is out of fuel, it will return to the carrier. When the helo lands, it will be respawned immidiately and go back on station.

If a unit crashes or a pilot ejects within a radius of 30 km from the USS Stennis, the helo will automatically fly to the crash side and rescue to pilot. This will take around 5 minutes. After that, the helo will return to the Stennis, land there and bring back the poor guy. When this is done, the helo will go back on station.

Fine Tuning

The implementation allows to customize quite a few settings easily via user API functions.

Takeoff Type

By default, the helo is spawned with running engines on the carrier. The mission designer has set option to set the take off type via the RESCUEHELO.SetTakeoff function. Or via shortcuts

For example,

 RescueheloStennis=RESCUEHELO:New(UNIT:FindByName("USS Stennis"), "Rescue Helo")
 RescueheloStennis:SetTakeoffAir()
 RescueheloStennis:Start()

will spawn the helo near the USS Stennis in air.

Spawning in air is not as realistic but can be useful do avoid DCS bugs and shortcomings like aircraft crashing into each other on the flight deck.

Note that when spawning in air is set, the helo will also not return to the boat, once it is out of fuel. Instead it will be respawned in air.

If only the first spawning should happen on the carrier, one use the RESCUEHELO.SetRespawnInAir() function to command that all subsequent spawning will happen in air.

If the helo should no be respawned at all, one can set RESCUEHELO.SetRespawnOff().

Home Base

It is possible to define a "home base" other than the aircraft carrier using the RESCUEHELO.SetHomeBase(airbase) function, where airbase is a Wrapper.Airbase#AIRBASE object or simply the name of the airbase.

For example, one could imagine a strike group, and the helo will be spawned from another ship which has a helo pad.

 RescueheloStennis=RESCUEHELO:New(UNIT:FindByName("USS Stennis"), "Rescue Helo")
 RescueheloStennis:SetHomeBase(AIRBASE:FindByName("USS Normandy"))
 RescueheloStennis:Start()

In this case, the helo will be spawned on the USS Normandy and then make its way to the USS Stennis to establish the formation. Note that the distance to the mother ship should be rather small since the helo will go there very slowly.

Once the helo runs out of fuel, it will return to the USS Normandy and not the Stennis for respawning.

Formation Position

The position of the helo relative to the mother ship can be tuned via the functions

  • RESCUEHELO.SetAltitude(altitude), where altitude is the altitude the helo flies at in meters. Default is 70 meters.
  • RESCUEHELO.SetOffsetX(distance), where *distance is the distance in the direction of movement of the carrier. Default is 200 meters.
  • RESCUEHELO.SetOffsetZ(distance), where *distance is the distance on the starboard side. Default is 100 meters.

Rescue Operations

By default the rescue helo will start a rescue operation if an aircraft crashes or a pilot ejects in the vicinity of the carrier. This is restricted to aircraft of the same coalition as the rescue helo. Enemy (or neutral) pilots will be left on their own.

The standard "rescue zone" has a radius of 15 NM (~28 km) around the carrier. The radius can be adjusted via the RESCUEHELO.SetRescueZone(radius) functions, where radius is the radius of the zone in nautical miles. If you use multiple rescue helos in the same mission, you might want to ensure that the radii are not overlapping so that two helos try to rescue the same pilot. But it should not hurt either way.

Once the helo reaches the crash site, the rescue operation will last 5 minutes. This time can be changed by RESCUEHELO.SetRescueDuration(speed), where the speed is given in knots.

If no rescue operations should be carried out by the helo, this option can be completely disabled by using RESCUEHELO.SetRescueOff().

Finite State Machine

The implementation uses a Finite State Machine (FSM). This allows the mission designer to hook in to certain events.

  • RESCUEHELO.Start: This eventfunction starts the FMS process and initialized parameters and spawns the helo. DCS event handling is started.
  • RESCUEHELO.Status: This eventfunction is called in regular intervals (~60 seconds) and checks the status of the helo and carrier. It triggers other events if necessary.
  • RESCUEHELO.Rescue: This eventfunction commands the helo to go on a rescue operation at a certain coordinate.
  • RESCUEHELO.RTB: This eventsfunction sends the helo to its home base (usually the carrier). This is called once the helo runs low on gas.
  • RESCUEHELO.Run: This eventfunction is called when the helo resumes normal operations and goes back on station.
  • RESCUEHELO.Stop: This eventfunction stops the FSM by unhandling DCS events.

The mission designer can capture these events by RESCUEHELO.OnAfterEventname functions, e.g. RESCUEHELO.OnAfterRescue.

Debugging

In case you have problems, it is always a good idea to have a look at your DCS log file. You find it in your "Saved Games" folder, so for example in

C:\Users\<yourname>\Saved Games\DCS\Logs\dcs.log

All output concerning the #RESCUEHELO class should have the string "RESCUEHELO" in the corresponding line. Searching for lines that contain the string "error" or "nil" can also give you a hint what's wrong.

The verbosity of the output can be increased by adding the following lines to your script:

BASE:TraceOnOff(true)
BASE:TraceLevel(1)
BASE:TraceClass("RESCUEHELO")

To get even more output you can increase the trace level to 2 or even 3, c.f. Core.Base#BASE for more details.

Debug Mode

You have the option to enable the debug mode for this class via the RESCUEHELO.SetDebugModeON function. If enabled, text messages about the helo status will be displayed on screen and marks of the pattern created on the F10 map.

Global _RESCUEHELOID

#number _RESCUEHELOID

Type(s)

RESCUEHELO , extends Core.Fsm#FSM , extends Core.Base#BASE
Fields and Methods inherited from RESCUEHELO Description

RESCUEHELO.ClassName

Name of the class.

RESCUEHELO.Debug

Debug mode on/off.

RESCUEHELO:GetAlias()

Alias of helo spawn group.

RESCUEHELO:GetUnitName()

Get unit name of the spawned helo.

RESCUEHELO.HeloFuel0

Initial fuel of helo in percent. Necessary due to DCS bug that helo with full tank does not return fuel via API function.

RESCUEHELO:IsRescuing()

Check if helo is on a rescue mission.

RESCUEHELO:IsReturning()

Check if helo is returning to base.

RESCUEHELO:IsRunning()

Check if helo is operating.

RESCUEHELO:IsStopped()

Check if FMS was stopped.

RESCUEHELO:New(carrierunit, helogroupname)

Create a new RESCUEHELO object.

RESCUEHELO:OnAfterRTB(From, Event, To, airbase)

On after "RTB" event user function.

RESCUEHELO:OnAfterRescue(From, Event, To, RescueCoord)

On after "Rescue" event user function.

RESCUEHELO:OnAfterReturned(From, Event, To, airbase)

On after "Returned" event user function.

RESCUEHELO:OnAfterStart(From, Event, To)

On after "Start" event function.

RESCUEHELO:OnEventLand(EventData)

Handle landing event of rescue helo.

RESCUEHELO:RTB(airbase)

Triggers the FSM event "RTB" that sends the helo home.

RESCUEHELO:Rescue(RescueCoord)

Triggers the FSM event "Rescue" that sends the helo on a rescue mission to a specifc coordinate.

RESCUEHELO:Returned(airbase)

Triggers the FSM event "Returned" after the helo has landed.

RESCUEHELO:RouteRTB(RTBAirbase, Speed)

Route helo back to its home base.

RESCUEHELO:Run()

Triggers the FSM event "Run".

RESCUEHELO:SetAltitude(alt)

Set altitude of helo.

RESCUEHELO:SetDebugModeOFF()

Deactivate debug mode.

RESCUEHELO:SetDebugModeON()

Activate debug mode.

RESCUEHELO:SetFollowTimeInterval(dt)

Set follow time update interval.

RESCUEHELO:SetHomeBase(airbase)

Set home airbase of the helo.

RESCUEHELO:SetLowFuelThreshold(threshold)

Set low fuel state of helo.

RESCUEHELO:SetModex(modex)

Set modex (tail number) of the helo.

RESCUEHELO:SetOffsetX(distance)

Set offset parallel to orientation of carrier.

RESCUEHELO:SetOffsetZ(distance)

Set offset perpendicular to orientation to carrier.

RESCUEHELO:SetRescueDuration(duration)

Set rescue duration.

RESCUEHELO:SetRescueHoverSpeed(speed)

Set rescue hover speed.

RESCUEHELO:SetRescueOff()

Deactivate rescue option.

RESCUEHELO:SetRescueOn()

Activate rescue option.

RESCUEHELO:SetRescueStopBoatOff()

Do not stop carrier during rescue operations.

RESCUEHELO:SetRescueStopBoatOn()

Stop carrier during rescue operations.

RESCUEHELO:SetRescueZone(radius)

Set rescue zone radius.

RESCUEHELO:SetRespawnInAir()

Helo will be respawned in air, even it was initially spawned on the carrier.

RESCUEHELO:SetRespawnOff()

Disable respawning of helo.

RESCUEHELO:SetRespawnOn()

Enable respawning of helo.

RESCUEHELO:SetRespawnOnOff(switch)

Set whether helo shall be respawned or not.

RESCUEHELO:SetTakeoff(takeofftype)

Set takeoff type.

RESCUEHELO:SetTakeoffAir()

Set takeoff in air near the carrier.

RESCUEHELO:SetTakeoffCold()

Set takeoff with engines off (cold).

RESCUEHELO:SetTakeoffHot()

Set takeoff with engines running (hot).

RESCUEHELO:SetUseUncontrolledAircraft()

Use an uncontrolled aircraft already present in the mission rather than spawning a new helo as initial rescue helo.

RESCUEHELO:Start()

Triggers the FSM event "Start" that starts the rescue helo.

RESCUEHELO:Status()

Triggers the FSM event "Status" that updates the helo status.

RESCUEHELO:Stop()

Triggers the FSM event "Stop" that stops the rescue helo.

RESCUEHELO:_OnEventCrashOrEject(EventData)

A unit crashed or a player ejected.

RESCUEHELO:_TaskRTB()

Task to send the helo RTB.

RESCUEHELO:__RTB(delay, airbase)

Triggers the FSM event "RTB" that sends the helo home after a delay.

RESCUEHELO:__Rescue(delay, RescueCoord)

Triggers the delayed FSM event "Rescue" that sends the helo on a rescue mission to a specifc coordinate.

RESCUEHELO:__Returned(delay, airbase)

Triggers the delayed FSM event "Returned" after the helo has landed.

RESCUEHELO:__Run(delay)

Triggers the delayed FSM event "Run".

RESCUEHELO:__Start(delay)

Triggers the FSM event "Start" that starts the rescue helo after a delay.

RESCUEHELO:__Status(delay)

Triggers the delayed FSM event "Status" that updates the helo status.

RESCUEHELO:__Stop(delay)

Triggers the FSM event "Stop" that stops the rescue helo after a delay.

RESCUEHELO.airbase

The airbase object acting as home base of the helo.

RESCUEHELO.alias

Alias of the spawn group.

RESCUEHELO.altitude

Altitude of helo in meters.

RESCUEHELO.carrier

The carrier the helo is attached to.

RESCUEHELO.carrierstop

If true, route of carrier was stopped.

RESCUEHELO.carriertype

Carrier type.

RESCUEHELO.dtFollow

Follow time update interval in seconds. Default 1.0 sec.

RESCUEHELO.followset

Follow group set.

RESCUEHELO.formation

AI_FORMATION object.

RESCUEHELO.helo

Helo group.

RESCUEHELO.helogroupname

Name of the late activated helo template group.

RESCUEHELO.hid

Unit ID of the helo group. (Global) Running number.

RESCUEHELO.lid

Log debug id text.

RESCUEHELO.lowfuel

Low fuel threshold of helo in percent.

RESCUEHELO.modex

Tail number of the helo.

RESCUEHELO.offsetX

Offset in meters to carrier in longitudinal direction.

RESCUEHELO.offsetZ

Offset in meters to carrier in latitudinal direction.

RESCUEHELO:onafterRTB(From, Event, To, airbase)

On after RTB event.

RESCUEHELO:onafterRescue(From, Event, To, RescueCoord)

On after "Rescue" event.

RESCUEHELO:onafterReturned(From, Event, To, airbase)

On after Returned event.

RESCUEHELO:onafterRun(From, Event, To)

On after "Run" event.

RESCUEHELO:onafterStart(From, Event, To)

On after Start event.

RESCUEHELO:onafterStatus(From, Event, To)

On after Status event.

RESCUEHELO:onafterStop(From, Event, To)

On after Stop event.

RESCUEHELO.rescueduration

Time the rescue helicopter hovers over the crash site in seconds.

RESCUEHELO.rescueon

If true, helo will rescue crashed pilots. If false, no recuing will happen.

RESCUEHELO.rescuespeed

Speed in m/s the rescue helicopter hovers at over the crash site.

RESCUEHELO.rescuestopboat

If true, stop carrier during rescue operations.

RESCUEHELO.rescuezone

Zone around the carrier in which helo will rescue crashed or ejected units.

RESCUEHELO.respawn

If true, helo be respawned (default). If false, no respawning will happen.

RESCUEHELO.respawninair

If true, helo will always be respawned in air. This has no impact on the initial spawn setting.

RESCUEHELO.rtb

If true, Helo will be return to base on the next status check.

RESCUEHELO.takeoff

Takeoff type.

RESCUEHELO.uid

Unique ID of this helo.

RESCUEHELO.uncontrolledac

If true, use and uncontrolled helo group already present in the mission.

RESCUEHELO.version

Class version.

Fields and Methods inherited from FSM Description

RESCUEHELO:AddEndState(State)

Adds an End state.

RESCUEHELO: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.

RESCUEHELO:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

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

Adds a score for the FSM_PROCESS to be achieved.

RESCUEHELO:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

RESCUEHELO.CallScheduler

Call scheduler.

RESCUEHELO.ClassName

Name of the class.

RESCUEHELO.Events

RESCUEHELO:GetCurrentState()

Get current state.

RESCUEHELO:GetEndStates()

Returns the End states.

RESCUEHELO:GetProcess(From, Event)

RESCUEHELO:GetProcesses()

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

RESCUEHELO:GetScores()

Returns a table with the scores defined.

RESCUEHELO:GetStartState()

Returns the start state of the FSM.

RESCUEHELO:GetState()

Get current state.

RESCUEHELO:GetSubs()

Returns a table with the Subs defined.

RESCUEHELO:GetTransitions()

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

RESCUEHELO:Is(State)

Check if FSM is in state.

RESCUEHELO:LoadCallBacks(CallBackTable)

Load call backs.

RESCUEHELO:New()

Creates a new FSM object.

RESCUEHELO.Scores

Scores.

RESCUEHELO:SetProcess(From, Event, Fsm)

RESCUEHELO:SetStartState(State)

Sets the start state of the FSM.

RESCUEHELO._EndStates

RESCUEHELO._EventSchedules

RESCUEHELO._Processes

RESCUEHELO._Scores

RESCUEHELO._StartState

RESCUEHELO._Transitions

RESCUEHELO:_add_to_map(Map, Event)

Add to map.

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

Call handler.

RESCUEHELO:_create_transition(EventName)

Create transition.

RESCUEHELO:_delayed_transition(EventName)

Delayed transition.

RESCUEHELO:_eventmap(Events, EventStructure)

Event map.

RESCUEHELO:_gosub(ParentFrom, ParentEvent)

Go sub.

RESCUEHELO:_handler(EventName, ...)

Handler.

RESCUEHELO:_isendstate(Current)

Is end state.

RESCUEHELO:_submap(subs, sub, name)

Sub maps.

RESCUEHELO:can(e)

Check if can do an event.

RESCUEHELO:cannot(e)

Check if cannot do an event.

RESCUEHELO.current

Current state name.

RESCUEHELO.endstates

RESCUEHELO:is(State, state)

Check if FSM is in state.

RESCUEHELO.options

Options.

RESCUEHELO.subs

Subs.

Fields and Methods inherited from BASE Description

RESCUEHELO.ClassID

The ID number of the class.

RESCUEHELO.ClassName

The name of the class.

RESCUEHELO.ClassNameAndID

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

RESCUEHELO:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

RESCUEHELO:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

RESCUEHELO:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

RESCUEHELO:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

RESCUEHELO:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

RESCUEHELO:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

RESCUEHELO:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

RESCUEHELO:E(Arguments)

Log an exception which will be traced always.

RESCUEHELO:EventDispatcher()

Returns the event dispatcher

RESCUEHELO:EventRemoveAll()

Remove all subscribed events

RESCUEHELO:F(Arguments)

Trace a function call.

RESCUEHELO:F2(Arguments)

Trace a function call level 2.

RESCUEHELO:F3(Arguments)

Trace a function call level 3.

RESCUEHELO:GetClassID()

Get the ClassID of the class instance.

RESCUEHELO:GetClassName()

Get the ClassName of the class instance.

RESCUEHELO:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

RESCUEHELO:GetEventPriority()

Get the Class Core.Event processing Priority.

RESCUEHELO:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

RESCUEHELO:GetState(Object, Key)

Get a Value given a Key from the Object.

RESCUEHELO:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

RESCUEHELO:I(Arguments)

Log an information which will be traced always.

RESCUEHELO:Inherit(Child, Parent)

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

RESCUEHELO:IsInstanceOf(ClassName)

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

RESCUEHELO:IsTrace()

Enquires if tracing is on (for the class).

RESCUEHELO:New()

BASE constructor.

RESCUEHELO:OnEvent(EventData)

Occurs when an Event for an object is triggered.

RESCUEHELO:OnEventBDA(EventData)

BDA.

RESCUEHELO:OnEventBaseCaptured(EventData)

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

RESCUEHELO:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

RESCUEHELO:OnEventCrash(EventData)

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

RESCUEHELO:OnEventDead(EventData)

Occurs when an object is dead.

RESCUEHELO:OnEventDetailedFailure(EventData)

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

RESCUEHELO:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

RESCUEHELO: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.

RESCUEHELO:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

RESCUEHELO:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

RESCUEHELO:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

RESCUEHELO:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

RESCUEHELO:OnEventKill(EventData)

Occurs on the death of a unit.

RESCUEHELO: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.

RESCUEHELO:OnEventLandingAfterEjection(EventData)

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

RESCUEHELO:OnEventLandingQualityMark(EventData)

Landing quality mark.

RESCUEHELO:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

RESCUEHELO:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

RESCUEHELO:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

RESCUEHELO:OnEventMissionEnd(EventData)

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

RESCUEHELO:OnEventMissionStart(EventData)

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

RESCUEHELO:OnEventParatrooperLanding(EventData)

Weapon add.

RESCUEHELO:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

RESCUEHELO:OnEventPlayerEnterAircraft(EventData)

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

RESCUEHELO:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

RESCUEHELO:OnEventPlayerLeaveUnit(EventData)

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

RESCUEHELO:OnEventRefueling(EventData)

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

RESCUEHELO:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

RESCUEHELO:OnEventScore(EventData)

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

RESCUEHELO:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

RESCUEHELO:OnEventShootingStart(EventData)

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

RESCUEHELO:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

RESCUEHELO:OnEventTakeoff(EventData)

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

RESCUEHELO:OnEventTriggerZone(EventData)

Trigger zone.

RESCUEHELO:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

RESCUEHELO:ScheduleStop(SchedulerID)

Stops the Schedule.

RESCUEHELO.Scheduler

RESCUEHELO:SetEventPriority(EventPriority)

Set the Class Core.Event processing Priority.

RESCUEHELO:SetState(Object, Key, Value)

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

RESCUEHELO:T(Arguments)

Trace a function logic level 1.

RESCUEHELO:T2(Arguments)

Trace a function logic level 2.

RESCUEHELO:T3(Arguments)

Trace a function logic level 3.

RESCUEHELO:TraceAll(TraceAll)

Trace all methods in MOOSE

RESCUEHELO:TraceClass(Class)

Set tracing for a class

RESCUEHELO:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

RESCUEHELO:TraceLevel(Level)

Set trace level

RESCUEHELO:TraceOff()

Set trace off.

RESCUEHELO:TraceOn()

Set trace on.

RESCUEHELO: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.

RESCUEHELO:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

RESCUEHELO._

RESCUEHELO:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

RESCUEHELO:_Serialize(Arguments)

(Internal) Serialize arguments

RESCUEHELO:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

RESCUEHELO.__

RESCUEHELO:onEvent(event)

The main event handling function...

RESCUEHELO class.

Field(s)

#string RESCUEHELO.ClassName

Name of the class.

#boolean RESCUEHELO.Debug

Debug mode on/off.

#number RESCUEHELO.HeloFuel0

Initial fuel of helo in percent. Necessary due to DCS bug that helo with full tank does not return fuel via API function.

Wrapper.Airbase#AIRBASE RESCUEHELO.airbase

The airbase object acting as home base of the helo.

#string RESCUEHELO.alias

Alias of the spawn group.

#number RESCUEHELO.altitude

Altitude of helo in meters.

Wrapper.Unit#UNIT RESCUEHELO.carrier

The carrier the helo is attached to.

#boolean RESCUEHELO.carrierstop

If true, route of carrier was stopped.

#string RESCUEHELO.carriertype

Carrier type.

#number RESCUEHELO.dtFollow

Follow time update interval in seconds. Default 1.0 sec.

#string RESCUEHELO.helogroupname

Name of the late activated helo template group.

#number RESCUEHELO.hid

Unit ID of the helo group. (Global) Running number.

#string RESCUEHELO.lid

Log debug id text.

#number RESCUEHELO.lowfuel

Low fuel threshold of helo in percent.

#number RESCUEHELO.modex

Tail number of the helo.

#number RESCUEHELO.offsetX

Offset in meters to carrier in longitudinal direction.

#number RESCUEHELO.offsetZ

Offset in meters to carrier in latitudinal direction.

#number RESCUEHELO.rescueduration

Time the rescue helicopter hovers over the crash site in seconds.

#boolean RESCUEHELO.rescueon

If true, helo will rescue crashed pilots. If false, no recuing will happen.

#number RESCUEHELO.rescuespeed

Speed in m/s the rescue helicopter hovers at over the crash site.

#boolean RESCUEHELO.rescuestopboat

If true, stop carrier during rescue operations.

Core.Zone#ZONE_RADIUS RESCUEHELO.rescuezone

Zone around the carrier in which helo will rescue crashed or ejected units.

#boolean RESCUEHELO.respawn

If true, helo be respawned (default). If false, no respawning will happen.

#boolean RESCUEHELO.respawninair

If true, helo will always be respawned in air. This has no impact on the initial spawn setting.

#boolean RESCUEHELO.rtb

If true, Helo will be return to base on the next status check.

#number RESCUEHELO.takeoff

Takeoff type.

#number RESCUEHELO.uid

Unique ID of this helo.

#boolean RESCUEHELO.uncontrolledac

If true, use and uncontrolled helo group already present in the mission.

#string RESCUEHELO.version

Class version.

Function(s)

Alias of helo spawn group.

Defined in:

RESCUEHELO

Return value:

#string:

Alias of the helo.

Get unit name of the spawned helo.

Defined in:

RESCUEHELO

Return value:

#string:

Name of the helo unit or nil if it does not exist.

Check if helo is on a rescue mission.

Defined in:

RESCUEHELO

Return value:

#boolean:

If true, helo is rescuing somebody.

Check if helo is returning to base.

Defined in:

RESCUEHELO

Return value:

#boolean:

If true, helo is returning to base.

Check if helo is operating.

Defined in:

RESCUEHELO

Return value:

#boolean:

If true, helo is operating.

Check if FMS was stopped.

Defined in:

RESCUEHELO

Return value:

#boolean:

If true, is stopped.

Create a new RESCUEHELO object.

Defined in:

RESCUEHELO

Parameters:

Wrapper.Unit#UNIT carrierunit

Carrier unit object or simply the unit name.

#string helogroupname

Name of the late activated rescue helo template group.

Return value:

RESCUEHELO object.

On after "RTB" event user function.

Called when a the the helo returns to its home base.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The airbase to return to. Default is the home base.

On after "Rescue" event user function.

Called when a the the helo goes on a rescue mission.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Core.Point#COORDINATE RescueCoord

Crash site where the rescue operation takes place.

On after "Returned" event user function.

Called when a the the helo has landed at an airbase.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The airbase the helo has landed.

On after "Start" event function.

Called when FSM is started.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Handle landing event of rescue helo.

Defined in:

RESCUEHELO

Parameter:

Event data.

Triggers the FSM event "RTB" that sends the helo home.

Defined in:

RESCUEHELO

Parameter:

The airbase to return to. Default is the home base.

Triggers the FSM event "Rescue" that sends the helo on a rescue mission to a specifc coordinate.

Defined in:

RESCUEHELO

Parameter:

Core.Point#COORDINATE RescueCoord

Coordinate where the resue mission takes place.

Triggers the FSM event "Returned" after the helo has landed.

Defined in:

RESCUEHELO

Parameter:

The airbase the helo has landed.

Route helo back to its home base.

Defined in:

RESCUEHELO

Parameters:

#number Speed

Speed.

Triggers the FSM event "Run".

Defined in:

RESCUEHELO

Set altitude of helo.

Defined in:

RESCUEHELO

Parameter:

#number alt

Altitude in meters. Default 70 m.

Return value:

self

Deactivate debug mode.

This is also the default setting.

Defined in:

RESCUEHELO

Return value:

self

Activate debug mode.

Display debug messages on screen.

Defined in:

RESCUEHELO

Return value:

self

Set follow time update interval.

Defined in:

RESCUEHELO

Parameter:

#number dt

Time interval in seconds. Default 1.0 sec.

Return value:

self

Set home airbase of the helo.

This is the airbase where the helo is spawned (if not in air) and will go when it is out of fuel.

Defined in:

RESCUEHELO

Parameter:

The home airbase. Can be the airbase name (passed as a string) or a Moose AIRBASE object.

Return value:

self

Set low fuel state of helo.

When fuel is below this threshold, the helo will RTB or be respawned if takeoff type is in air.

Defined in:

RESCUEHELO

Parameter:

#number threshold

Low fuel threshold in percent. Default 5%.

Return value:

self

Set modex (tail number) of the helo.

Defined in:

RESCUEHELO

Parameter:

#number modex

Tail number.

Return value:

self

Set offset parallel to orientation of carrier.

Defined in:

RESCUEHELO

Parameter:

#number distance

Offset distance in meters. Default 200 m (~660 ft).

Return value:

self

Set offset perpendicular to orientation to carrier.

Defined in:

RESCUEHELO

Parameter:

#number distance

Offset distance in meters. Default 240 m (~780 ft).

Return value:

self

Set rescue duration.

This is the time it takes to rescue a pilot at the crash site.

Defined in:

RESCUEHELO

Parameter:

#number duration

Duration in minutes. Default 5 min.

Return value:

self

Set rescue hover speed.

Defined in:

RESCUEHELO

Parameter:

#number speed

Speed in knots. Default 5 kts.

Return value:

self

Deactivate rescue option.

Crashed and ejected pilots will not be rescued.

Defined in:

RESCUEHELO

Return value:

self

Activate rescue option.

Crashed and ejected pilots will be rescued. This is the default setting.

Defined in:

RESCUEHELO

Return value:

self

Do not stop carrier during rescue operations.

This is the default setting.

Defined in:

RESCUEHELO

Return value:

self

Stop carrier during rescue operations.

NOT WORKING!

Defined in:

RESCUEHELO

Return value:

self

Set rescue zone radius.

Crashed or ejected units inside this radius of the carrier will be rescued if possible.

Defined in:

RESCUEHELO

Parameter:

#number radius

Radius of rescue zone in nautical miles. Default is 15 NM.

Return value:

self

Helo will be respawned in air, even it was initially spawned on the carrier.

So only the first spawn will be on the carrier while all subsequent spawns will happen in air. This allows for undisrupted operations and less problems on the carrier deck.

Defined in:

RESCUEHELO

Return value:

self

Disable respawning of helo.

Defined in:

RESCUEHELO

Return value:

self

Enable respawning of helo.

Note that this is the default behaviour.

Defined in:

RESCUEHELO

Return value:

self

Set whether helo shall be respawned or not.

Defined in:

RESCUEHELO

Parameter:

#boolean switch

If true (or nil), helo will be respawned. If false, helo will not be respawned.

Return value:

self

Set takeoff type.

Defined in:

RESCUEHELO

Parameter:

#number takeofftype

Takeoff type. Default SPAWN.Takeoff.Hot.

Return value:

self

Set takeoff in air near the carrier.

Defined in:

RESCUEHELO

Return value:

self

Set takeoff with engines off (cold).

Defined in:

RESCUEHELO

Return value:

self

Set takeoff with engines running (hot).

Defined in:

RESCUEHELO

Return value:

self

Use an uncontrolled aircraft already present in the mission rather than spawning a new helo as initial rescue helo.

This can be useful when interfaced with, e.g., a warehouse. The group name is the one specified in the RESCUEHELO.New function.

Defined in:

RESCUEHELO

Return value:

self

Triggers the FSM event "Start" that starts the rescue helo.

Initializes parameters and starts event handlers.

Defined in:

RESCUEHELO

Triggers the FSM event "Status" that updates the helo status.

Defined in:

RESCUEHELO

Triggers the FSM event "Stop" that stops the rescue helo.

Event handlers are stopped.

Defined in:

RESCUEHELO

A unit crashed or a player ejected.

Defined in:

RESCUEHELO

Parameter:

Event data.

Task to send the helo RTB.

Defined in:

RESCUEHELO

Return value:

DCS Task table.

Triggers the FSM event "RTB" that sends the helo home after a delay.

Defined in:

RESCUEHELO

Parameters:

#number delay

Delay in seconds.

The airbase to return to. Default is the home base.

Triggers the delayed FSM event "Rescue" that sends the helo on a rescue mission to a specifc coordinate.

Defined in:

RESCUEHELO

Parameters:

#number delay

Delay in seconds.

Core.Point#COORDINATE RescueCoord

Coordinate where the resue mission takes place.

Triggers the delayed FSM event "Returned" after the helo has landed.

Defined in:

RESCUEHELO

Parameters:

#number delay

Delay in seconds.

The airbase the helo has landed.

Triggers the delayed FSM event "Run".

Defined in:

RESCUEHELO

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Start" that starts the rescue helo after a delay.

Initializes parameters and starts event handlers.

Defined in:

RESCUEHELO

Parameter:

#number delay

Delay in seconds.

Triggers the delayed FSM event "Status" that updates the helo status.

Defined in:

RESCUEHELO

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Stop" that stops the rescue helo after a delay.

Event handlers are stopped.

Defined in:

RESCUEHELO

Parameter:

#number delay

Delay in seconds.

On after RTB event.

Send helo back to carrier.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The base to return to. Default is the home base.

On after "Rescue" event.

Helo will fly to the given coordinate, orbit there for 5 minutes and then return to the carrier.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Core.Point#COORDINATE RescueCoord

Coordinate where the rescue should happen.

On after Returned event.

Helo has landed.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

The base to which the helo has returned.

On after "Run" event.

FSM will go to "Running" state. If formation is stopped, it will be started again.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after Start event.

Starts the warehouse. Addes event handlers and schedules status updates of reqests and queue.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after Status event.

Checks player status.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after Stop event.

Unhandle events and stop status updates. If helo is alive, it is despawned.

Defined in:

RESCUEHELO

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Field(s)

#string RESCUEHELO.ClassName

Name of the class.

#boolean RESCUEHELO.Debug

Debug mode on/off.

#number RESCUEHELO.HeloFuel0

Initial fuel of helo in percent. Necessary due to DCS bug that helo with full tank does not return fuel via API function.

Wrapper.Airbase#AIRBASE RESCUEHELO.airbase

The airbase object acting as home base of the helo.

#string RESCUEHELO.alias

Alias of the spawn group.

#number RESCUEHELO.altitude

Altitude of helo in meters.

Wrapper.Unit#UNIT RESCUEHELO.carrier

The carrier the helo is attached to.

#boolean RESCUEHELO.carrierstop

If true, route of carrier was stopped.

#string RESCUEHELO.carriertype

Carrier type.

#number RESCUEHELO.dtFollow

Follow time update interval in seconds. Default 1.0 sec.

#string RESCUEHELO.helogroupname

Name of the late activated helo template group.

#number RESCUEHELO.hid

Unit ID of the helo group. (Global) Running number.

#string RESCUEHELO.lid

Log debug id text.

#number RESCUEHELO.lowfuel

Low fuel threshold of helo in percent.

#number RESCUEHELO.modex

Tail number of the helo.

#number RESCUEHELO.offsetX

Offset in meters to carrier in longitudinal direction.

#number RESCUEHELO.offsetZ

Offset in meters to carrier in latitudinal direction.

#number RESCUEHELO.rescueduration

Time the rescue helicopter hovers over the crash site in seconds.

#boolean RESCUEHELO.rescueon

If true, helo will rescue crashed pilots. If false, no recuing will happen.

#number RESCUEHELO.rescuespeed

Speed in m/s the rescue helicopter hovers at over the crash site.

#boolean RESCUEHELO.rescuestopboat

If true, stop carrier during rescue operations.

Core.Zone#ZONE_RADIUS RESCUEHELO.rescuezone

Zone around the carrier in which helo will rescue crashed or ejected units.

#boolean RESCUEHELO.respawn

If true, helo be respawned (default). If false, no respawning will happen.

#boolean RESCUEHELO.respawninair

If true, helo will always be respawned in air. This has no impact on the initial spawn setting.

#boolean RESCUEHELO.rtb

If true, Helo will be return to base on the next status check.

#number RESCUEHELO.takeoff

Takeoff type.

#number RESCUEHELO.uid

Unique ID of this helo.

#boolean RESCUEHELO.uncontrolledac

If true, use and uncontrolled helo group already present in the mission.

#string RESCUEHELO.version

Class version.

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 RESCUEHELO.ClassName

Name of the class.

#boolean RESCUEHELO.Debug

Debug mode on/off.

#number RESCUEHELO.HeloFuel0

Initial fuel of helo in percent. Necessary due to DCS bug that helo with full tank does not return fuel via API function.

Wrapper.Airbase#AIRBASE RESCUEHELO.airbase

The airbase object acting as home base of the helo.

#string RESCUEHELO.alias

Alias of the spawn group.

#number RESCUEHELO.altitude

Altitude of helo in meters.

Wrapper.Unit#UNIT RESCUEHELO.carrier

The carrier the helo is attached to.

#boolean RESCUEHELO.carrierstop

If true, route of carrier was stopped.

#string RESCUEHELO.carriertype

Carrier type.

#number RESCUEHELO.dtFollow

Follow time update interval in seconds. Default 1.0 sec.

#string RESCUEHELO.helogroupname

Name of the late activated helo template group.

#number RESCUEHELO.hid

Unit ID of the helo group. (Global) Running number.

#string RESCUEHELO.lid

Log debug id text.

#number RESCUEHELO.lowfuel

Low fuel threshold of helo in percent.

#number RESCUEHELO.modex

Tail number of the helo.

#number RESCUEHELO.offsetX

Offset in meters to carrier in longitudinal direction.

#number RESCUEHELO.offsetZ

Offset in meters to carrier in latitudinal direction.

#number RESCUEHELO.rescueduration

Time the rescue helicopter hovers over the crash site in seconds.

#boolean RESCUEHELO.rescueon

If true, helo will rescue crashed pilots. If false, no recuing will happen.

#number RESCUEHELO.rescuespeed

Speed in m/s the rescue helicopter hovers at over the crash site.

#boolean RESCUEHELO.rescuestopboat

If true, stop carrier during rescue operations.

Core.Zone#ZONE_RADIUS RESCUEHELO.rescuezone

Zone around the carrier in which helo will rescue crashed or ejected units.

#boolean RESCUEHELO.respawn

If true, helo be respawned (default). If false, no respawning will happen.

#boolean RESCUEHELO.respawninair

If true, helo will always be respawned in air. This has no impact on the initial spawn setting.

#boolean RESCUEHELO.rtb

If true, Helo will be return to base on the next status check.

#number RESCUEHELO.takeoff

Takeoff type.

#number RESCUEHELO.uid

Unique ID of this helo.

#boolean RESCUEHELO.uncontrolledac

If true, use and uncontrolled helo group already present in the mission.

#string RESCUEHELO.version

Class version.

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a S_EVENT_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 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.

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