Banner Image

Module AI.AI_Cargo_Helicopter

AI - Models the intelligent transportation of cargo using helicopters.


Author: FlightControl


Global(s)

Global AI_CARGO_HELICOPTER

Brings a dynamic cargo handling capability for an AI helicopter group.

#AI_CARGO_HELICOPTER AI_CARGO_HELICOPTER

Brings a dynamic cargo handling capability for an AI helicopter group.

Helicopter carriers can be mobilized to intelligently transport infantry and other cargo within the simulation.

The AI_CARGO_HELICOPTER class uses the Cargo.Cargo capabilities within the MOOSE framework. Cargo.Cargo must be declared within the mission to make the AI_CARGO_HELICOPTER object recognize the cargo. Please consult the Cargo.Cargo module for more information.

Cargo pickup.

Using the AI_CARGO_HELICOPTER.Pickup() method, you are able to direct the helicopters towards a point on the battlefield to board/load the cargo at the specific coordinate. Ensure that the landing zone is horizontally flat, and that trees cannot be found in the landing vicinity, or the helicopters won't land or will even crash!

Cargo deployment.

Using the AI_CARGO_HELICOPTER.Deploy() method, you are able to direct the helicopters towards a point on the battlefield to unboard/unload the cargo at the specific coordinate. Ensure that the landing zone is horizontally flat, and that trees cannot be found in the landing vicinity, or the helicopters won't land or will even crash!

Infantry health.

When infantry is unboarded from the helicopters, the infantry is actually respawned into the battlefield. As a result, the unboarding infantry is very healthy every time it unboards. This is due to the limitation of the DCS simulator, which is not able to specify the health of new spawned units as a parameter. However, infantry that was destroyed when unboarded, won't be respawned again. Destroyed is destroyed. As a result, there is some additional strength that is gained when an unboarding action happens, but in terms of simulation balance this has marginal impact on the overall battlefield simulation. Fortunately, the firing strength of infantry is limited, and thus, respacing healthy infantry every time is not so much of an issue ...

Developer Note

Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE Therefore, this class is considered to be deprecated


Global AI_CARGO_QUEUE

Type(s)

Fields and Methods inherited from AI_CARGO_HELICOPTER Description

AI_CARGO_HELICOPTER.Coalition

AI_CARGO_HELICOPTER:Deploy(Coordinate, Speed)

Deploy Trigger for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER.Helicopter

AI_CARGO_HELICOPTER:Home(Coordinate, Speed, Height)

Home Trigger for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER:New(Helicopter, CargoSet)

Creates a new AI_CARGO_HELICOPTER object.

AI_CARGO_HELICOPTER:OnAfterDeploy(From, Event, To, Coordinate, Speed)

Deploy Handler OnAfter for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER:OnAfterDeployed(From, Event, To)

Deployed Handler OnAfter for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER:OnAfterPickedUp(Helicopter, From, Event, To, Unit)

PickedUp Handler OnAfter for AI_CARGO_HELICOPTER - Cargo set has been picked up, ready to deploy

AI_CARGO_HELICOPTER:OnAfterPickup(From, Event, To, Coordinate, Speed)

Pickup Handler OnAfter for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER:OnAfterUnloaded(From, Event, To, Cargo, Unit)

Unloaded Handler OnAfter for AI_CARGO_HELICOPTER - Cargo unloaded, carrier is empty

AI_CARGO_HELICOPTER:OnBeforeDeploy(From, Event, To, Coordinate, Speed)

Deploy Handler OnBefore for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER:OnBeforePickup(From, Event, To, Coordinate)

Pickup Handler OnBefore for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER:Pickup(Coordinate, Speed)

Pickup Trigger for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER.PickupZone

AI_CARGO_HELICOPTER.RouteDeploy

AI_CARGO_HELICOPTER.RouteHome

AI_CARGO_HELICOPTER.RoutePickup

AI_CARGO_HELICOPTER:SetCarrier(Helicopter)

Set the Carrier.

AI_CARGO_HELICOPTER:SetLandingSpeedAndHeight(speed, height)

Set landingspeed and -height for helicopter landings.

AI_CARGO_HELICOPTER.Zone

AI_CARGO_HELICOPTER:_Deploy(AICargoHelicopter, Coordinate, DeployZone)

Depoloy function and queue.

AI_CARGO_HELICOPTER.__Deploy(Delay, self, Coordinate, Speed)

Deploy Asynchronous Trigger for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER.__Home(Delay, self, Coordinate, Speed, Height)

Home Asynchronous Trigger for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER:__Pickup(Delay, Coordinate, Speed)

Pickup Asynchronous Trigger for AI_CARGO_HELICOPTER

AI_CARGO_HELICOPTER.landingheight

AI_CARGO_HELICOPTER.landingspeed

AI_CARGO_HELICOPTER:onafterDeploy(Helicopter, From, Event, To, Coordinate, Speed, Height, DeployZone)

On after Deploy event.

AI_CARGO_HELICOPTER:onafterDeployed(Helicopter, From, Event, To, Cargo, Deployed, DeployZone)

On after Deployed event.

AI_CARGO_HELICOPTER:onafterHome(Helicopter, From, Event, To, Coordinate, Speed, Height, HomeZone)

