Banner Image

Module Cargo.CargoUnit

Cargo -- Management of single cargo logistics, which are based on a Wrapper.Unit object.


Demo Missions

YouTube Playlist


Author: FlightControl

Contributions:


Global(s)

Global CARGO_UNIT

Defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.

#CARGO_UNIT CARGO_UNIT

Defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.

Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGO_UNIT objects to and from carriers. Note that ground forces behave in a group, and thus, act in formation, regardless if one unit is commanded to move.

This class is used in CARGO_GROUP, and is not meant to be used by mission designers individually.


Type(s)

Fields and Methods inherited from CARGO_REPRESENTABLE Description

CARGO_UNIT:Destroy()

CARGO_REPRESENTABLE Destructor.

CARGO_UNIT:MessageToGroup(Message, TaskGroup, Name)

Send a message to a Wrapper.Group through a communication channel near the cargo.

CARGO_UNIT:New(Type, Name, LoadRadius, NearRadius, CargoObject)

CARGO_REPRESENTABLE Constructor.

CARGO_UNIT:RouteTo(ToPointVec2, Speed)

Route a cargo unit to a PointVec2.

CARGO_UNIT.test

Models CARGO in the form of units, which can be boarded, unboarded, loaded, unloaded.

Field(s)

Function(s)

Get the transportation method of the Cargo.

Defined in:

CARGO_UNIT

Return value:

#string:

The transportation method of the Cargo.

CARGO_UNIT Constructor.

Defined in:

CARGO_UNIT

Parameters:

Wrapper.Unit#UNIT CargoUnit

#string Type

#string Name

#number Weight

#number LoadRadius

(optional)

#number NearRadius

(optional)

Return value:

Board Event.

Defined in:

CARGO_UNIT

Parameters:

#string Event

#string From

#string To

Wrapper.Group#GROUP CargoCarrier

#number NearRadius

...

Boarding Event.

Defined in:

CARGO_UNIT

Parameters:

#string Event

#string From

#string To

Wrapper.Client#CLIENT CargoCarrier

#number NearRadius

Default 25 m.

...

UnBoard Event.

Defined in:

CARGO_UNIT

Parameters:

#string Event

#string From

#string To

Core.Point#POINT_VEC2 ToPointVec2

#number NearRadius

(optional) Defaut 100 m.

Loaded State.

Defined in:

CARGO_UNIT

Parameters:

#string Event

#string From

#string To

Wrapper.Unit#UNIT CargoCarrier

Enter UnBoarding State.

Defined in:

CARGO_UNIT

Parameters:

#string Event

#string From

#string To

Core.Point#POINT_VEC2 ToPointVec2

#number NearRadius

(optional) Defaut 25 m.

Enter UnLoaded State.

Defined in:

CARGO_UNIT

Parameters:

#string Event

#string From

#string To

Core

Point#POINT_VEC2

ToPointVec2

Leave UnBoarding State.

Defined in:

CARGO_UNIT

Parameters:

#string Event

#string From

#string To

Core.Point#POINT_VEC2 ToPointVec2

#number NearRadius

(optional) Defaut 100 m.

Field(s)

Function(s)

CARGO_REPRESENTABLE Destructor.

Send a message to a Wrapper.Group through a communication channel near the cargo.

Defined in:

Parameters:

#string Message

#string Name

(optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown.

CARGO_REPRESENTABLE Constructor.

Defined in:

Parameters:

#string Type

#string Name

#number LoadRadius

(optional)

#number NearRadius

(optional)

CargoObject

Return value:

Route a cargo unit to a PointVec2.

Defined in:

Parameters:

Core.Point#POINT_VEC2 ToPointVec2

#number Speed

Return value: