Module Assign

(SP) (MP) (FSM) Accept or reject process for player (task) assignments.


1) #ASSIGN_ACCEPT class, extends Process#PROCESS

The #ASSIGN_ACCEPT class accepts by default a task for a player. No player intervention is allowed to reject the task.

1.1) ASSIGN_ACCEPT constructor:

1.2) ASSIGN_ACCEPT state machine:

The ASSIGN_ACCEPT is a state machine: it manages the different events and states of the Controllable it is controlling.

1.2.1) ASSIGN_ACCEPT Events:

1.2.2) ASSIGN_ACCEPT States:

  • UnAssigned: The player has not accepted the task.
  • Assigned: The player has accepted the task.

1.2.3) ASSIGN_ACCEPT 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.3) Manage the ASSIGN_ACCEPT parameters:

The following methods are available to modify the parameters of a ASSIGN_ACCEPT object:


2) #ASSIGNMENUACCEPT class, extends Process#PROCESS

The #ASSIGNMENUACCEPT class accepts a task when the player accepts the task through an added menu option. This assignment type is useful to conditionally allow the player to choose whether or not he would accept the task. The assignment type also allows to reject the task.

1.1) ASSIGNMENUACCEPT constructor:

1.2) ASSIGNMENUACCEPT state machine:

The ASSIGNMENUACCEPT is a state machine: it manages the different events and states of the Controllable it is controlling.

1.2.1) ASSIGNMENUACCEPT Events:

1.2.2) ASSIGNMENUACCEPT States:

  • UnAssigned: The player has not accepted the task.
  • Assigned: The player has accepted the task.
  • Rejected: The player has rejected the task.

1.2.3) ASSIGNMENUACCEPT 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.3) Manage the ASSIGNMENUACCEPT parameters:

The following methods are available to modify the parameters of a ASSIGNMENUACCEPT object:

Global(s)

ASSIGN_ACCEPT
ASSIGN_MENU_ACCEPT

Type ASSIGN_ACCEPT

ASSIGN_ACCEPT.ClassName
ASSIGN_ACCEPT:New(ProcessUnit, TaskBriefing)

Creates a new task assignment state machine.

ASSIGN_ACCEPT.ProcessUnit
ASSIGN_ACCEPT.TargetZone
ASSIGN_ACCEPT.Task
ASSIGN_ACCEPT.TaskBriefing

Type ASSIGN_MENU_ACCEPT

ASSIGN_MENU_ACCEPT.ClassName
ASSIGN_MENU_ACCEPT.Menu
ASSIGN_MENU_ACCEPT.MenuAcceptTask
ASSIGN_MENU_ACCEPT:MenuAssign()

Menu function.

ASSIGN_MENU_ACCEPT:MenuReject()

Menu function.

ASSIGN_MENU_ACCEPT.MenuRejectTask
ASSIGN_MENU_ACCEPT:New(ProcessUnit, TaskBriefing, TaskName)

Creates a new task assignment state machine.

ASSIGN_MENU_ACCEPT.ProcessUnit
ASSIGN_MENU_ACCEPT.TargetZone
ASSIGN_MENU_ACCEPT.Task
ASSIGN_MENU_ACCEPT.TaskBriefing
ASSIGN_MENU_ACCEPT.TaskName
ASSIGN_MENU_ACCEPT:onafterAssign(ProcessUnit, Event, From, To)

StateMachine callback function

ASSIGN_MENU_ACCEPT:onafterReject(ProcessUnit, Event, From, To)

StateMachine callback function

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

StateMachine callback function

Global(s)

#ASSIGN_ACCEPT ASSIGN_ACCEPT
#ASSIGN_MENU_ACCEPT ASSIGN_MENU_ACCEPT

Type Assign

Type ASSIGN_ACCEPT

ASSIGN_ACCEPT class

Field(s)

#string ASSIGN_ACCEPT.ClassName
ASSIGN_ACCEPT:New(ProcessUnit, TaskBriefing)

Creates a new task assignment state machine.

The process will accept the task by default, no player intervention accepted.

Parameters

  • Unit#UNIT ProcessUnit :

  • #string TaskBriefing :

Return value

#ASSIGN_ACCEPT: The task acceptance process.

Unit#UNIT ASSIGN_ACCEPT.ProcessUnit
Zone#ZONE_BASE ASSIGN_ACCEPT.TargetZone
Task#TASK_BASE ASSIGN_ACCEPT.Task
ASSIGN_ACCEPT.TaskBriefing

Type ASSIGN_MENU_ACCEPT

ASSIGNMENUACCEPT class

Field(s)

#string ASSIGN_MENU_ACCEPT.ClassName
ASSIGN_MENU_ACCEPT.Menu
ASSIGN_MENU_ACCEPT.MenuAcceptTask
ASSIGN_MENU_ACCEPT:MenuAssign()

Menu function.

ASSIGN_MENU_ACCEPT:MenuReject()

Menu function.

ASSIGN_MENU_ACCEPT.MenuRejectTask
ASSIGN_MENU_ACCEPT:New(ProcessUnit, TaskBriefing, TaskName)

Creates a new task assignment state machine.

The process will request from the menu if it accepts the task, if not, the unit is removed from the simulator.

Parameters

  • Unit#UNIT ProcessUnit :

  • #string TaskBriefing :

  • TaskName :

Return value

#ASSIGNMENUACCEPT: self

Unit#UNIT ASSIGN_MENU_ACCEPT.ProcessUnit
Zone#ZONE_BASE ASSIGN_MENU_ACCEPT.TargetZone
Task#TASK_BASE ASSIGN_MENU_ACCEPT.Task
ASSIGN_MENU_ACCEPT.TaskBriefing
ASSIGN_MENU_ACCEPT.TaskName
ASSIGN_MENU_ACCEPT:onafterAssign(ProcessUnit, Event, From, To)

StateMachine callback function

Parameters

ASSIGN_MENU_ACCEPT:onafterReject(ProcessUnit, Event, From, To)

StateMachine callback function

Parameters

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

StateMachine callback function

Parameters