Module Task_CARGO

Tasking (Release 2.1) -- The TASK_CARGO models tasks for players to transport Cargo.

Banner Image


Cargo are units or cargo objects within DCS world that allow to be transported or sling loaded by other units. The CARGO class, as part of the moose core, is able to Board, Load, UnBoard and UnLoad from Carrier units. This collection of classes in this module define tasks for human players to handle cargo objects. Cargo can be transported, picked-up, deployed and sling-loaded from and to other places.

The following classes are important to consider:

  • #TASKCARGOTRANSPORT: Defines a task for a human player to transport a set of cargo between various zones.

==

API CHANGE HISTORY

The underlying change log documents the API changes. Please read this carefully. The following notation is used:

  • Added parts are expressed in bold type face.
  • Removed parts are expressed in italic type face.

Hereby the change log:

2017-03-09: Revised version.


AUTHORS and CONTRIBUTIONS

Contributions:

Authors:

  • FlightControl: Concept, Design & Programming.

Global(s)

TASK_CARGO

TASK_CARGO class, extends Task#TASK

The TASK_CARGO class defines Cargo transport tasks, based on the tasking capabilities defined in Task#TASK.

TASK_CARGO_TRANSPORT

Type FSM_PROCESS

FSM_PROCESS.Cargo
FSM_PROCESS.DeployZone

Type TASK_CARGO

TASK_CARGO:AddDeployZone(DeployZone, TaskUnit)
TASK_CARGO.DeployZones
TASK_CARGO:GetPlannedMenuText()
TASK_CARGO:GetTargetZone(TaskUnit)
TASK_CARGO:New(Mission, SetGroup, TaskName, SetCargo, TaskType)

Instantiates a new TASK_CARGO.

TASK_CARGO:RemoveDeployZone(DeployZone, TaskUnit)
TASK_CARGO.SetCargo
TASK_CARGO:SetCargoPickup(Cargo, TaskUnit)
TASK_CARGO:SetDeployZone(DeployZone, TaskUnit)
TASK_CARGO:SetDeployZones(@, TaskUnit, DeployZones)
TASK_CARGO:SetPenaltyOnFailed(Text, Penalty, TaskUnit)

Set a penalty when the A2G attack has failed.

TASK_CARGO:SetScoreOnDestroy(Text, Score, TaskUnit)

Set a score when a target in scope of the A2G attack, has been destroyed .

TASK_CARGO:SetScoreOnSuccess(Text, Score, TaskUnit)

Set a score when all the targets in scope of the A2G attack, have been destroyed.

TASK_CARGO.TaskType

Type TASK_CARGO_TRANSPORT

TASK_CARGO_TRANSPORT.ClassName
TASK_CARGO_TRANSPORT:New(Mission, SetGroup, TaskName, SetCargo)

Instantiates a new TASKCARGOTRANSPORT.

Global(s)

#TASK_CARGO TASK_CARGO

TASK_CARGO class, extends Task#TASK

The TASK_CARGO class defines Cargo transport tasks, based on the tasking capabilities defined in Task#TASK.

The TASK_CARGO is implemented using a Statemachine#FSM_TASK, and has the following statuses:

  • None: Start of the process.
  • Planned: The cargo task is planned.
  • Assigned: The cargo task is assigned to a Group#GROUP.
  • Success: The cargo task is successfully completed.
  • Failed: The cargo task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.

1.1) Set the scoring of achievements in a cargo task.

Scoring or penalties can be given in the following circumstances:


#TASK_CARGO_TRANSPORT TASK_CARGO_TRANSPORT

Type Task_CARGO

Type FSM_PROCESS

Field(s)

FSM_PROCESS.Cargo
FSM_PROCESS.DeployZone

Type TASK_CARGO

Field(s)

TASK_CARGO:AddDeployZone(DeployZone, TaskUnit)

Parameters

Return value

#TASK_CARGO:

TASK_CARGO.DeployZones

setmetatable( {}, { __mode = "v" } ) -- weak table on value

TASK_CARGO:GetPlannedMenuText()
TASK_CARGO:GetTargetZone(TaskUnit)

Parameter

Return value

Core.Zone#ZONE_BASE: The Zone object where the Target is located on the map.

TASK_CARGO:New(Mission, SetGroup, TaskName, SetCargo, TaskType)

Instantiates a new TASK_CARGO.

Parameters

  • Tasking.Mission#MISSION Mission :

  • Set#SET_GROUP SetGroup : The set of groups for which the Task can be assigned.

  • #string TaskName : The name of the Task.

  • Core.Set#SET_CARGO SetCargo : The scope of the cargo to be transported.

  • #string TaskType : The type of Cargo task.

Return value

#TASK_CARGO: self

TASK_CARGO:RemoveDeployZone(DeployZone, TaskUnit)

Parameters

Return value

#TASK_CARGO:

TASK_CARGO.SetCargo
TASK_CARGO:SetCargoPickup(Cargo, TaskUnit)

Parameters

Return value

#TASK_CARGO:

TASK_CARGO:SetDeployZone(DeployZone, TaskUnit)

Parameters

Return value

#TASK_CARGO:

TASK_CARGO:SetDeployZones(@, TaskUnit, DeployZones)

Parameters

Return value

#TASK_CARGO:

TASK_CARGO:SetPenaltyOnFailed(Text, Penalty, TaskUnit)

Set a penalty when the A2G attack has failed.

Parameters

  • #string Text : The text to display to the player, when the A2G attack has failed.

  • #number Penalty : The penalty in points.

  • Wrapper.Unit#UNIT TaskUnit :

Return value

#TASK_CARGO:

TASK_CARGO:SetScoreOnDestroy(Text, Score, TaskUnit)

Set a score when a target in scope of the A2G attack, has been destroyed .

Parameters

  • #string Text : The text to display to the player, when the target has been destroyed.

  • #number Score : The score in points.

  • Wrapper.Unit#UNIT TaskUnit :

Return value

#TASK_CARGO:

TASK_CARGO:SetScoreOnSuccess(Text, Score, TaskUnit)

Set a score when all the targets in scope of the A2G attack, have been destroyed.

Parameters

  • #string Text : The text to display to the player, when all targets hav been destroyed.

  • #number Score : The score in points.

  • Wrapper.Unit#UNIT TaskUnit :

Return value

#TASK_CARGO:

TASK_CARGO.TaskType

Type TASK_CARGO_TRANSPORT

The TASKCARGOTRANSPORT class

Field(s)

#string TASK_CARGO_TRANSPORT.ClassName
TASK_CARGO_TRANSPORT:New(Mission, SetGroup, TaskName, SetCargo)

Instantiates a new TASKCARGOTRANSPORT.

Parameters

Return value

#TASKCARGOTRANSPORT: self