Module Cargo

Core -- Management of CARGO logistics, that can be transported from and to transportation carriers.

Banner Image


Cargo can be of various forms, always are composed out of ONE object ( one unit or one static or one slingload crate ):

  • CARGO_UNIT, represented by a Unit in a singleton Group: Cargo can be represented by a Unit in a Group. a CARGO_UNIT is representable...
  • CARGO_GROUP, represented by a Group. A CARGO_GROUP is reportable...

This module is still under construction, but is described above works already, and will keep working ...


Demo Missions

CARGO Demo Missions source code

CARGO Demo Missions, only for beta testers

ALL Demo Missions pack of the last release


YouTube Channel

CARGO YouTube Channel


Author: Sven Van de Velde (FlightControl)

Contributions:


Global(s)

CARGO

(R2.1) CARGO class, extends Fsm#FSM_PROCESS

The CARGO class defines the core functions that defines a cargo object within MOOSE.

CARGOS
CARGO_CRATE

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.

CARGO_GROUP

CARGO_GROUP class

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

CARGO_PACKAGE
CARGO_REPORTABLE
CARGO_REPRESENTABLE

Models CARGO that is representable by a Unit.

CARGO_UNIT

CARGO_UNIT class, extends #CARGO_REPRESENTABLE

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

Type CARGO

CARGO:Board(ToCarrier, NearRadius)

Boards the cargo to a Carrier.

CARGO.CargoCarrier

The alive DCS object carrying the cargo. This value can be nil, meaning, that the cargo is not contained anywhere...

CARGO.CargoObject

The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...

CARGO.CargoScheduler
CARGO.Containable

This flag defines if the cargo can be contained within a DCS Unit.

CARGO.Deployed
CARGO:Destroy()

Destroy the cargo.

CARGO:Flare(FlareColor)

Signal a flare at the position of the CARGO.

CARGO:FlareGreen()

Signal a green flare at the position of the CARGO.

CARGO:FlareRed()

Signal a red flare at the position of the CARGO.

CARGO:FlareWhite()

Signal a white flare at the position of the CARGO.

CARGO:FlareYellow()

Signal a yellow flare at the position of the CARGO.

CARGO:GetCoordinate()

Get the current coordinates of the Cargo.

CARGO:GetName()

Get the name of the Cargo.

CARGO:GetObjectName()

Get the object name of the Cargo.

CARGO:GetPointVec2()

Get the current PointVec2 of the cargo.

CARGO:GetType()

Get the type of the Cargo.

CARGO:IsAlive()

Check if cargo is alive.

CARGO:IsDeployed()

Is the cargo deployed

CARGO:IsDestroyed()

Check if cargo is destroyed.

CARGO:IsInZone(Zone)

Check if Cargo is the given Zone.

CARGO:IsLoaded()

Check if cargo is loaded.

CARGO:IsNear(PointVec2, NearRadius)

Check if CargoCarrier is near the Cargo to be Loaded.

CARGO:IsUnLoaded()

Check if cargo is unloaded.

CARGO:Load(ToCarrier)

Loads the cargo to a Carrier.

CARGO.Moveable

This flag defines if the cargo is moveable.

CARGO.Name

A string defining the name of the cargo. The name is the unique identifier of the cargo.

CARGO.NearRadius

(optional) A number defining the radius in meters when the cargo is near to a Carrier, so that it can be loaded.

CARGO:New(Type, Name, Weight, NearRadius)

CARGO Constructor.

CARGO:OnEnterBoarding(Controllable, NearRadius)
CARGO:OnEnterLoaded(Controllable)
CARGO:OnEnterUnBoarding(Controllable)
CARGO:OnEnterUnLoaded(Controllable)
CARGO:OnLeaveBoarding(Controllable)
CARGO:OnLeaveLoaded(Controllable)
CARGO:OnLeaveUnBoarding(Controllable)
CARGO:OnLeaveUnLoaded(Controllable)
CARGO.Representable

This flag defines if the cargo can be represented by a DCS Unit.

CARGO:SetDeployed(Deployed)

Set the cargo as deployed

CARGO:SetWeight(Weight)

Set the weight of the cargo.

CARGO.Slingloadable

This flag defines if the cargo can be slingloaded.

CARGO:Smoke(SmokeColor, Range)

Smoke the CARGO.

CARGO:SmokeBlue()

Smoke the CARGO Blue.

CARGO:SmokeGreen()

Smoke the CARGO Green.

CARGO:SmokeOrange()

Smoke the CARGO Orange.

CARGO:SmokeRed()

Smoke the CARGO Red.

CARGO:SmokeWhite()

Smoke the CARGO White.

CARGO:Spawn(PointVec2)

Template method to spawn a new representation of the CARGO in the simulator.

CARGO.Type

A string defining the type of the cargo. eg. Engineers, Equipment, Screwdrivers.

CARGO:UnBoard(ToPointVec2)

UnBoards the cargo to a Carrier.

CARGO:UnLoad(ToPointVec2)

UnLoads the cargo to a Carrier.

CARGO.Weight

A number defining the weight of the cargo. The weight is expressed in kg.

CARGO:__Board(DelaySeconds, ToCarrier, NearRadius)

Boards the cargo to a Carrier.

CARGO:__Load(DelaySeconds, ToCarrier)

Loads the cargo to a Carrier.

CARGO:__UnBoard(DelaySeconds, ToPointVec2)

UnBoards the cargo to a Carrier.

CARGO:__UnLoad(DelaySeconds, ToPointVec2)

UnLoads the cargo to a Carrier.

Type CARGO_CRATE

CARGO_CRATE.CargoCarrier
CARGO_CRATE.CargoObject
CARGO_CRATE:New(CrateName, Type, Name, Weight, ReportRadius, NearRadius, CargoCrateName)

CARGO_CRATE Constructor.

CARGO_CRATE.OnUnLoadedCallBack
CARGO_CRATE:onenterLoaded(Event, From, To, CargoCarrier)

Loaded State.

CARGO_CRATE:onenterUnLoaded(Event, From, To, Core, ToPointVec2)

Enter UnLoaded State.

Type CARGO_GROUP

CARGO_GROUP.CargoCarrier
CARGO_GROUP.CargoGroup
CARGO_GROUP.CargoObject
CARGO_GROUP:GetCount()

Get the amount of cargo units in the group.

CARGO_GROUP:New(CargoGroup, Type, Name, ReportRadius, NearRadius)

CARGO_GROUP constructor.

CARGO_GROUP:OnEventCargoDead(EventData)
CARGO_GROUP:RespawnOnDestroyed(RespawnDestroyed)

Respawn the cargo when destroyed

CARGO_GROUP:onafterBoarding(CargoCarrier, Event, From, To, NearRadius, ...)

Leave Boarding State.

CARGO_GROUP:onafterUnBoarding(ToPointVec2, Event, From, To, NearRadius, ...)

UnBoard Event.

CARGO_GROUP:onenterBoarding(CargoCarrier, Event, From, To, NearRadius, ...)

Enter Boarding State.

CARGO_GROUP:onenterDestroyed()
CARGO_GROUP:onenterLoaded(CargoCarrier, Event, From, To, ...)

Enter Loaded State.

CARGO_GROUP:onenterUnBoarding(ToPointVec2, Event, From, To, NearRadius, ...)

Enter UnBoarding State.

CARGO_GROUP:onenterUnLoaded(Core, Event, From, To, ToPointVec2, ...)

Enter UnLoaded State.

CARGO_GROUP:onleaveUnBoarding(ToPointVec2, Event, From, To, NearRadius, ...)

Leave UnBoarding State.

Type CARGO_PACKAGE

CARGO_PACKAGE.CargoCarrier
CARGO_PACKAGE.CargoInAir
CARGO_PACKAGE.ClassName
CARGO_PACKAGE:IsNear(CargoCarrier)

Check if CargoCarrier is near the Cargo to be Loaded.

