Banner Image

Module Actions.Act_Account

Actions - ACT_ACCOUNT_ classes account for (detect, count & report) various DCS events occurring on UNITs.

Banner Image


Global(s)

Global ACT_ACCOUNT

Global ACT_ACCOUNT_DEADS

Type(s)

Fields and Methods inherited from ACT_ACCOUNT Description

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

Fields and Methods inherited from FSM_PROCESS Description

ACT_ACCOUNT:Assign(Task, ProcessUnit)

Assign the process to a Wrapper.Unit and activate the process.

ACT_ACCOUNT:Copy(Controllable, Task)

Creates a new FSM_PROCESS object based on this FSM_PROCESS.

ACT_ACCOUNT:GetCommandCenter()

Gets the mission of the process.

ACT_ACCOUNT:GetMission()

Gets the mission of the process.

ACT_ACCOUNT:GetTask()

Gets the task of the process.

ACT_ACCOUNT:Init(FsmProcess)

ACT_ACCOUNT:Message(Message)

Send a message of the Tasking.Task to the Group of the Unit.

ACT_ACCOUNT:New(Controllable, Task)

Creates a new FSM_PROCESS object.

ACT_ACCOUNT:Remove()

Removes an FSM_PROCESS object.

ACT_ACCOUNT:SetTask(Task)

Sets the task of the process.

ACT_ACCOUNT.Task

ACT_ACCOUNT:_call_handler(step, trigger, params, EventName)

ACT_ACCOUNT:onenterFailed(ProcessUnit, Task, From, Event, To)

ACT_ACCOUNT:onstatechange(ProcessUnit, Event, From, To, Task)

StateMachine callback function for a FSM_PROCESS

Fields and Methods inherited from FSM_CONTROLLABLE Description

ACT_ACCOUNT.Controllable

ACT_ACCOUNT:GetControllable()

Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.

ACT_ACCOUNT:New(FSMT, Controllable)

Creates a new FSM_CONTROLLABLE object.

ACT_ACCOUNT:OnAfterStop(Controllable, From, Event, To)

OnAfter Transition Handler for Event Stop.

ACT_ACCOUNT:OnBeforeStop(Controllable, From, Event, To)

OnBefore Transition Handler for Event Stop.

ACT_ACCOUNT:OnEnterStopped(Controllable, From, Event, To)

OnEnter Transition Handler for State Stopped.

ACT_ACCOUNT:OnLeaveStopped(Controllable, From, Event, To)

OnLeave Transition Handler for State Stopped.

ACT_ACCOUNT:SetControllable(FSMControllable)

Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.

ACT_ACCOUNT:Stop()

Synchronous Event Trigger for Event Stop.

ACT_ACCOUNT:__Stop(Delay)

Asynchronous Event Trigger for Event Stop.

ACT_ACCOUNT:_call_handler(step, trigger, params, EventName)

Fields and Methods inherited from FSM Description

ACT_ACCOUNT:AddEndState(State)

Adds an End state.

ACT_ACCOUNT:AddProcess(From, Event, Process, ReturnEvents)

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

ACT_ACCOUNT:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

ACT_ACCOUNT:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

ACT_ACCOUNT:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

ACT_ACCOUNT.CallScheduler

ACT_ACCOUNT.Events

ACT_ACCOUNT:GetCurrentState()

Get current state.

ACT_ACCOUNT:GetEndStates()

Returns the End states.

ACT_ACCOUNT:GetProcess(From, Event)

ACT_ACCOUNT:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

ACT_ACCOUNT:GetScores()

Returns a table with the scores defined.

ACT_ACCOUNT:GetStartState()

Returns the start state of the FSM.

ACT_ACCOUNT:GetState()

Get current state.

ACT_ACCOUNT:GetSubs()

Returns a table with the Subs defined.

ACT_ACCOUNT:GetTransitions()

Returns a table of the transition rules defined within the FSM.

ACT_ACCOUNT:Is(State)

Check if FSM is in state.

ACT_ACCOUNT:LoadCallBacks(CallBackTable)

