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)

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

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

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

RESCUEHELO.endstates

RESCUEHELO:is(State, state)

Check if FSM is in state.

RESCUEHELO.options

RESCUEHELO.subs

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.