CARGO_PACKAGE:New(CargoCarrier, Type, Name, Weight, ReportRadius, NearRadius)

CARGO_PACKAGE Constructor.

CARGO_PACKAGE:onafterLoad(Event, From, To, CargoCarrier, Speed, LoadDistance, Angle)

Load Event.

CARGO_PACKAGE:onafterOnBoard(Event, From, To, CargoCarrier, Speed, BoardDistance, Angle, LoadDistance)

Board Event.

CARGO_PACKAGE:onafterOnBoarded(Event, From, To, CargoCarrier, Speed, BoardDistance, LoadDistance, Angle)

Boarded Event.

CARGO_PACKAGE:onafterUnBoard(Event, From, To, Speed, UnLoadDistance, UnBoardDistance, Radius, Angle, CargoCarrier)

UnBoard Event.

CARGO_PACKAGE:onafterUnBoarded(Event, From, To, CargoCarrier, Speed)

UnBoarded Event.

CARGO_PACKAGE:onafterUnLoad(Event, From, To, Distance, Angle, CargoCarrier, Speed)

UnLoad Event.

Type CARGO_REPORTABLE

CARGO_REPORTABLE.CargoObject
CARGO_REPORTABLE.CargoSet
CARGO_REPORTABLE.ClassName
CARGO_REPORTABLE:GetBoardingRange()

Get the range till cargo will board.

CARGO_REPORTABLE:IsInRadius(PointVec2)

Check if CargoCarrier is in the ReportRadius for the Cargo to be Loaded.

CARGO_REPORTABLE:MessageToGroup(Message, TaskGroup, Name)

Send a CC message to a GROUP.

CARGO_REPORTABLE:New(CargoObject, Type, Name, Weight, ReportRadius, NearRadius)

CARGO_REPORTABLE Constructor.

CARGO_REPORTABLE.ReportRadius
CARGO_REPORTABLE:Respawn()

Respawn the cargo.

Type CARGO_REPRESENTABLE

CARGO_REPRESENTABLE:Destroy()

CARGO_REPRESENTABLE Destructor.

CARGO_REPRESENTABLE:New(Type, Name, Weight, ReportRadius, NearRadius, CargoObject)

CARGO_REPRESENTABLE Constructor.

CARGO_REPRESENTABLE:RouteTo(ToPointVec2, Speed)

Route a cargo unit to a PointVec2.

CARGO_REPRESENTABLE.test

Type CARGO_UNIT

CARGO_UNIT.CargoCarrier
CARGO_UNIT.CargoInAir
CARGO_UNIT.CargoObject
CARGO_UNIT:New(CargoUnit, Type, Name, Weight, ReportRadius, NearRadius)

CARGO_UNIT Constructor.

CARGO_UNIT.OnUnLoadedCallBack
CARGO_UNIT.RunCount
CARGO_UNIT:onafterBoard(Event, From, To, CargoCarrier, NearRadius, ...)

Board Event.

CARGO_UNIT:onafterBoarding(Event, From, To, CargoCarrier, NearRadius, ...)

Boarding Event.

CARGO_UNIT:onafterUnBoarding(Event, From, To, ToPointVec2, NearRadius)

UnBoard Event.

CARGO_UNIT:onenterBoarding(Event, From, To, CargoCarrier, NearRadius, ...)

Enter Boarding State.

CARGO_UNIT:onenterLoaded(Event, From, To, CargoCarrier)

Loaded State.

CARGO_UNIT:onenterUnBoarding(Event, From, To, ToPointVec2, NearRadius)

Enter UnBoarding State.

CARGO_UNIT:onenterUnLoaded(Event, From, To, Core, ToPointVec2)

Enter UnLoaded State.

CARGO_UNIT:onleaveUnBoarding(Event, From, To, ToPointVec2, NearRadius)

Leave UnBoarding State.

Global(s)

#CARGO CARGO

(R2.1) CARGO class, extends Fsm#FSM_PROCESS

The CARGO class defines the core functions that defines a cargo object within MOOSE.