Load call backs.

ACT_ACCOUNT:New()

Creates a new FSM object.

ACT_ACCOUNT.Scores

ACT_ACCOUNT:SetProcess(From, Event, Fsm)

ACT_ACCOUNT:SetStartState(State)

Sets the start state of the FSM.

ACT_ACCOUNT._EndStates

ACT_ACCOUNT._EventSchedules

ACT_ACCOUNT._Processes

ACT_ACCOUNT._Scores

ACT_ACCOUNT._StartState

ACT_ACCOUNT._Transitions

ACT_ACCOUNT:_add_to_map(Map, Event)

Add to map.

ACT_ACCOUNT:_call_handler(step, trigger, params, EventName)

Call handler.

ACT_ACCOUNT:_create_transition(EventName)

Create transition.

ACT_ACCOUNT:_delayed_transition(EventName)

Delayed transition.

ACT_ACCOUNT:_eventmap(Events, EventStructure)

Event map.

ACT_ACCOUNT:_gosub(ParentFrom, ParentEvent)

Go sub.

ACT_ACCOUNT:_handler(EventName, ...)

Handler.

ACT_ACCOUNT:_isendstate(Current)

Is end state.

ACT_ACCOUNT:_submap(subs, sub, name)

Sub maps.

ACT_ACCOUNT:can(e)

Check if can do an event.

ACT_ACCOUNT:cannot(e)

Check if cannot do an event.

ACT_ACCOUNT.current

ACT_ACCOUNT.endstates

ACT_ACCOUNT:is(State, state)

Check if FSM is in state.

ACT_ACCOUNT.options

ACT_ACCOUNT.subs

#ACT_ACCOUNT FSM class, extends Core.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 States

  • Assigned: The player is assigned.
  • Waiting: Waiting for an event.
  • Report: Reporting.
  • Account: Account for an event.
  • Accounted: All events have been accounted for, end of the process.
  • Failed: Failed the process.

ACT_ACCOUNT Events

  • Start: Start the process.
  • Wait: Wait for an event.
  • Report: Report the status of the accounting.
  • Event: An event happened, process the event.
  • More: More targets.
  • NoMore (*): No more targets.
  • Fail (*): The action 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.

Developer Note

Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE Therefore, this class is considered to be deprecated

Field(s)

Function(s)

Creates a new DESTROY process.

Defined in:

ACT_ACCOUNT

Return value:

StateMachine callback function

Defined in:

ACT_ACCOUNT

Parameters:

Wrapper.Unit#UNIT ProcessUnit

#string Event

#string From

#string To

StateMachine callback function

Defined in:

ACT_ACCOUNT

Parameters:

Wrapper.Unit#UNIT ProcessUnit

#string Event

#string From

#string To

StateMachine callback function

Defined in:

ACT_ACCOUNT

Parameters:

Wrapper.Unit#UNIT ProcessUnit

#string Event

#string From

#string To

Field(s)

Function(s)

Assign the process to a Wrapper.Unit and activate the process.

Defined in:

Parameters:

Wrapper.Unit#UNIT ProcessUnit

Return value:

self

Creates a new FSM_PROCESS object based on this FSM_PROCESS.

Defined in:

Parameters:

Controllable

Task

Return value:

Gets the mission of the process.

Gets the mission of the process.

Defined in:

Return value:

Gets the task of the process.

Defined in:

Return value:

Defined in:

Parameter:

FsmProcess

Send a message of the Tasking.Task to the Group of the Unit.

Defined in:

Parameter:

Message

Creates a new FSM_PROCESS object.

Defined in:

Parameters:

Controllable

Task

Return value:

Removes an FSM_PROCESS object.

Defined in:

Return value:

Sets the task of the process.

Defined in:

Parameter:

Return value:

Defined in:

Parameters:

step

trigger

params

EventName

Defined in:

Parameters:

ProcessUnit

Task

From

Event

To

StateMachine callback function for a FSM_PROCESS

Defined in:

Parameters:

#string Event

#string From

#string To

