Banner Image

Module Ops.RescueHelo

Ops - (R2.5) - 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


Banner Image

Recue Helo

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

#RESCUEHELO RESCUEHELO

Rescue Helo


Banner Image

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.

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

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

RESCUEHELO.Events

RESCUEHELO:GetCurrentState()

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

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)

RESCUEHELO:LoadCallBacks(CallBackTable)

RESCUEHELO:New()

Creates a new FSM object.

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

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

RESCUEHELO:_create_transition(EventName)

RESCUEHELO:_delayed_transition(EventName)

RESCUEHELO:_eventmap(Events, EventStructure)

RESCUEHELO:_gosub(ParentFrom, ParentEvent)

RESCUEHELO:_handler(EventName, ...)

RESCUEHELO:_isendstate(Current)

RESCUEHELO:_submap(subs, sub, name)

RESCUEHELO:can(e)

RESCUEHELO:cannot(e)

RESCUEHELO.current

RESCUEHELO.endstates

RESCUEHELO:is(state)

RESCUEHELO.options

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

Creation of a Crash Event.

RESCUEHELO:CreateEventDead(EventTime, Initiator)

Creation of a Dead Event.

RESCUEHELO:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

RESCUEHELO:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff 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 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(Event, 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 object is completely destroyed.

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:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

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:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

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

RESCUEHELO:OnEventMissionStart(EventData)

Occurs when a mission starts

RESCUEHELO:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

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: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:ScheduleOnce(Start, SchedulerFunction, ...)

Schedule a new time event.

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

Schedule a new time event.

RESCUEHELO:ScheduleStop(SchedulerFunction)

Stops the Schedule.

RESCUEHELO.Scheduler

RESCUEHELO:SetEventPriority(EventPriority)

Set the Class 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: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(Event)

UnSubscribe to a DCS event.

RESCUEHELO._

RESCUEHELO:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

RESCUEHELO:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

RESCUEHELO.__

RESCUEHELO:onEvent(event)

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.

#number RESCUEHELO.UID
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.

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

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

#number RESCUEHELO.UID
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.

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

State

Set the default 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.

Returns the End states.

Defined in:

Defined in:

Parameters:

From

Event

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

Defined in:

Return value:

#table:

Returns a table with the scores defined.

Defined in:

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Returns a table with the Subs defined.

Defined in:

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

Defined in:

Return value:

#table:

Defined in:

Parameter:

State

Defined in:

Parameter:

CallBackTable

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.

Defined in:

Parameters:

Map

Event

Defined in:

Parameters:

step

trigger

params

EventName

Defined in:

Parameter:

EventName

Defined in:

Parameter:

EventName

Defined in:

Parameters:

Events

EventStructure

Defined in:

Parameters:

ParentFrom

ParentEvent

Defined in:

Parameters:

EventName

...

Defined in:

Parameter:

Current

Defined in:

Parameters:

subs

sub

name

Defined in:

Parameter:

e

Defined in:

Parameter:

e

Defined in:

Parameter:

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.

#number RESCUEHELO.UID
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.

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

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.

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.

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

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

FromClass

Return value:

Get a Value given a Key from the Object.

Note that if the Object is destroyed, nillified 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:

#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 object is completely destroyed.

initiator : The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

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

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.

initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

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

initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

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.

initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft lands at an airbase, farp or ship 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 when a new mark was added.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts

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. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

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.

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.

initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. 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. 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.

Defined in:

Parameter:

The EventData structure.

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

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.

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:

#number:

The ScheduleID 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:

#number:

The ScheduleID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#function SchedulerFunction

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

Set the Class 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 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, nillified 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

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

#string Method

Set trace level

Defined in:

Parameter:

#number Level

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:

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

TODO: Complete DCS#Event structure.
- The main event handling function... This function captures all events generated for the class. @param #BASE self @param DCS#Event event

Defined in:

Parameter:

event