A cargo is a logical object defined that is available for transport, and has a life status within a simulation.

The CARGO is a state machine: it manages the different events and states of the cargo. All derived classes from CARGO follow the same state machine, expose the same cargo event functions, and provide the same cargo states.

CARGO Events:

  • CARGO.Board( ToCarrier ): Boards the cargo to a carrier.
  • CARGO.Load( ToCarrier ): Loads the cargo into a carrier, regardless of its position.
  • CARGO.UnBoard( ToPointVec2 ): UnBoard the cargo from a carrier. This will trigger a movement of the cargo to the option ToPointVec2.
  • CARGO.UnLoad( ToPointVec2 ): UnLoads the cargo from a carrier.
  • CARGO.Dead( Controllable ): The cargo is dead. The cargo process will be ended.

CARGO States:

  • UnLoaded: The cargo is unloaded from a carrier.
  • Boarding: The cargo is currently boarding (= running) into a carrier.
  • Loaded: The cargo is loaded into a carrier.
  • UnBoarding: The cargo is currently unboarding (=running) from a carrier.
  • Dead: The cargo is dead ...
  • End: The process has come to an end.

CARGO state transition methods:

State transition functions can be set by the mission designer customizing or improving the behaviour of the state. There are 2 moments when state transition methods will be called by the state machine:

  • Leaving the state. The state transition method needs to start with the name OnLeave + the name of the state. If the state transition method returns false, then the processing of the state transition will not be done! If you want to change the behaviour of the AIControllable at this event, return false, but then you'll need to specify your own logic using the AIControllable!

  • Entering the state. The state transition method needs to start with the name OnEnter + the name of the state. These state transition methods need to provide a return value, which is specified at the function description.

CARGOS
#CARGO_CRATE CARGO_CRATE

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.

Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGO_CRATE objects to and from carriers.


#CARGO_GROUP CARGO_GROUP

CARGO_GROUP class

The CARGO_GROUP class defines a cargo that is represented by a Group 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_GROUP to and from carrier.

#CARGO_PACKAGE CARGO_PACKAGE
#CARGO_REPORTABLE CARGO_REPORTABLE
#CARGO_REPRESENTABLE CARGO_REPRESENTABLE

Models CARGO that is representable by a Unit.

#CARGO_UNIT CARGO_UNIT

CARGO_UNIT class, extends #CARGO_REPRESENTABLE

The CARGO_UNIT class 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.


Type Cargo

Type CARGO

Field(s)

CARGO:Board(ToCarrier, NearRadius)

Boards the cargo to a Carrier.

The event will create a movement (= running or driving) of the cargo to the Carrier. The cargo must be in the UnLoaded state.

Parameters

  • Wrapper.Controllable#CONTROLLABLE ToCarrier : The Carrier that will hold the cargo.

  • #number NearRadius : The radius when the cargo will board the Carrier (to avoid collision).

Wrapper.Client#CLIENT CARGO.CargoCarrier

The alive DCS object carrying the cargo. This value can be nil, meaning, that the cargo is not contained anywhere...

Wrapper.Controllable#CONTROLLABLE CARGO.CargoObject

The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...

CARGO.CargoScheduler
#boolean CARGO.Containable

This flag defines if the cargo can be contained within a DCS Unit.

CARGO.Deployed
CARGO:Destroy()

Destroy the cargo.

CARGO:Flare(FlareColor)

Signal a flare at the position of the CARGO.

Parameter

CARGO:FlareGreen()

Signal a green flare at the position of the CARGO.

CARGO:FlareRed()

Signal a red flare at the position of the CARGO.

CARGO:FlareWhite()

Signal a white flare at the position of the CARGO.

CARGO:FlareYellow()

Signal a yellow flare at the position of the CARGO.

CARGO:GetCoordinate()

Get the current coordinates of the Cargo.

Return value

Core.Point#COORDINATE: The coordinates of the Cargo.

CARGO:GetName()

Get the name of the Cargo.

Return value

#string: The name of the Cargo.

CARGO:GetObjectName()

