Module Account

(SP) (MP) (FSM) Account for (Detect, count and report) DCS events occuring on DCS objects (units).


#ACCOUNT FSM class, extends Process#PROCESS

ACCOUNT state machine:

This class is a state machine: it manages a process that is triggered by events causing state transitions to occur. All derived classes from this class will start with the class name, followed by a _. See the relevant derived class descriptions below. Each derived class follows exactly the same process, using the same events and following the same state transitions, but will have different implementation behaviour upon each event or state transition.

ACCOUNT Events:

These are the events defined in this class:

  • Start: The process is started. The process will go into the Report state.
  • Event: A relevant event has occured that needs to be accounted for. The process will go into the Account state.
  • Report: The process is reporting to the player the accounting status of the DCS events.
  • More: There are more DCS events that need to be accounted for. The process will go back into the Report state.
  • NoMore: There are no more DCS events that need to be accounted for. The process will go into the Success state.

ACCOUNT Event methods:

Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process. There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:

  • Immediate: The event method has exactly the name of the event.
  • Delayed: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed.

ACCOUNT States:

  • Assigned: The player is assigned to the task. This is the initialization state for the process.
  • Waiting: the process is waiting for a DCS event to occur within the simulator. This state is set automatically.
  • Report: The process is Reporting to the players in the group of the unit. This state is set automatically every 30 seconds.
  • Account: The relevant DCS event has occurred, and is accounted for.
  • Success (*): All DCS events were accounted for.
  • Failed (*): The process has failed.

(*) End states of the process.

ACCOUNT state transition functions:

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 functions will be called by the state machine:

  • Before the state transition. The state transition function needs to start with the name OnBefore + the name of the state. If the state transition function 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!

  • After the state transition. The state transition function needs to start with the name OnAfter + the name of the state. These state transition functions need to provide a return value, which is specified at the function description.

1) #ACCOUNT_DEADS FSM class, extends Account#ACCOUNT

The ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units. The process is given a Set of units that will be tracked upon successful destruction. The process will end after each target has been successfully destroyed. Each successful dead will trigger an Account state transition that can be scored, modified or administered.

ACCOUNT_DEADS constructor:


Global(s)

ACCOUNT
ACCOUNT_DEADS

Type ACCOUNT

ACCOUNT.ClassName
ACCOUNT.DisplayCategory
ACCOUNT.DisplayCount
ACCOUNT.DisplayInterval
ACCOUNT.DisplayMessage
ACCOUNT.DisplayTime
ACCOUNT:New(ProcessUnit)

Creates a new DESTROY process.

ACCOUNT.TargetSetUnit
ACCOUNT:onafterEvent(ProcessUnit, Event, From, To)

StateMachine callback function

ACCOUNT:onafterStart(ProcessUnit, Event, From, To)

StateMachine callback function

ACCOUNT:onenterWaiting(ProcessUnit, Event, From, To)

StateMachine callback function

Type ACCOUNT_DEADS

ACCOUNT_DEADS.ClassName
ACCOUNT_DEADS:EventDead(Event)
ACCOUNT_DEADS:New(ProcessUnit, TargetSetUnit, TaskName)

Creates a new DESTROY process.

ACCOUNT_DEADS.TargetSetUnit
ACCOUNT_DEADS.TaskName
ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To)

StateMachine callback function

ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To)

StateMachine callback function

ACCOUNT_DEADS:onenterReport(ProcessUnit, Event, From, To)

StateMachine callback function

Global(s)

#ACCOUNT ACCOUNT
#ACCOUNT_DEADS ACCOUNT_DEADS

Type Account

Type ACCOUNT

ACCOUNT class

Field(s)

#string ACCOUNT.ClassName
#string ACCOUNT.DisplayCategory

Targets is the default display category

#number ACCOUNT.DisplayCount
#number ACCOUNT.DisplayInterval
#boolean ACCOUNT.DisplayMessage
#number ACCOUNT.DisplayTime

10 seconds is the default

ACCOUNT:New(ProcessUnit)

Creates a new DESTROY process.

Parameter

Return value

#ACCOUNT:

Set#SET_UNIT ACCOUNT.TargetSetUnit
ACCOUNT:onafterEvent(ProcessUnit, Event, From, To)

StateMachine callback function

Parameters

ACCOUNT:onafterStart(ProcessUnit, Event, From, To)

StateMachine callback function

Parameters

ACCOUNT:onenterWaiting(ProcessUnit, Event, From, To)

StateMachine callback function

Parameters

Type ACCOUNT_DEADS

ACCOUNT_DEADS class

Field(s)

#string ACCOUNT_DEADS.ClassName
ACCOUNT_DEADS:EventDead(Event)

Parameter

ACCOUNT_DEADS:New(ProcessUnit, TargetSetUnit, TaskName)

Creates a new DESTROY process.

Parameters

Return value

#ACCOUNT_DEADS: self

Set#SET_UNIT ACCOUNT_DEADS.TargetSetUnit
ACCOUNT_DEADS.TaskName
ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To)

StateMachine callback function

Parameters

ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To)

StateMachine callback function

Parameters

ACCOUNT_DEADS:onenterReport(ProcessUnit, Event, From, To)

StateMachine callback function

Parameters

Type ASSIGN_MENU_ACCEPT