Module CargoCrate

Cargo -- Management of single cargo crates, which are based on a Static object.

The cargo can only be slingloaded.


Banner Image


Demo Missions

YouTube Playlist


Author: FlightControl

Contributions:


Global(s)

CARGO_SLINGLOAD

CARGO_CRATE class, extends #CARGO_REPRESENTABLE

The CARGO_CRATE class defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.

Type CARGO_SLINGLOAD

CARGO_SLINGLOAD:CanBoard()

Check if the cargo can be Boarded.

CARGO_SLINGLOAD:CanLoad()

Check if the cargo can be Loaded.

CARGO_SLINGLOAD:CanUnboard()

Check if the cargo can be Unboarded.

CARGO_SLINGLOAD:CanUnload()

Check if the cargo can be Unloaded.

CARGO_SLINGLOAD.CargoCarrier
CARGO_SLINGLOAD.CargoObject
CARGO_SLINGLOAD:GetCoordinate()

Get the current Coordinate of the CargoGroup.

CARGO_SLINGLOAD:GetTransportationMethod()

Get the transportation method of the Cargo.

CARGO_SLINGLOAD:IsAlive()

Check if the CargoGroup is alive.

CARGO_SLINGLOAD:IsInLoadRadius(Coordinate)

Check if Cargo Slingload is in the radius for the Cargo to be Boarded or Loaded.

CARGO_SLINGLOAD:IsInReportRadius(Coordinate)

Check if Cargo Crate is in the radius for the Cargo to be reported.

CARGO_SLINGLOAD:IsNear(CargoCarrier, NearRadius)

Check if Cargo is near to the Carrier.

CARGO_SLINGLOAD:New(CargoStatic, Type, Name, LoadRadius, NearRadius)

CARGO_SLINGLOAD Constructor.

CARGO_SLINGLOAD:OnEventCargoDead(EventData)
CARGO_SLINGLOAD:Respawn()

Respawn the CargoGroup.

CARGO_SLINGLOAD:RouteTo(Coordinate)

Route Cargo to Coordinate and randomize locations.

CARGO_SLINGLOAD:onafterReset()

Respawn the CargoGroup.

Global(s)

#CARGO_SLINGLOAD CARGO_SLINGLOAD

CARGO_CRATE class, extends #CARGO_REPRESENTABLE

The CARGO_CRATE class defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.


Type CargoCrate

Type CARGO

Type CARGO_SLINGLOAD

Extends Cargo.Cargo#CARGO_REPRESENTABLE

Models the behaviour of cargo crates, which can only be slingloaded.

Field(s)

CARGO_SLINGLOAD:CanBoard()

Check if the cargo can be Boarded.

CARGO_SLINGLOAD:CanLoad()

Check if the cargo can be Loaded.

CARGO_SLINGLOAD:CanUnboard()

Check if the cargo can be Unboarded.

CARGO_SLINGLOAD:CanUnload()

Check if the cargo can be Unloaded.

CARGO_SLINGLOAD.CargoCarrier
CARGO_SLINGLOAD.CargoObject
CARGO_SLINGLOAD:GetCoordinate()

Get the current Coordinate of the CargoGroup.

Return values

  1. Core.Point#COORDINATE: The current Coordinate of the first Cargo of the CargoGroup.

  2. #nil: There is no valid Cargo in the CargoGroup.

CARGO_SLINGLOAD:GetTransportationMethod()

Get the transportation method of the Cargo.

Return value

#string: The transportation method of the Cargo.

CARGO_SLINGLOAD:IsAlive()

Check if the CargoGroup is alive.

Return values

  1. #boolean: true if the CargoGroup is alive.

  2. #boolean: false if the CargoGroup is dead.

CARGO_SLINGLOAD:IsInLoadRadius(Coordinate)

Check if Cargo Slingload is in the radius for the Cargo to be Boarded or Loaded.

Parameter

Return value

#boolean: true if the Cargo Slingload is within the loading radius.

CARGO_SLINGLOAD:IsInReportRadius(Coordinate)

Check if Cargo Crate is in the radius for the Cargo to be reported.

Parameter

Return value

#boolean: true if the Cargo Crate is within the report radius.

CARGO_SLINGLOAD:IsNear(CargoCarrier, NearRadius)

Check if Cargo is near to the Carrier.

The Cargo is near to the Carrier within NearRadius.

Parameters

Return values

  1. #boolean: The Cargo is near to the Carrier.

  2. #nil: The Cargo is not near to the Carrier.

CARGO_SLINGLOAD:New(CargoStatic, Type, Name, LoadRadius, NearRadius)

CARGO_SLINGLOAD Constructor.

Parameters

  • Wrapper.Static#STATIC CargoStatic :

  • #string Type :

  • #string Name :

  • #number LoadRadius : (optional)

  • #number NearRadius : (optional)

Return value

#CARGO_SLINGLOAD:

CARGO_SLINGLOAD:OnEventCargoDead(EventData)

Parameter

CARGO_SLINGLOAD:Respawn()

Respawn the CargoGroup.

CARGO_SLINGLOAD:RouteTo(Coordinate)

Route Cargo to Coordinate and randomize locations.

Parameter

CARGO_SLINGLOAD:onafterReset()

Respawn the CargoGroup.