Get the object name of the Cargo.

Return value

#string: The object name of the Cargo.

CARGO:GetPointVec2()

Get the current PointVec2 of the cargo.

Return value

Core.Point#POINT_VEC2:

CARGO:GetType()

Get the type of the Cargo.

Return value

#string: The type of the Cargo.

CARGO:IsAlive()

Check if cargo is alive.

Return value

#boolean: true if unloaded

CARGO:IsDeployed()

Is the cargo deployed

Return value

#boolean:

CARGO:IsDestroyed()

Check if cargo is destroyed.

Return value

#boolean: true if destroyed

CARGO:IsInZone(Zone)

Check if Cargo is the given Zone.

Parameter

Return value

#boolean: true if cargo is in the Zone, false if cargo is not in the Zone.

CARGO:IsLoaded()

Check if cargo is loaded.

Return value

#boolean: true if loaded

CARGO:IsNear(PointVec2, NearRadius)

Check if CargoCarrier is near the Cargo to be Loaded.

Parameters

  • Core.Point#POINT_VEC2 PointVec2 :

  • #number NearRadius : The radius when the cargo will board the Carrier (to avoid collision).

Return value

#boolean:

CARGO:IsUnLoaded()

Check if cargo is unloaded.

Return value

#boolean: true if unloaded

CARGO:Load(ToCarrier)

Loads the cargo to a Carrier.

The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading. The cargo must be in the UnLoaded state.

Parameter

#boolean CARGO.Moveable

This flag defines if the cargo is moveable.

#string CARGO.Name

A string defining the name of the cargo. The name is the unique identifier of the cargo.

#number CARGO.NearRadius

(optional) A number defining the radius in meters when the cargo is near to a Carrier, so that it can be loaded.

CARGO:New(Type, Name, Weight, NearRadius)

CARGO Constructor.

This class is an abstract class and should not be instantiated.

Parameters

  • #string Type :

  • #string Name :

  • #number Weight :

  • #number NearRadius : (optional)

Return value

#CARGO:

CARGO:OnEnterBoarding(Controllable, NearRadius)

Parameters

CARGO:OnEnterLoaded(Controllable)

Parameter

CARGO:OnEnterUnBoarding(Controllable)

Parameter

CARGO:OnEnterUnLoaded(Controllable)

Parameter

CARGO:OnLeaveBoarding(Controllable)

Parameter

Return value

#boolean:

CARGO:OnLeaveLoaded(Controllable)

Parameter

Return value

#boolean:

CARGO:OnLeaveUnBoarding(Controllable)

Parameter

Return value

#boolean:

CARGO:OnLeaveUnLoaded(Controllable)

Parameter

Return value

#boolean:

#boolean CARGO.Representable

This flag defines if the cargo can be represented by a DCS Unit.

CARGO:SetDeployed(Deployed)

Set the cargo as deployed

Parameter

  • Deployed :

CARGO:SetWeight(Weight)

Set the weight of the cargo.

Parameter

  • #number Weight : The weight in kg.

Return value

#CARGO:

#boolean CARGO.Slingloadable

This flag defines if the cargo can be slingloaded.

CARGO:Smoke(SmokeColor, Range)

Smoke the CARGO.

Parameters

  • SmokeColor :

  • Range :

CARGO:SmokeBlue()

Smoke the CARGO Blue.

CARGO:SmokeGreen()

Smoke the CARGO Green.

CARGO:SmokeOrange()

Smoke the CARGO Orange.

CARGO:SmokeRed()

Smoke the CARGO Red.

CARGO:SmokeWhite()

Smoke the CARGO White.

CARGO:Spawn(PointVec2)

Template method to spawn a new representation of the CARGO in the simulator.

Parameter

  • PointVec2 :

Return value

#CARGO:

#string CARGO.Type

A string defining the type of the cargo. eg. Engineers, Equipment, Screwdrivers.

CARGO:UnBoard(ToPointVec2)

UnBoards the cargo to a Carrier.