On after Home event.

AI_CARGO_HELICOPTER:onafterLanded(Helicopter, From, Event, To)

AI_CARGO_HELICOPTER:onafterOrbit(Helicopter, From, Event, To, Coordinate)

AI_CARGO_HELICOPTER:onafterPickup(Helicopter, From, Event, To, Coordinate, Speed, Height, PickupZone)

On after Pickup event.

AI_CARGO_HELICOPTER:onafterQueue(Helicopter, From, Event, To, Coordinate, Speed, DeployZone)

Field(s)

Function(s)

Deploy Trigger for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Place at which the cargo is deployed.

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

Home Trigger for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Place to which the helicopter will go.

#number Speed

(optional) Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

#number Height

(optional) Height the Helicopter should be flying at.

Creates a new AI_CARGO_HELICOPTER object.

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Wrapper.Group#GROUP Helicopter

Return value:

Deploy Handler OnAfter for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#string From

#string Event

#string To

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

Deployed Handler OnAfter for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#string From

#string Event

#string To

PickedUp Handler OnAfter for AI_CARGO_HELICOPTER - Cargo set has been picked up, ready to deploy

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Wrapper.Group#GROUP Helicopter

The helicopter #GROUP object

#string From

#string Event

#string To

The helicopter #UNIT object

Pickup Handler OnAfter for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#string From

#string Event

#string To

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

Unloaded Handler OnAfter for AI_CARGO_HELICOPTER - Cargo unloaded, carrier is empty

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#string From

#string Event

#string To

The #CARGO_GROUP object.

The helicopter #UNIT object

Deploy Handler OnBefore for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#string From

#string Event

#string To

Place at which cargo is deployed.

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

Return value:

#boolean:

Pickup Handler OnBefore for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#string From

#string Event

#string To

Return value:

#boolean:

Pickup Trigger for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

Set the Carrier.

Defined in:

AI_CARGO_HELICOPTER

Parameter:

Wrapper.Group#GROUP Helicopter

Return value:

Set landingspeed and -height for helicopter landings.

Adjust after tracing if your helis get stuck after landing.

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#number speed

Landing speed in kph(!), e.g. 15

#number height

Landing height in meters(!), e.g. 5.5

Return value:

Usage:

If your choppers get stuck, add tracing to your script to determine if they hit the right parameters like so:
   
       BASE:TraceOn()
       BASE:TraceClass("AI_CARGO_HELICOPTER")
       
Watch the DCS.log for entries stating `Helicopter:<name>, Height = Helicopter:<number>, Velocity = Helicopter:<number>`
Adjust if necessary.

Depoloy function and queue.

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Wrapper.Group#GROUP AICargoHelicopter

Coordinate

DeployZone

Deploy Asynchronous Trigger for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#number Delay

Delay in seconds.

Place at which the cargo is deployed.

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

Home Asynchronous Trigger for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#number Delay

Delay in seconds.

Place to which the helicopter will go.

#number Speed

(optional) Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

#number Height

(optional) Height the Helicopter should be flying at.

Pickup Asynchronous Trigger for AI_CARGO_HELICOPTER

Defined in:

AI_CARGO_HELICOPTER

Parameters:

#number Delay

Delay in seconds.

#number Speed

Speed in km/h to go to the pickup coordinate. Default is 50% of max possible speed the unit can go.

On after Deploy event.

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Wrapper.Group#GROUP Helicopter

Transport helicopter.

From

Event

To

Place at which the cargo is deployed.

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

#number Height

Height in meters to move to the deploy coordinate.

DeployZone

On after Deployed event.

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Wrapper.Group#GROUP Helicopter

#string From

From state.

#string Event

Event.

#string To

To state.

Cargo object.

#boolean Deployed

Cargo is deployed.

DeployZone

Return value:

#boolean:

True if all cargo has been unloaded.

On after Home event.

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Wrapper.Group#GROUP Helicopter

From

Event

To

Home place.

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

#number Height

Height in meters to move to the home coordinate.

Core.Zone#ZONE HomeZone

The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE.

@param #AI_CARGO_HELICOPTER self @param Wrapper.Group#GROUP Helicopter @param From @param Event @param To

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Helicopter

From

Event

To

@param #AI_CARGO_HELICOPTER self @param Wrapper.Group#GROUP Helicopter @param From @param Event @param To @param Core.Point#COORDINATE Coordinate @param #number Speed

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Helicopter

From

Event

To

Coordinate

On after Pickup event.

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Wrapper.Group#GROUP Helicopter

From

Event

To

Pickup place.

#number Speed

Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go.

#number Height

Height in meters to move to the pickup coordinate. This parameter is ignored for APCs.

Core.Zone#ZONE PickupZone

(optional) The zone where the cargo will be picked up. The PickupZone can be nil, if there wasn't any PickupZoneSet provided.

@param #AI_CARGO_HELICOPTER self @param Wrapper.Group#GROUP Helicopter @param From @param Event @param To @param Core.Point#COORDINATE Coordinate @param #number Speed

Defined in:

AI_CARGO_HELICOPTER

Parameters:

Helicopter

From

Event

To

Coordinate

Speed

DeployZone