Module Account

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


#ACT_ACCOUNT FSM class, extends Fsm#FSM_PROCESS

ACT_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.

ACT_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.

ACT_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.

ACT_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.

ACT_ACCOUNT 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:

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

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

1) #ACTACCOUNTDEADS FSM class, extends Fsm.Account#ACT_ACCOUNT

The ACTACCOUNTDEADS 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.

ACTACCOUNTDEADS constructor:


Global(s)

ACT_ACCOUNT
ACT_ACCOUNT_DEADS

Type ACT_ACCOUNT

ACT_ACCOUNT.ClassName
ACT_ACCOUNT.DisplayCount
ACT_ACCOUNT:New()

Creates a new DESTROY process.

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

StateMachine callback function

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

StateMachine callback function

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

StateMachine callback function

Type ACT_ACCOUNT_DEADS

ACT_ACCOUNT_DEADS.ClassName
ACT_ACCOUNT_DEADS.DisplayCategory
ACT_ACCOUNT_DEADS.DisplayCount
ACT_ACCOUNT_DEADS.DisplayInterval
ACT_ACCOUNT_DEADS.DisplayMessage
ACT_ACCOUNT_DEADS.DisplayTime
ACT_ACCOUNT_DEADS:Init(FsmAccount)
ACT_ACCOUNT_DEADS:New(TargetSetUnit, TaskName)

Creates a new DESTROY process.

ACT_ACCOUNT_DEADS.TargetSetUnit
ACT_ACCOUNT_DEADS.TaskName
ACT_ACCOUNT_DEADS:_Destructor()
ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To, EventData)

StateMachine callback function

ACT_ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To, EventData)

StateMachine callback function

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

StateMachine callback function

ACT_ACCOUNT_DEADS:onfuncEventDead(EventData)

Global(s)

#ACT_ACCOUNT ACT_ACCOUNT
#ACT_ACCOUNT_DEADS ACT_ACCOUNT_DEADS

Type Account

Type ACT_ACCOUNT

ACT_ACCOUNT class

Field(s)

#string ACT_ACCOUNT.ClassName
#number ACT_ACCOUNT.DisplayCount
ACT_ACCOUNT:New()

Creates a new DESTROY process.

Return value

#ACT_ACCOUNT:

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

StateMachine callback function

Parameters

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

StateMachine callback function

Parameters

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

StateMachine callback function

Parameters

Type ACT_ACCOUNT_DEADS

ACTACCOUNTDEADS class

Field(s)

#string ACT_ACCOUNT_DEADS.ClassName
#string ACT_ACCOUNT_DEADS.DisplayCategory

Targets is the default display category

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

10 seconds is the default

ACT_ACCOUNT_DEADS:Init(FsmAccount)

Parameter

  • FsmAccount :

ACT_ACCOUNT_DEADS:New(TargetSetUnit, TaskName)

Creates a new DESTROY process.

Parameters

Set#SET_UNIT ACT_ACCOUNT_DEADS.TargetSetUnit
ACT_ACCOUNT_DEADS.TaskName
ACT_ACCOUNT_DEADS:_Destructor()
ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To, EventData)

StateMachine callback function

Parameters

ACT_ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To, EventData)

StateMachine callback function

Parameters

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

StateMachine callback function

Parameters

ACT_ACCOUNT_DEADS:onfuncEventDead(EventData)

Parameter