The event will create a movement (= running or driving) of the cargo from the Carrier. The cargo must be in the Loaded state.

Parameter

  • Core.Point#POINT_VEC2 ToPointVec2 : (optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.

CARGO:UnLoad(ToPointVec2)

UnLoads the cargo to a Carrier.

The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading. The cargo must be in the Loaded state.

Parameter

  • Core.Point#POINT_VEC2 ToPointVec2 : (optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.

#number CARGO.Weight

A number defining the weight of the cargo. The weight is expressed in kg.

CARGO:__Board(DelaySeconds, ToCarrier, NearRadius)

Boards the cargo to a Carrier.

The event will create a movement (= running or driving) of the cargo to the Carrier. The cargo must be in the UnLoaded state.

Parameters

  • #number DelaySeconds : The amount of seconds to delay the action.

  • Wrapper.Controllable#CONTROLLABLE ToCarrier : The Carrier that will hold the cargo.

  • #number NearRadius : The radius when the cargo will board the Carrier (to avoid collision).

CARGO:__Load(DelaySeconds, ToCarrier)

Loads the cargo to a Carrier.

The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading. The cargo must be in the UnLoaded state.

Parameters

CARGO:__UnBoard(DelaySeconds, ToPointVec2)

UnBoards the cargo to a Carrier.

The event will create a movement (= running or driving) of the cargo from the Carrier. The cargo must be in the Loaded state.

Parameters

  • #number DelaySeconds : The amount of seconds to delay the action.

  • Core.Point#POINT_VEC2 ToPointVec2 : (optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.

CARGO:__UnLoad(DelaySeconds, ToPointVec2)

UnLoads the cargo to a Carrier.

The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading. The cargo must be in the Loaded state.

Parameters

  • #number DelaySeconds : The amount of seconds to delay the action.

  • Core.Point#POINT_VEC2 ToPointVec2 : (optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.

Type CARGO.CargoObjects

Type CARGO_CRATE

Models the behaviour of cargo crates, which can be slingloaded and boarded on helicopters using the DCS menus.

Field(s)

CARGO_CRATE.CargoCarrier
CARGO_CRATE.CargoObject
CARGO_CRATE:New(CrateName, Type, Name, Weight, ReportRadius, NearRadius, CargoCrateName)

CARGO_CRATE Constructor.

Parameters

  • #string CrateName :

  • #string Type :

  • #string Name :

  • #number Weight :

  • #number ReportRadius : (optional)

  • #number NearRadius : (optional)

  • CargoCrateName :

Return value

#CARGO_CRATE:

CARGO_CRATE.OnUnLoadedCallBack
CARGO_CRATE:onenterLoaded(Event, From, To, CargoCarrier)

Loaded State.

Parameters

CARGO_CRATE:onenterUnLoaded(Event, From, To, Core, ToPointVec2)

Enter UnLoaded State.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • Core : Point#POINT_VEC2

  • ToPointVec2 :

Type CARGO_GROUP

Field(s)

CARGO_GROUP.CargoCarrier

self.CargoObject:Destroy()

CARGO_GROUP.CargoGroup
CARGO_GROUP.CargoObject
CARGO_GROUP:GetCount()

Get the amount of cargo units in the group.

Return value

#CARGO_GROUP:

CARGO_GROUP:New(CargoGroup, Type, Name, ReportRadius, NearRadius)

CARGO_GROUP constructor.

Parameters

  • Wrapper.Group#GROUP CargoGroup :

  • #string Type :

  • #string Name :

  • #number ReportRadius : (optional)

  • #number NearRadius : (optional)

Return value

#CARGO_GROUP:

CARGO_GROUP:OnEventCargoDead(EventData)

Parameter

CARGO_GROUP:RespawnOnDestroyed(RespawnDestroyed)

Respawn the cargo when destroyed

Parameter

  • #boolean RespawnDestroyed :

CARGO_GROUP:onafterBoarding(CargoCarrier, Event, From, To, NearRadius, ...)

Leave Boarding State.