Task

Field(s)

Function(s)

Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.

Creates a new FSM_CONTROLLABLE object.

Defined in:

Parameters:

#table FSMT

Finite State Machine Table

(optional) The CONTROLLABLE object that the FSM_CONTROLLABLE governs.

Return value:

OnAfter Transition Handler for Event Stop.

Defined in:

Parameters:

The Controllable Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

OnBefore Transition Handler for Event Stop.

Defined in:

Parameters:

The Controllable Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

Return value:

#boolean:

Return false to cancel Transition.

OnEnter Transition Handler for State Stopped.

Defined in:

Parameters:

The Controllable Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

OnLeave Transition Handler for State Stopped.

Defined in:

Parameters:

The Controllable Object managed by the FSM.

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

Return value:

#boolean:

Return false to cancel Transition.

Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.

Defined in:

Parameter:

Return value:

Synchronous Event Trigger for Event Stop.

Asynchronous Event Trigger for Event Stop.

Defined in:

Parameter:

#number Delay

The delay in seconds.

Defined in:

Parameters:

step

trigger

params

EventName

Field(s)

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Transitions.

Check if FSM is in state.

Defined in:

Parameter:

#string State

State name.

Return value:

#boolean:

If true, FSM is in this state.

Load call backs.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

Call handler.

Defined in:

Parameters:

#string step

Step "onafter", "onbefore", "onenter", "onleave".

#string trigger

Trigger.

#table params

Parameters.

#string EventName

Event name.

Return value:

Value.

Create transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Delayed transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Event map.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

Check if can do an event.

Defined in:

Parameter:

#string e

Event name.

Return values:

#boolean:

If true, FSM can do the event.

#string:

To state.

Check if cannot do an event.

Defined in:

Parameter:

#string e

Event name.

Return value:

#boolean:

If true, FSM cannot do the event.

Check if FSM is in state.

Defined in:

Parameters:

#string State

State name.

state

Return value:

#boolean:

If true, FSM is in this state.

#ACT_ACCOUNT_DEADS FSM class, extends #ACT_ACCOUNT

The ACT_ACCOUNT_DEADS class accounts (detects, counts and reports) successful kills of DCS units.

The process is given a Core.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.

ACT_ACCOUNT_DEADS constructor:

Field(s)

#string ACT_ACCOUNT_DEADS.DisplayCategory

Targets is the default display category

#number ACT_ACCOUNT_DEADS.DisplayTime

10 seconds is the default

Function(s)

Defined in:

ACT_ACCOUNT_DEADS

Parameter:

FsmAccount

Creates a new DESTROY process.

Defined in:

ACT_ACCOUNT_DEADS

Parameters:

Core.Set#SET_UNIT TargetSetUnit

#string TaskName

@param #ACT_ACCOUNT_DEADS self @param Core.Event#EVENTDATA EventData

Defined in:

ACT_ACCOUNT_DEADS

Parameter:

EventData

StateMachine callback function

Defined in:

ACT_ACCOUNT_DEADS

Parameters:

Wrapper.Unit#UNIT ProcessUnit

#string From

#string Event

#string To

StateMachine callback function

Defined in:

ACT_ACCOUNT_DEADS

Parameters:

Wrapper.Unit#UNIT ProcessUnit

#string From

#string Event

#string To

StateMachine callback function

Defined in:

ACT_ACCOUNT_DEADS

Parameters:

Wrapper.Unit#UNIT ProcessUnit

#string From

#string Event

#string To

StateMachine callback function

Defined in:

ACT_ACCOUNT_DEADS

Parameters:

Wrapper.Unit#UNIT ProcessUnit

#string Event

#string From

#string To

Task

@param #ACT_ACCOUNT_DEADS self @param Core.Event#EVENTDATA EventData

Defined in:

ACT_ACCOUNT_DEADS

Parameter:

EventData

@param #ACT_ACCOUNT_DEADS self @param Core.Event#EVENTDATA EventData

Defined in:

ACT_ACCOUNT_DEADS

Parameter:

EventData