# Module `TASK`

The TASK Classes define major end-to-end activities within a MISSION.

The TASK Class is the Master Class to orchestrate these activities. From this class, many concrete TASK classes are inherited.

## Global(s)

TASK |

## Type `TASK`

TASK.ActiveStage |
TASK.AddFlareBlue(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, a BLUE FLARE will be fired by an optional SignalUnitNames.
TASK.AddFlareGreen(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, a GREEN FLARE will be fired by an optional SignalUnitNames.
TASK.AddFlareOrange(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, an ORANGE FLARE will be fired by an optional SignalUnitNames.
TASK.AddFlareRed(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, a RED FLARE will be fired by an optional SignalUnitNames.
TASK.AddFlareWhite(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, a WHITE FLARE will be fired by an optional SignalUnitNames.
TASK.AddGoalCompletion(string, string, number, self, GoalVerb, GoalTask, GoalIncrease) | Adds an Additional Goal for the TASK to be achieved.
TASK:AddSignal(SignalUnitNames, SignalType, SignalColor, SignalHeight) | Work function to set signal events within a TASK.
TASK.AddSmokeBlue(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, a BLUE SMOKE will be fired by an optional SignalUnitNames.
TASK.AddSmokeGreen(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, a GREEN SMOKE will be fired by an optional SignalUnitNames.
TASK.AddSmokeOrange(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, an ORANGE SMOKE will be fired by an optional SignalUnitNames.
TASK.AddSmokeRed(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, a RED SMOKE will be fired by an optional SignalUnitNames.
TASK.AddSmokeWhite(table, number, self, SignalUnitNames, SignalHeight) | When the CLIENT is approaching the landing zone, a WHITE SMOKE will be fired by an optional SignalUnitNames.
TASK.Cargos |
TASK.ClassName |
TASK:Done() | Sets a TASK to status Done.
TASK:Failed() | Sets a TASK to status failed.
TASK.GetGoalCompletion(?, self, GoalVerb) | Returns if the additional Goal for the TASK was completed.
TASK.GetGoalCount(?, self, GoalVerb) | Gets the total of Goals currently achieved within the TASK of the GoalVerb.
TASK.GetGoalPercentage(?, self, GoalVerb) | Gets the percentage of Goals currently achieved within the TASK of the GoalVerb.
TASK:GetGoalProgress() | Get progress of a TASK.
TASK.GetGoalTotal(?, self, GoalVerb) | Gets the total of Goals to be achieved within the TASK of the GoalVerb.
TASK:GetGoals() | Returns the Goals of a TASK
TASK:Goal(GoalVerb) | Returns if a TASK has Goal(s).
TASK.GoalTasks |
TASK.IncreaseGoalCount(number, ?, self, GoalCountIncrease, GoalVerb) | Increments the total of Goals currently achieved within the TASK of the GoalVerb, with the given GoalCountIncrease.
TASK:Init() |
TASK:IsDone() | Returns if a TASK is done.
TASK:IsFailed() | Returns if a TASk has failed.
TASK:IsGoalReached() | Returns if all the Goals of the TASK were achieved.
TASK.LandingZones |
TASK.MenuAction(Parameter) |
TASK.Mission |
TASK.Name |
TASK:New() | Instantiates a new TASK Base.
TASK:Reset(Mission, Client) |
TASK.SIGNAL |
TASK.SetGoalCount(number, ?, self, GoalCount, GoalVerb) | Sets the total of Goals currently achieved within the TASK of the GoalVerb.
TASK.SetGoalTotal(number, ?, self, GoalTotal, GoalVerb) | Sets the total Goals to be achieved of the Goal Name
TASK:SetStage(StageSequenceIncrement) |
TASK.ShowGoalProgress(MISSION, CLIENT, self, Mission, Client) | Show progress of a TASK.
TASK.Stage |
TASK:StageExecute() |
TASK.Stages |
TASK.TaskDone |
TASK.TaskFailed |

## Global(s)

#TASK TASK

## Type `TASK`

The TASK class

### Field(s)

#number TASK.ActiveStage

TASK.AddFlareBlue(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, a BLUE FLARE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddFlareGreen(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, a GREEN FLARE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddFlareOrange(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, an ORANGE FLARE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddFlareRed(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, a RED FLARE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddFlareWhite(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, a WHITE FLARE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddGoalCompletion(string, string, number, self, GoalVerb, GoalTask, GoalIncrease)

  Adds an Additional Goal for the TASK to be achieved.

  ### Parameters

  - `string` : GoalVerb is the name of the Goal of the TASK.

  - `string` : GoalTask is a text describing the Goal of the TASK to be achieved.

  - `number` : GoalIncrease is a number by which the Goal achievement is increasing.

  - `self` :

  - `GoalVerb` :

  - `GoalTask` :

  - `GoalIncrease` :

TASK:AddSignal(SignalUnitNames, SignalType, SignalColor, SignalHeight)

  Work function to set signal events within a TASK.

  ### Parameters

  - `SignalUnitNames` :

  - `SignalType` :

  - `SignalColor` :

  - `SignalHeight` :

TASK.AddSmokeBlue(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, a BLUE SMOKE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddSmokeGreen(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, a GREEN SMOKE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddSmokeOrange(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, an ORANGE SMOKE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddSmokeRed(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, a RED SMOKE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.AddSmokeWhite(table, number, self, SignalUnitNames, SignalHeight)

  When the CLIENT is approaching the landing zone, a WHITE SMOKE will be fired by an optional SignalUnitNames.

  ### Parameters

  - `table` : string SignalUnitNames Name of the Group that will fire the signal. If this parameter is NIL, the signal will be fired from the center of the landing zone.

  - `number` : SignalHeight Altitude that the Signal should be fired...

  - `self` :

  - `SignalUnitNames` :

  - `SignalHeight` :

TASK.Cargos

#string TASK.ClassName

TASK:Done()

  Sets a TASK to status Done.

TASK:Failed()

  Sets a TASK to status failed.

TASK.GetGoalCompletion(?, self, GoalVerb)

  Returns if the additional Goal for the TASK was completed.

  ### Parameters

  - `?` : tring GoalVerb is the name of the Goal of the TASK. If the GoalVerb is not given, then the default TASK Goals will be used.

  - `self` :

  - `GoalVerb` :

  ### Return value

  string Goals

TASK.GetGoalCount(?, self, GoalVerb)

  Gets the total of Goals currently achieved within the TASK of the GoalVerb.

  ### Parameters

  - `?` : tring GoalVerb is the name of the Goal of the TASK. If the GoalVerb is not given, then the default TASK Goals will be used.

  - `self` :

  - `GoalVerb` :

  ### Return value

  TASK

TASK.GetGoalPercentage(?, self, GoalVerb)

  Gets the percentage of Goals currently achieved within the TASK of the GoalVerb.

  ### Parameters

  - `?` : tring GoalVerb is the name of the Goal of the TASK. If the GoalVerb is not given, then the default TASK Goals will be used.

  - `self` :

  - `GoalVerb` :

  ### Return value

  TASK

TASK:GetGoalProgress()

  Get progress of a TASK.

  ### Return value

  string GoalsText

TASK.GetGoalTotal(?, self, GoalVerb)

  Gets the total of Goals to be achieved within the TASK of the GoalVerb.

  ### Parameters

  - `?` : tring GoalVerb is the name of the Goal of the TASK. If the GoalVerb is not given, then the default TASK Goals will be used.

  - `self` :

  - `GoalVerb` :

TASK:GetGoals()

  Returns the Goals of a TASK

  ### Return value

  @table Goals

TASK:Goal(GoalVerb)

  Returns if a TASK has Goal(s).

  ### Parameter

  - `#string GoalVerb` : is the name of the Goal of the TASK.

  ### Return value

  bool

TASK.GoalTasks

TASK.IncreaseGoalCount(number, ?, self, GoalCountIncrease, GoalVerb)

  Increments the total of Goals currently achieved within the TASK of the GoalVerb, with the given GoalCountIncrease.

  ### Parameters

  - `number` : GoalCountIncrease is the number of new Goals achieved within the TASK.

  - `?` : tring GoalVerb is the name of the Goal of the TASK. If the GoalVerb is not given, then the default TASK Goals will be used.

  - `self` :

  - `GoalCountIncrease` :

  - `GoalVerb` :

  ### Return value

  TASK

TASK:Init()

TASK:IsDone()

  Returns if a TASK is done.

  ### Return value

  bool

TASK:IsFailed()

  Returns if a TASk has failed.

  ### Return value

  bool

TASK:IsGoalReached()

  Returns if all the Goals of the TASK were achieved.

  ### Return value

  bool

TASK.LandingZones

TASK.MenuAction(Parameter)

  ### Parameter

  - `Parameter` :

TASK.Mission

#string TASK.Name

TASK:New()

  Instantiates a new TASK Base.

  Should never be used. Interface Class.

  ### Return value

  TASK

TASK:Reset(Mission, Client)

  ### Parameters

  - `Mission` :

  - `Client` :

TASK.SIGNAL

  Defines the different signal types with a Task.

TASK.SetGoalCount(number, ?, self, GoalCount, GoalVerb)

  Sets the total of Goals currently achieved within the TASK of the GoalVerb.

  ### Parameters

  - `number` : GoalCount is the total number of Goals achieved within the TASK.

  - `?` : tring GoalVerb is the name of the Goal of the TASK. If the GoalVerb is not given, then the default TASK Goals will be used.

  - `self` :

  - `GoalCount` :

  - `GoalVerb` :

  ### Return value

  TASK

TASK.SetGoalTotal(number, ?, self, GoalTotal, GoalVerb)

  Sets the total Goals to be achieved of the Goal Name

  ### Parameters

  - `number` : GoalTotal is the number of times the GoalVerb needs to be achieved.

  - `?` : tring GoalVerb is the name of the Goal of the TASK. If the GoalVerb is not given, then the default TASK Goals will be used.

  - `self` :

  - `GoalTotal` :

  - `GoalVerb` :

TASK:SetStage(StageSequenceIncrement)

  ### Parameter

  - `StageSequenceIncrement` :

TASK.ShowGoalProgress(MISSION, CLIENT, self, Mission, Client)

  Show progress of a TASK.

  ### Parameters

  - `MISSION` :

        Mission         Group structure describing the Mission.

  - `CLIENT` : Client Group structure describing the Client.

  - `self` :

  - `Mission` :

  - `Client` :

TASK.Stage

TASK:StageExecute()

TASK.Stages

#boolean TASK.TaskDone

#boolean TASK.TaskFailed