Parameters

  • Wrapper.Unit#UNIT CargoCarrier :

  • #string Event :

  • #string From :

  • #string To :

  • NearRadius :

  • ... :

CARGO_GROUP:onafterUnBoarding(ToPointVec2, Event, From, To, NearRadius, ...)

UnBoard Event.

Parameters

CARGO_GROUP:onenterBoarding(CargoCarrier, Event, From, To, NearRadius, ...)

Enter Boarding State.

Parameters

  • Wrapper.Unit#UNIT CargoCarrier :

  • #string Event :

  • #string From :

  • #string To :

  • NearRadius :

  • ... :

CARGO_GROUP:onenterDestroyed()
CARGO_GROUP:onenterLoaded(CargoCarrier, Event, From, To, ...)

Enter Loaded State.

Parameters

CARGO_GROUP:onenterUnBoarding(ToPointVec2, Event, From, To, NearRadius, ...)

Enter UnBoarding State.

Parameters

CARGO_GROUP:onenterUnLoaded(Core, Event, From, To, ToPointVec2, ...)

Enter UnLoaded State.

Parameters

  • Core : Point#POINT_VEC2

  • #string Event :

  • #string From :

  • #string To :

  • ToPointVec2 :

  • ... :

CARGO_GROUP:onleaveUnBoarding(ToPointVec2, Event, From, To, NearRadius, ...)

Leave UnBoarding State.

Parameters

Type CARGO_PACKAGE

Field(s)

CARGO_PACKAGE.CargoCarrier
CARGO_PACKAGE.CargoInAir
#string CARGO_PACKAGE.ClassName
CARGO_PACKAGE:IsNear(CargoCarrier)

Check if CargoCarrier is near the Cargo to be Loaded.

Parameter

Return value

#boolean:

CARGO_PACKAGE:New(CargoCarrier, Type, Name, Weight, ReportRadius, NearRadius)

CARGO_PACKAGE Constructor.

Parameters

  • Wrapper.Unit#UNIT CargoCarrier : The UNIT carrying the package.

  • #string Type :

  • #string Name :

  • #number Weight :

  • #number ReportRadius : (optional)

  • #number NearRadius : (optional)

Return value

#CARGO_PACKAGE:

CARGO_PACKAGE:onafterLoad(Event, From, To, CargoCarrier, Speed, LoadDistance, Angle)

Load Event.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • Wrapper.Unit#UNIT CargoCarrier :

  • #number Speed :

  • #number LoadDistance :

  • #number Angle :

CARGO_PACKAGE:onafterOnBoard(Event, From, To, CargoCarrier, Speed, BoardDistance, Angle, LoadDistance)

Board Event.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • Wrapper.Unit#UNIT CargoCarrier :

  • #number Speed :

  • #number BoardDistance :

  • #number Angle :

  • LoadDistance :

CARGO_PACKAGE:onafterOnBoarded(Event, From, To, CargoCarrier, Speed, BoardDistance, LoadDistance, Angle)

Boarded Event.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • Wrapper.Unit#UNIT CargoCarrier :

  • Speed :

  • BoardDistance :

  • LoadDistance :

  • Angle :

CARGO_PACKAGE:onafterUnBoard(Event, From, To, Speed, UnLoadDistance, UnBoardDistance, Radius, Angle, CargoCarrier)

UnBoard Event.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • #number Speed :

  • #number UnLoadDistance :

  • #number UnBoardDistance :

  • #number Radius :

  • #number Angle :

  • CargoCarrier :

CARGO_PACKAGE:onafterUnBoarded(Event, From, To, CargoCarrier, Speed)

UnBoarded Event.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • Wrapper.Unit#UNIT CargoCarrier :

  • Speed :

CARGO_PACKAGE:onafterUnLoad(Event, From, To, Distance, Angle, CargoCarrier, Speed)

UnLoad Event.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • #number Distance :

  • #number Angle :

  • CargoCarrier :

  • Speed :

Type CARGO_REPORTABLE

Field(s)

CARGO_REPORTABLE.CargoObject
Core.Set#SET_CARGO CARGO_REPORTABLE.CargoSet
#string CARGO_REPORTABLE.ClassName
CARGO_REPORTABLE:GetBoardingRange()

Get the range till cargo will board.

Return value

#number: The range till cargo will board.

CARGO_REPORTABLE:IsInRadius(PointVec2)

Check if CargoCarrier is in the ReportRadius for the Cargo to be Loaded.

Parameter

Return value

#boolean:

CARGO_REPORTABLE:MessageToGroup(Message, TaskGroup, Name)

Send a CC message to a GROUP.

Parameters

  • #string Message :

  • Wrapper.Group#GROUP TaskGroup :

  • #sring 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_REPORTABLE:New(CargoObject, Type, Name, Weight, ReportRadius, NearRadius)

CARGO_REPORTABLE Constructor.

Parameters

Return value

#CARGO_REPORTABLE:

CARGO_REPORTABLE.ReportRadius
CARGO_REPORTABLE:Respawn()

Respawn the cargo.

Type CARGO_REPRESENTABLE

Field(s)

CARGO_REPRESENTABLE:Destroy()

CARGO_REPRESENTABLE Destructor.

Return value

#CARGO_REPRESENTABLE:

CARGO_REPRESENTABLE:New(Type, Name, Weight, ReportRadius, NearRadius, CargoObject)

CARGO_REPRESENTABLE Constructor.

Parameters

  • #string Type :

  • #string Name :

  • #number Weight :

  • #number ReportRadius : (optional)

  • #number NearRadius : (optional)

  • CargoObject :

Return value

#CARGO_REPRESENTABLE:

CARGO_REPRESENTABLE:RouteTo(ToPointVec2, Speed)

Route a cargo unit to a PointVec2.

Parameters

Return value

#CARGO_REPRESENTABLE:

CARGO_REPRESENTABLE.test

Type CARGO_UNIT

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

Field(s)

CARGO_UNIT.CargoCarrier
CARGO_UNIT.CargoInAir
CARGO_UNIT.CargoObject
CARGO_UNIT:New(CargoUnit, Type, Name, Weight, ReportRadius, NearRadius)

CARGO_UNIT Constructor.

Parameters

  • Wrapper.Unit#UNIT CargoUnit :

  • #string Type :

  • #string Name :

  • #number Weight :

  • #number ReportRadius : (optional)

  • #number NearRadius : (optional)

Return value

#CARGO_UNIT:

CARGO_UNIT.OnUnLoadedCallBack
CARGO_UNIT.RunCount
CARGO_UNIT:onafterBoard(Event, From, To, CargoCarrier, NearRadius, ...)

Board Event.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • CargoCarrier :

  • NearRadius :

  • ... :

CARGO_UNIT:onafterBoarding(Event, From, To, CargoCarrier, NearRadius, ...)

Boarding Event.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • Wrapper.Unit#UNIT CargoCarrier :

  • #number NearRadius :

  • ... :

CARGO_UNIT:onafterUnBoarding(Event, From, To, ToPointVec2, NearRadius)

UnBoard Event.

Parameters

CARGO_UNIT:onenterBoarding(Event, From, To, CargoCarrier, NearRadius, ...)

Enter Boarding State.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • Wrapper.Unit#UNIT CargoCarrier :

  • NearRadius :

  • ... :

CARGO_UNIT:onenterLoaded(Event, From, To, CargoCarrier)

Loaded State.

Parameters

CARGO_UNIT:onenterUnBoarding(Event, From, To, ToPointVec2, NearRadius)

Enter UnBoarding State.

Parameters

CARGO_UNIT:onenterUnLoaded(Event, From, To, Core, ToPointVec2)

Enter UnLoaded State.

Parameters

  • #string Event :

  • #string From :

  • #string To :

  • Core : Point#POINT_VEC2

  • ToPointVec2 :

CARGO_UNIT:onleaveUnBoarding(Event, From, To, ToPointVec2, NearRadius)

Leave UnBoarding State.

Parameters

Type sring