diff --git a/Moose Development/Moose/Base.lua b/Moose Development/Moose/Core/Base.lua
similarity index 100%
rename from Moose Development/Moose/Base.lua
rename to Moose Development/Moose/Core/Base.lua
diff --git a/Moose Development/Moose/Database.lua b/Moose Development/Moose/Core/Database.lua
similarity index 100%
rename from Moose Development/Moose/Database.lua
rename to Moose Development/Moose/Core/Database.lua
diff --git a/Moose Development/Moose/Event.lua b/Moose Development/Moose/Core/Event.lua
similarity index 100%
rename from Moose Development/Moose/Event.lua
rename to Moose Development/Moose/Core/Event.lua
diff --git a/Moose Development/Moose/Menu.lua b/Moose Development/Moose/Core/Menu.lua
similarity index 100%
rename from Moose Development/Moose/Menu.lua
rename to Moose Development/Moose/Core/Menu.lua
diff --git a/Moose Development/Moose/Message.lua b/Moose Development/Moose/Core/Message.lua
similarity index 100%
rename from Moose Development/Moose/Message.lua
rename to Moose Development/Moose/Core/Message.lua
diff --git a/Moose Development/Moose/Point.lua b/Moose Development/Moose/Core/Point.lua
similarity index 100%
rename from Moose Development/Moose/Point.lua
rename to Moose Development/Moose/Core/Point.lua
diff --git a/Moose Development/Moose/Scheduler.lua b/Moose Development/Moose/Core/Scheduler.lua
similarity index 100%
rename from Moose Development/Moose/Scheduler.lua
rename to Moose Development/Moose/Core/Scheduler.lua
diff --git a/Moose Development/Moose/Set.lua b/Moose Development/Moose/Core/Set.lua
similarity index 100%
rename from Moose Development/Moose/Set.lua
rename to Moose Development/Moose/Core/Set.lua
diff --git a/Moose Development/Moose/StateMachine.lua b/Moose Development/Moose/Core/StateMachine.lua
similarity index 95%
rename from Moose Development/Moose/StateMachine.lua
rename to Moose Development/Moose/Core/StateMachine.lua
index ee863e9e3..ba8fb1261 100644
--- a/Moose Development/Moose/StateMachine.lua
+++ b/Moose Development/Moose/Core/StateMachine.lua
@@ -285,24 +285,23 @@ STATEMACHINE_TASK = {
--- Creates a new STATEMACHINE_TASK object.
-- @param #STATEMACHINE_TASK self
+-- @param #table FSMT
+-- @param Task#TASK_BASE Task
+-- @param Unit#UNIT TaskUnit
-- @return #STATEMACHINE_TASK
-function STATEMACHINE_TASK:New( Task, TaskUnit, options )
+function STATEMACHINE_TASK:New( FSMT, Task, TaskUnit )
- local FsmTask = routines.utils.deepCopy( self ) -- Create a new self instance
- local Parent = STATEMACHINE:New(options)
+ local self = BASE:Inherit( self, STATEMACHINE:New( FSMT ) ) -- StateMachine#STATEMACHINE_PROCESS
- setmetatable( FsmTask, Parent )
- FsmTask.__index = FsmTask
+ self["onstatechange"] = Task.OnStateChange
+ self["onAssigned"] = Task.OnAssigned
+ self["onSuccess"] = Task.OnSuccess
+ self["onFailed"] = Task.OnFailed
- FsmTask["onstatechange"] = Task.OnStateChange
- FsmTask["onAssigned"] = Task.OnAssigned
- FsmTask["onSuccess"] = Task.OnSuccess
- FsmTask["onFailed"] = Task.OnFailed
+ self.Task = Task
+ self.TaskUnit = TaskUnit
- FsmTask.Task = Task
- FsmTask.TaskUnit = TaskUnit
-
- return FsmTask
+ return self
end
function STATEMACHINE_TASK:_call_handler( handler, params )
@@ -338,7 +337,7 @@ end
--- Sets the CONTROLLABLE object that the STATEMACHINE_CONTROLLABLE governs.
-- @param #STATEMACHINE_CONTROLLABLE self
--- @param Controllable#CONTROLLABLE Controllable
+-- @param Controllable#CONTROLLABLE FSMControllable
-- @return #STATEMACHINE_CONTROLLABLE
function STATEMACHINE_CONTROLLABLE:SetControllable( FSMControllable )
self:F( FSMControllable )
diff --git a/Moose Development/Moose/Zone.lua b/Moose Development/Moose/Core/Zone.lua
similarity index 100%
rename from Moose Development/Moose/Zone.lua
rename to Moose Development/Moose/Core/Zone.lua
diff --git a/Moose Development/Dcs/DCSAirbase.lua b/Moose Development/Moose/Dcs/DCSAirbase.lua
similarity index 100%
rename from Moose Development/Dcs/DCSAirbase.lua
rename to Moose Development/Moose/Dcs/DCSAirbase.lua
diff --git a/Moose Development/Dcs/DCSCoalitionObject.lua b/Moose Development/Moose/Dcs/DCSCoalitionObject.lua
similarity index 100%
rename from Moose Development/Dcs/DCSCoalitionObject.lua
rename to Moose Development/Moose/Dcs/DCSCoalitionObject.lua
diff --git a/Moose Development/Dcs/DCSCommand.lua b/Moose Development/Moose/Dcs/DCSCommand.lua
similarity index 100%
rename from Moose Development/Dcs/DCSCommand.lua
rename to Moose Development/Moose/Dcs/DCSCommand.lua
diff --git a/Moose Development/Dcs/DCSController.lua b/Moose Development/Moose/Dcs/DCSController.lua
similarity index 100%
rename from Moose Development/Dcs/DCSController.lua
rename to Moose Development/Moose/Dcs/DCSController.lua
diff --git a/Moose Development/Dcs/DCSGroup.lua b/Moose Development/Moose/Dcs/DCSGroup.lua
similarity index 100%
rename from Moose Development/Dcs/DCSGroup.lua
rename to Moose Development/Moose/Dcs/DCSGroup.lua
diff --git a/Moose Development/Dcs/DCSObject.lua b/Moose Development/Moose/Dcs/DCSObject.lua
similarity index 100%
rename from Moose Development/Dcs/DCSObject.lua
rename to Moose Development/Moose/Dcs/DCSObject.lua
diff --git a/Moose Development/Dcs/DCSStaticObject.lua b/Moose Development/Moose/Dcs/DCSStaticObject.lua
similarity index 100%
rename from Moose Development/Dcs/DCSStaticObject.lua
rename to Moose Development/Moose/Dcs/DCSStaticObject.lua
diff --git a/Moose Development/Dcs/DCSTask.lua b/Moose Development/Moose/Dcs/DCSTask.lua
similarity index 100%
rename from Moose Development/Dcs/DCSTask.lua
rename to Moose Development/Moose/Dcs/DCSTask.lua
diff --git a/Moose Development/Dcs/DCSTime.lua b/Moose Development/Moose/Dcs/DCSTime.lua
similarity index 100%
rename from Moose Development/Dcs/DCSTime.lua
rename to Moose Development/Moose/Dcs/DCSTime.lua
diff --git a/Moose Development/Dcs/DCSTypes.lua b/Moose Development/Moose/Dcs/DCSTypes.lua
similarity index 100%
rename from Moose Development/Dcs/DCSTypes.lua
rename to Moose Development/Moose/Dcs/DCSTypes.lua
diff --git a/Moose Development/Dcs/DCSUnit.lua b/Moose Development/Moose/Dcs/DCSUnit.lua
similarity index 100%
rename from Moose Development/Dcs/DCSUnit.lua
rename to Moose Development/Moose/Dcs/DCSUnit.lua
diff --git a/Moose Development/Dcs/DCScountry.lua b/Moose Development/Moose/Dcs/DCScountry.lua
similarity index 100%
rename from Moose Development/Dcs/DCScountry.lua
rename to Moose Development/Moose/Dcs/DCScountry.lua
diff --git a/Moose Development/Dcs/DCSenv.lua b/Moose Development/Moose/Dcs/DCSenv.lua
similarity index 100%
rename from Moose Development/Dcs/DCSenv.lua
rename to Moose Development/Moose/Dcs/DCSenv.lua
diff --git a/Moose Development/Dcs/DCSland.lua b/Moose Development/Moose/Dcs/DCSland.lua
similarity index 100%
rename from Moose Development/Dcs/DCSland.lua
rename to Moose Development/Moose/Dcs/DCSland.lua
diff --git a/Moose Development/Dcs/DCStimer.lua b/Moose Development/Moose/Dcs/DCStimer.lua
similarity index 100%
rename from Moose Development/Dcs/DCStimer.lua
rename to Moose Development/Moose/Dcs/DCStimer.lua
diff --git a/Moose Development/Dcs/DCStrigger.lua b/Moose Development/Moose/Dcs/DCStrigger.lua
similarity index 100%
rename from Moose Development/Dcs/DCStrigger.lua
rename to Moose Development/Moose/Dcs/DCStrigger.lua
diff --git a/Moose Development/Dcs/DCSworld.lua b/Moose Development/Moose/Dcs/DCSworld.lua
similarity index 100%
rename from Moose Development/Dcs/DCSworld.lua
rename to Moose Development/Moose/Dcs/DCSworld.lua
diff --git a/Moose Development/Moose/Fsm/Account.lua b/Moose Development/Moose/Fsm/Account.lua
new file mode 100644
index 000000000..736e46872
--- /dev/null
+++ b/Moose Development/Moose/Fsm/Account.lua
@@ -0,0 +1,249 @@
+--- (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 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) @{#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:
+--
+-- * @{#ACCOUNT_DEADS.New}(): Creates a new ACCOUNT_DEADS object.
+--
+-- ===
+--
+-- @module Account
+
+
+do -- ACCOUNT
+
+ --- ACCOUNT class
+ -- @type ACCOUNT
+ -- @field Set#SET_UNIT TargetSetUnit
+ -- @extends Process#PROCESS
+ ACCOUNT = {
+ ClassName = "ACCOUNT",
+ TargetSetUnit = nil,
+ }
+
+ --- Creates a new DESTROY process.
+ -- @param #ACCOUNT self
+ -- @return #ACCOUNT
+ function ACCOUNT:New()
+
+ local FSMT = {
+ initial = 'Assigned',
+ events = {
+ { name = 'Start', from = 'Assigned', to = 'Waiting' },
+ { name = 'Wait', from = '*', to = 'Waiting' },
+ { name = 'Report', from = '*', to = 'Report' },
+ { name = 'Event', from = '*', to = 'Account' },
+ { name = 'More', from = 'Account', to = 'Wait' },
+ { name = 'NoMore', from = 'Account', to = 'Success' },
+ { name = 'Fail', from = '*', to = 'Failed' },
+ },
+ endstates = { 'Success', 'Failed' }
+ }
+
+ -- Inherits from BASE
+ local self = BASE:Inherit( self, PROCESS:New( FSMT, "ACCOUNT" ) ) -- #ACCOUNT
+
+ self.DisplayInterval = 30
+ self.DisplayCount = 30
+ self.DisplayMessage = true
+ self.DisplayTime = 10 -- 10 seconds is the default
+ self.DisplayCategory = "HQ" -- Targets is the default display category
+
+ return self
+ end
+
+ --- Process Events
+
+ --- StateMachine callback function
+ -- @param #ACCOUNT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ACCOUNT:onafterStart( ProcessUnit, Event, From, To )
+
+ self:__Wait( 1 )
+ end
+
+ --- StateMachine callback function
+ -- @param #ACCOUNT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ACCOUNT:onenterWaiting( ProcessUnit, Event, From, To )
+
+ if self.DisplayCount >= self.DisplayInterval then
+ self:Report()
+ self.DisplayCount = 1
+ else
+ self.DisplayCount = self.DisplayCount + 1
+ end
+
+ return true -- Process always the event.
+ end
+
+ --- StateMachine callback function
+ -- @param #ACCOUNT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ACCOUNT:onafterEvent( ProcessUnit, Event, From, To, Event )
+
+ self:__NoMore( 1 )
+ end
+
+end -- ACCOUNT
+
+do -- ACCOUNT_DEADS
+
+ --- ACCOUNT_DEADS class
+ -- @type ACCOUNT_DEADS
+ -- @field Set#SET_UNIT TargetSetUnit
+ -- @extends Process#PROCESS
+ ACCOUNT_DEADS = {
+ ClassName = "ACCOUNT_DEADS",
+ TargetSetUnit = nil,
+ }
+
+
+ --- Creates a new DESTROY process.
+ -- @param #ACCOUNT_DEADS self
+ -- @param Set#SET_UNIT TargetSetUnit
+ -- @param #string TaskName
+ -- @return #ACCOUNT_DEADS self
+ function ACCOUNT_DEADS:New( TargetSetUnit, TaskName )
+
+ -- Inherits from BASE
+ local self = BASE:Inherit( self, ACCOUNT:New() ) -- #ACCOUNT_DEADS
+
+ self.TargetSetUnit = TargetSetUnit
+ self.TaskName = TaskName
+
+ _EVENTDISPATCHER:OnDead( self.EventDead, self )
+
+ return self
+ end
+
+ --- Process Events
+
+ --- StateMachine callback function
+ -- @param #ASSIGN_MENU_ACCEPT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ACCOUNT_DEADS:onenterReport( ProcessUnit, Event, From, To )
+
+ local TaskGroup = ProcessUnit:GetGroup()
+ MESSAGE:New( "Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:GetUnitTypesText() .. " targets left to be destroyed.", 5, "HQ" ):ToGroup( TaskGroup )
+ end
+
+
+ --- StateMachine callback function
+ -- @param #ASSIGN_MENU_ACCEPT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ACCOUNT_DEADS:onenterAccount( ProcessUnit, Event, From, To, Event )
+
+ self.TargetSetUnit:Flush()
+
+ if self.TargetSetUnit:FindUnit( Event.IniUnitName ) then
+ self.TargetSetUnit:RemoveUnitsByName( Event.IniUnitName )
+ local TaskGroup = ProcessUnit:GetGroup()
+ MESSAGE:New( "You hit a target. Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:Count() .. " targets ( " .. self.TargetSetUnit:GetUnitTypesText() .. " ) left to be destroyed.", 15, "HQ" ):ToGroup( TaskGroup )
+ end
+ end
+
+ --- StateMachine callback function
+ -- @param #ASSIGN_MENU_ACCEPT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ACCOUNT_DEADS:onafterEvent( ProcessUnit, Event, From, To, Event )
+
+ if self.TargetSetUnit:Count() > 0 then
+ self:__More( 1 )
+ else
+ self:__NoMore( 1 )
+ end
+ end
+
+ --- DCS Events
+
+ --- @param #ACCOUNT_DEADS self
+ -- @param Event#EVENTDATA Event
+ function ACCOUNT_DEADS:EventDead( Event )
+
+ if Event.IniDCSUnit then
+ self:__Event( 1 )
+ end
+ end
+
+end -- ACCOUNT DEADS
\ No newline at end of file
diff --git a/Moose Development/Moose/Fsm/Assign.lua b/Moose Development/Moose/Fsm/Assign.lua
new file mode 100644
index 000000000..fd2366e75
--- /dev/null
+++ b/Moose Development/Moose/Fsm/Assign.lua
@@ -0,0 +1,258 @@
+--- (SP) (MP) (FSM) Accept or reject process for player (task) assignments.
+--
+-- ===
+--
+-- # @{#ASSIGN} FSM class, extends @{Process#PROCESS}
+--
+-- ## ASSIGN 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.
+--
+-- ### ASSIGN **Events**:
+--
+-- These are the events defined in this class:
+--
+-- * **Start**: Start the tasking acceptance process.
+-- * **Assign**: Assign the task.
+-- * **Reject**: Reject the task..
+--
+-- ### ASSIGN **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.
+--
+-- ### ASSIGN **States**:
+--
+-- * **UnAssigned**: The player has not accepted the task.
+-- * **Assigned (*)**: The player has accepted the task.
+-- * **Rejected (*)**: The player has not accepted the task.
+-- * **Waiting**: The process is awaiting player feedback.
+-- * **Failed (*)**: The process has failed.
+--
+-- (*) End states of the process.
+--
+-- ### ASSIGN 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) @{#ASSIGN_ACCEPT} class, extends @{Assign#ASSIGN}
+--
+-- 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:
+--
+-- * @{#ASSIGN_ACCEPT.New}(): Creates a new ASSIGN_ACCEPT object.
+--
+-- ===
+--
+-- # 2) @{#ASSIGN_MENU_ACCEPT} class, extends @{Assign#ASSIGN}
+--
+-- The ASSIGN_MENU_ACCEPT 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.
+--
+-- ## 2.1) ASSIGN_MENU_ACCEPT constructor:
+-- -----------------------------------------
+--
+-- * @{#ASSIGN_MENU_ACCEPT.New}(): Creates a new ASSIGN_MENU_ACCEPT object.
+--
+-- ===
+--
+-- @module Assign
+
+
+do -- ASSIGN
+
+ --- ASSIGN class
+ -- @type ASSIGN
+ -- @field Task#TASK_BASE Task
+ -- @field Unit#UNIT ProcessUnit
+ -- @field Zone#ZONE_BASE TargetZone
+ -- @extends Process#PROCESS
+ ASSIGN = {
+ ClassName = "ASSIGN",
+ }
+
+
+ --- Creates a new task assignment state machine. The process will accept the task by default, no player intervention accepted.
+ -- @param #ASSIGN self
+ -- @return #ASSIGN The task acceptance process.
+ function ASSIGN:New()
+
+ local FSMT = {
+ initial = 'UnAssigned',
+ events = {
+ { name = 'Start', from = 'UnAssigned', to = 'Waiting' },
+ { name = 'Assign', from = 'Waiting', to = 'Assigned' },
+ { name = 'Reject', from = 'Waiting', to = 'Rejected' },
+ { name = 'Fail', from = '*', to = 'Failed' },
+ },
+ endstates = {
+ 'Assigned', 'Rejected', 'Failed'
+ },
+ }
+
+ -- Inherits from BASE
+ local self = BASE:Inherit( self, PROCESS:New( FSMT, "ASSIGN" ) ) -- #ASSIGN
+
+ return self
+ end
+
+end -- ASSIGN
+
+
+
+do -- ASSIGN_ACCEPT
+
+ --- ASSIGN_ACCEPT class
+ -- @type ASSIGN_ACCEPT
+ -- @field Task#TASK_BASE Task
+ -- @field Unit#UNIT ProcessUnit
+ -- @field Zone#ZONE_BASE TargetZone
+ -- @extends Process#PROCESS
+ ASSIGN_ACCEPT = {
+ ClassName = "ASSIGN_ACCEPT",
+ }
+
+
+ --- Creates a new task assignment state machine. The process will accept the task by default, no player intervention accepted.
+ -- @param #ASSIGN_ACCEPT self
+ -- @param #string TaskBriefing
+ -- @return #ASSIGN_ACCEPT The task acceptance process.
+ function ASSIGN_ACCEPT:New( TaskBriefing )
+
+ -- Inherits from BASE
+ local self = BASE:Inherit( self, ASSIGN:New() ) -- #ASSIGN_ACCEPT
+
+ self.TaskBriefing = TaskBriefing
+
+ return self
+ end
+
+
+ --- StateMachine callback function
+ -- @param #ASSIGN_ACCEPT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ASSIGN_ACCEPT:onafterStart( ProcessUnit, Event, From, To )
+ self:E( { ProcessUnit, Event, From, To } )
+
+ MESSAGE:New( self.TaskBriefing, 30, "Task Assignment" ):ToGroup( ProcessUnit:GetGroup() )
+
+ self:__Assign( 1 )
+ end
+
+end -- ASSIGN_ACCEPT
+
+
+do -- ASSIGN_MENU_ACCEPT
+
+ --- ASSIGN_MENU_ACCEPT class
+ -- @type ASSIGN_MENU_ACCEPT
+ -- @field Task#TASK_BASE Task
+ -- @field Unit#UNIT ProcessUnit
+ -- @field Zone#ZONE_BASE TargetZone
+ -- @extends Task2#TASK2
+ ASSIGN_MENU_ACCEPT = {
+ ClassName = "ASSIGN_MENU_ACCEPT",
+ }
+
+
+ --- 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.
+ -- @param #ASSIGN_MENU_ACCEPT self
+ -- @param #string TaskName
+ -- @param #string TaskBriefing
+ -- @return #ASSIGN_MENU_ACCEPT self
+ function ASSIGN_MENU_ACCEPT:New( TaskName, TaskBriefing )
+
+ -- Inherits from BASE
+ local self = BASE:Inherit( self, ASSIGN:New() ) -- #ASSIGN_MENU_ACCEPT
+
+ self.TaskBriefing = TaskBriefing
+ self.TaskName = TaskName
+
+ return self
+ end
+
+ --- StateMachine callback function
+ -- @param #ASSIGN_MENU_ACCEPT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ASSIGN_MENU_ACCEPT:onafterStart( ProcessUnit, Event, From, To )
+ self:E( { ProcessUnit, Event, From, To } )
+
+ MESSAGE:New( self.TaskBriefing .. "\nAccess the radio menu to accept the task. You have 30 seconds or the assignment will be cancelled.", 30, "Task Assignment" ):ToGroup( ProcessUnit:GetGroup() )
+
+ local ProcessGroup = ProcessUnit:GetGroup()
+ self.Menu = MENU_GROUP:New( ProcessGroup, "Task " .. self.TaskName .. " acceptance" )
+ self.MenuAcceptTask = MENU_GROUP_COMMAND:New( ProcessGroup, "Accept task " .. self.MenuText, self.Menu, self.MenuAssign, self )
+ self.MenuRejectTask = MENU_GROUP_COMMAND:New( ProcessGroup, "Reject task " .. self.MenuText, self.Menu, self.MenuReject, self )
+ end
+
+ --- Menu function.
+ -- @param #ASSIGN_MENU_ACCEPT self
+ function ASSIGN_MENU_ACCEPT:MenuAssign()
+ self:E( )
+
+ self:__Assign( 1 )
+ end
+
+ --- Menu function.
+ -- @param #ASSIGN_MENU_ACCEPT self
+ function ASSIGN_MENU_ACCEPT:MenuReject()
+ self:E( )
+
+ self:__Reject( 1 )
+ end
+
+ --- StateMachine callback function
+ -- @param #ASSIGN_MENU_ACCEPT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ASSIGN_MENU_ACCEPT:onafterAssign( ProcessUnit, Event, From, To )
+ self:E( { ProcessUnit.UnitNameEvent, From, To } )
+
+ self.Menu:Remove()
+ end
+
+ --- StateMachine callback function
+ -- @param #ASSIGN_MENU_ACCEPT self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ASSIGN_MENU_ACCEPT:onafterReject( ProcessUnit, Event, From, To )
+ self:E( { ProcessUnit.UnitName, Event, From, To } )
+
+ self.Menu:Remove()
+ --TODO: need to resolve this problem ... it has to do with the events ...
+ --self.Task:UnAssignFromUnit( ProcessUnit )needs to become a callback funtion call upon the event
+ ProcessUnit:Destroy()
+ end
+
+end -- ASSIGN_MENU_ACCEPT
diff --git a/Moose Development/Moose/Cargo.lua b/Moose Development/Moose/Fsm/Cargo.lua
similarity index 79%
rename from Moose Development/Moose/Cargo.lua
rename to Moose Development/Moose/Fsm/Cargo.lua
index 798c3000e..f43de4acb 100644
--- a/Moose Development/Moose/Cargo.lua
+++ b/Moose Development/Moose/Fsm/Cargo.lua
@@ -1,12 +1,7 @@
--- Management of logical cargo objects, that can be transported from and to transportation carriers.
--
-- ===
---
--- 1) @{Cargo#CARGO_BASE} class, extends @{Base#BASE}
--- ==================================================
--- The @{#CARGO_BASE} class defines the core functions that defines a cargo object within MOOSE.
--- A cargo is a logical object defined that is available for transport, and has a life status within a simulation.
---
+--
-- Cargo can be of various forms, always are composed out of ONE object ( one unit or one static or one slingload crate ):
--
-- * CARGO_UNIT, represented by a @{Unit} in a @{Group}: Cargo can be represented by a Unit in a Group. Destruction of the Unit will mean that the cargo is lost.
@@ -16,20 +11,24 @@
-- * CARGO_SLINGLOAD, represented by a @{Cargo} that is transportable: Cargo can be represented by a Cargo object that is transportable. Destruction of the Cargo will mean that the cargo is lost.
--
-- * CARGO_GROUPED, represented by a Group of CARGO_UNITs.
+--
+-- 1) @{Cargo#CARGO_BASE} class, extends @{StateMachine#STATEMACHINE_PROCESS}
+-- ==========================================================================
+-- The @{#CARGO_BASE} class defines the core functions that defines a cargo object within MOOSE.
+-- A cargo is a logical object defined that is available for transport, and has a life status within a simulation.
--
--- 1.2) CARGO state machine:
--- -------------------------
--- The CARGO is a state machine: it manages the different events and states of the cargo.
+-- The CARGO_BASE is a state machine: it manages the different events and states of the cargo.
+-- All derived classes from CARGO_BASE follow the same state machine, expose the same cargo event functions, and provide the same cargo states.
--
--- ### 1.2.1) CARGO Events:
+-- ## 1.2.1) CARBO_BASE Events:
--
--- * @{#CARGO.Board}( ToCarrier ): Boards the cargo to a Carrier.
--- * @{#CARGO.Load}( ToCarrier ): Loads the cargo into a Carrier, regardless of its position.
--- * @{#CARGO.UnBoard}( ToPointVec2 ): UnBoard the cargo from a Carrier. This will trigger a movement of the cargo to the option ToPointVec2.
--- * @{#CARGO.UnLoad}( ToPointVec2 ): UnLoads the cargo from a Carrier.
--- * @{#CARGO.Dead}( Controllable ): The cargo is dead. The cargo process will be ended.
+-- * @{#CARBO_BASE.Board}( ToCarrier ): Boards the cargo to a carrier.
+-- * @{#CARBO_BASE.Load}( ToCarrier ): Loads the cargo into a carrier, regardless of its position.
+-- * @{#CARBO_BASE.UnBoard}( ToPointVec2 ): UnBoard the cargo from a carrier. This will trigger a movement of the cargo to the option ToPointVec2.
+-- * @{#CARBO_BASE.UnLoad}( ToPointVec2 ): UnLoads the cargo from a carrier.
+-- * @{#CARBO_BASE.Dead}( Controllable ): The cargo is dead. The cargo process will be ended.
--
--- ### 1.2.2) CARGO States:
+-- ## 1.2.2) CARBO_BASE States:
--
-- * **UnLoaded**: The cargo is unloaded from a carrier.
-- * **Boarding**: The cargo is currently boarding (= running) into a carrier.
@@ -38,93 +37,144 @@
-- * **Dead**: The cargo is dead ...
-- * **End**: The process has come to an end.
--
--- ### 1.2.3) CARGO state transition functions:
+-- ## 1.2.3) CARBO_BASE 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 functions will be called by the state machine:
+-- There are 2 moments when state transition methods 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!
+-- 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 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.
---
+-- 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.
+--
+-- 2) #CARGO_UNIT class
+-- ====================
+-- The CARGO_UNIT class defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.
+-- Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGO_UNIT objects to and from carriers.
+--
+-- 5) #CARGO_GROUPED class
+-- =======================
+-- The CARGO_GROUPED class defines a cargo that is represented by a group of UNIT objects within the simulator, and can be transported by a carrier.
+-- Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGO_UNIT objects to and from carriers.
+--
+-- This module is still under construction, but is described above works already, and will keep working ...
+--
-- @module Cargo
-- Events
---- Event Function. The cargo must be in the **UnLoaded** state.
--- Boards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo to the Carrier.
--- @function [parent=#CARGO] Board
--- @param #CARGO self
+-- Board
+
+--- Boards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo to the Carrier.
+-- The cargo must be in the **UnLoaded** state.
+-- @function [parent=#CARBO_BASE] Board
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
---- Event Function. The cargo must be in the **Loaded** state.
--- UnBoards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo from the Carrier.
--- @function [parent=#CARGO] UnBoard
--- @param #CARGO self
+--- Boards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo to the Carrier.
+-- The cargo must be in the **UnLoaded** state.
+-- @function [parent=#CARBO_BASE] __Board
+-- @param #CARBO_BASE self
+-- @param #number DelaySeconds The amount of seconds to delay the action.
+-- @param Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
+
+
+-- UnBoard
+
+--- UnBoards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo from the Carrier.
+-- The cargo must be in the **Loaded** state.
+-- @function [parent=#CARBO_BASE] UnBoard
+-- @param #CARBO_BASE self
-- @param Point#POINT_VEC2 ToPointVec2 (optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
---- Event Function. The cargo must be in the **UnLoaded** state.
--- Loads the cargo to a Carrier. The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading.
--- @function [parent=#CARGO] Load
--- @param #CARGO self
+--- UnBoards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo from the Carrier.
+-- The cargo must be in the **Loaded** state.
+-- @function [parent=#CARBO_BASE] __UnBoard
+-- @param #CARBO_BASE self
+-- @param #number DelaySeconds The amount of seconds to delay the action.
+-- @param Point#POINT_VEC2 ToPointVec2 (optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
+
+
+-- Load
+
+--- Loads the cargo to a Carrier. The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading.
+-- The cargo must be in the **UnLoaded** state.
+-- @function [parent=#CARBO_BASE] Load
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
---- Event Function. The cargo must be in the **Loaded** state.
--- UnLoads the cargo to a Carrier. The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading.
--- @function [parent=#CARGO] Board
--- @param #CARGO self
+--- Loads the cargo to a Carrier. The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading.
+-- The cargo must be in the **UnLoaded** state.
+-- @function [parent=#CARBO_BASE] __Load
+-- @param #CARBO_BASE self
+-- @param #number DelaySeconds The amount of seconds to delay the action.
+-- @param Controllable#CONTROLLABLE ToCarrier The Carrier that will hold the cargo.
+
+
+-- UnLoad
+
+--- UnLoads the cargo to a Carrier. The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading.
+-- The cargo must be in the **Loaded** state.
+-- @function [parent=#CARBO_BASE] UnLoad
+-- @param #CARBO_BASE self
+-- @param Point#POINT_VEC2 ToPointVec2 (optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
+
+--- UnLoads the cargo to a Carrier. The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading.
+-- The cargo must be in the **Loaded** state.
+-- @function [parent=#CARBO_BASE] __UnLoad
+-- @param #CARBO_BASE self
+-- @param #number DelaySeconds The amount of seconds to delay the action.
-- @param Point#POINT_VEC2 ToPointVec2 (optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
-- State Transition Functions
-- UnLoaded
---- @function [parent=#CARGO] OnBeforeUnLoaded
--- @param #CARGO self
+--- @function [parent=#CARBO_BASE] OnBeforeUnLoaded
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE Controllable
-- @return #boolean
---- @function [parent=#CARGO] OnAfterUnLoaded
--- @param #CARGO self
+--- @function [parent=#CARBO_BASE] OnAfterUnLoaded
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE Controllable
-- Loaded
---- @function [parent=#CARGO] OnBeforeLoaded
--- @param #CARGO self
+--- @function [parent=#CARBO_BASE] OnBeforeLoaded
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE Controllable
-- @return #boolean
---- @function [parent=#CARGO] OnAfterLoaded
--- @param #CARGO self
+--- @function [parent=#CARBO_BASE] OnAfterLoaded
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE Controllable
-- Boarding
---- @function [parent=#CARGO] OnBeforeBoarding
--- @param #CARGO self
+--- @function [parent=#CARBO_BASE] OnBeforeBoarding
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE Controllable
-- @return #boolean
---- @function [parent=#CARGO] OnAfterBoarding
--- @param #CARGO self
+--- @function [parent=#CARBO_BASE] OnAfterBoarding
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE Controllable
-- UnBoarding
---- @function [parent=#CARGO] OnBeforeUnBoarding
--- @param #CARGO self
+--- @function [parent=#CARBO_BASE] OnBeforeUnBoarding
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE Controllable
-- @return #boolean
---- @function [parent=#CARGO] OnAfterUnBoarding
--- @param #CARGO self
+--- @function [parent=#CARBO_BASE] OnAfterUnBoarding
+-- @param #CARBO_BASE self
-- @param Controllable#CONTROLLABLE Controllable
@@ -132,9 +182,9 @@
CARGOS = {}
-do -- CARGO
+do -- CARBO_BASE
- --- @type CARGO
+ --- @type CARBO_BASE
-- @extends StateMachine#STATEMACHINE_PROCESS
-- @field #string Type A string defining the type of the cargo. eg. Engineers, Equipment, Screwdrivers.
-- @field #string Name A string defining the name of the cargo. The name is the unique identifier of the cargo.
@@ -147,8 +197,8 @@ do -- CARGO
-- @field #boolean Moveable This flag defines if the cargo is moveable.
-- @field #boolean Representable This flag defines if the cargo can be represented by a DCS Unit.
-- @field #boolean Containable This flag defines if the cargo can be contained within a DCS Unit.
- CARGO = {
- ClassName = "CARGO",
+ CARBO_BASE = {
+ ClassName = "CARBO_BASE",
Type = nil,
Name = nil,
Weight = nil,
@@ -160,20 +210,19 @@ do -- CARGO
Containable = false,
}
---- @type CARGO.CargoObjects
+--- @type CARBO_BASE.CargoObjects
-- @map < #string, Positionable#POSITIONABLE > The alive POSITIONABLE objects representing the the cargo.
---- CARGO Constructor. This class is an abstract class and should not be instantiated.
--- @param #CARGO self
--- @param Mission#MISSION Mission
+--- CARBO_BASE Constructor. This class is an abstract class and should not be instantiated.
+-- @param #CARBO_BASE self
-- @param #string Type
-- @param #string Name
-- @param #number Weight
-- @param #number ReportRadius (optional)
-- @param #number NearRadius (optional)
--- @return #CARGO
-function CARGO:New( Mission, Type, Name, Weight, ReportRadius, NearRadius )
+-- @return #CARBO_BASE
+function CARBO_BASE:New( Type, Name, Weight, ReportRadius, NearRadius )
FSMT = {
initial = 'UnLoaded',
@@ -189,7 +238,7 @@ function CARGO:New( Mission, Type, Name, Weight, ReportRadius, NearRadius )
},
}
- local self = BASE:Inherit( self, STATEMACHINE_PROCESS:New( FSMT ) ) -- #CARGO
+ local self = BASE:Inherit( self, STATEMACHINE_PROCESS:New( FSMT ) ) -- #CARBO_BASE
self:F( { Type, Name, Weight, ReportRadius, NearRadius } )
@@ -214,20 +263,20 @@ function CARGO:New( Mission, Type, Name, Weight, ReportRadius, NearRadius )
end
---- Template method to spawn a new representation of the CARGO in the simulator.
--- @param #CARGO self
--- @return #CARGO
-function CARGO:Spawn( PointVec2 )
+--- Template method to spawn a new representation of the CARBO_BASE in the simulator.
+-- @param #CARBO_BASE self
+-- @return #CARBO_BASE
+function CARBO_BASE:Spawn( PointVec2 )
self:F()
end
--- Check if CargoCarrier is near the Cargo to be Loaded.
--- @param #CARGO self
+-- @param #CARBO_BASE self
-- @param Point#POINT_VEC2 PointVec2
-- @return #boolean
-function CARGO:IsNear( PointVec2 )
+function CARBO_BASE:IsNear( PointVec2 )
self:F( { PointVec2 } )
local Distance = PointVec2:DistanceFromPointVec2( self.CargoObject:GetPointVec2() )
@@ -245,14 +294,13 @@ end
do -- CARGO_REPRESENTABLE
--- @type CARGO_REPRESENTABLE
- -- @extends #CARGO
+ -- @extends #CARBO_BASE
CARGO_REPRESENTABLE = {
ClassName = "CARGO_REPRESENTABLE"
}
--- CARGO_REPRESENTABLE Constructor.
-- @param #CARGO_REPRESENTABLE self
--- @param Mission#MISSION Mission
-- @param Controllable#Controllable CargoObject
-- @param #string Type
-- @param #string Name
@@ -260,8 +308,8 @@ do -- CARGO_REPRESENTABLE
-- @param #number ReportRadius (optional)
-- @param #number NearRadius (optional)
-- @return #CARGO_REPRESENTABLE
-function CARGO_REPRESENTABLE:New( Mission, CargoObject, Type, Name, Weight, ReportRadius, NearRadius )
- local self = BASE:Inherit( self, CARGO:New( Mission, Type, Name, Weight, ReportRadius, NearRadius ) ) -- #CARGO
+function CARGO_REPRESENTABLE:New( CargoObject, Type, Name, Weight, ReportRadius, NearRadius )
+ local self = BASE:Inherit( self, CARBO_BASE:New( Type, Name, Weight, ReportRadius, NearRadius ) ) -- #CARBO_BASE
self:F( { Type, Name, Weight, ReportRadius, NearRadius } )
@@ -290,7 +338,7 @@ function CARGO_REPRESENTABLE:RouteTo( ToPointVec2, Speed )
return self
end
-end -- CARGO
+end -- CARBO_BASE
do -- CARGO_UNIT
@@ -302,7 +350,6 @@ do -- CARGO_UNIT
--- CARGO_UNIT Constructor.
-- @param #CARGO_UNIT self
--- @param Mission#MISSION Mission
-- @param Unit#UNIT CargoUnit
-- @param #string Type
-- @param #string Name
@@ -310,8 +357,8 @@ do -- CARGO_UNIT
-- @param #number ReportRadius (optional)
-- @param #number NearRadius (optional)
-- @return #CARGO_UNIT
-function CARGO_UNIT:New( Mission, CargoUnit, Type, Name, Weight, ReportRadius, NearRadius )
- local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( Mission, CargoUnit, Type, Name, Weight, ReportRadius, NearRadius ) ) -- #CARGO_UNIT
+function CARGO_UNIT:New( CargoUnit, Type, Name, Weight, ReportRadius, NearRadius )
+ local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( CargoUnit, Type, Name, Weight, ReportRadius, NearRadius ) ) -- #CARGO_UNIT
self:F( { Type, Name, Weight, ReportRadius, NearRadius } )
self:T( CargoUnit )
@@ -555,7 +602,6 @@ do -- CARGO_PACKAGE
--- CARGO_PACKAGE Constructor.
-- @param #CARGO_PACKAGE self
--- @param Mission#MISSION Mission
-- @param Unit#UNIT CargoCarrier The UNIT carrying the package.
-- @param #string Type
-- @param #string Name
@@ -563,8 +609,8 @@ do -- CARGO_PACKAGE
-- @param #number ReportRadius (optional)
-- @param #number NearRadius (optional)
-- @return #CARGO_PACKAGE
-function CARGO_PACKAGE:New( Mission, CargoCarrier, Type, Name, Weight, ReportRadius, NearRadius )
- local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( Mission, CargoCarrier, Type, Name, Weight, ReportRadius, NearRadius ) ) -- #CARGO_PACKAGE
+function CARGO_PACKAGE:New( CargoCarrier, Type, Name, Weight, ReportRadius, NearRadius )
+ local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( CargoCarrier, Type, Name, Weight, ReportRadius, NearRadius ) ) -- #CARGO_PACKAGE
self:F( { Type, Name, Weight, ReportRadius, NearRadius } )
self:T( CargoCarrier )
@@ -770,7 +816,7 @@ end
do -- CARGO_GROUP
--- @type CARGO_GROUP
- -- @extends Cargo#CARGO
+ -- @extends Cargo#CARBO_BASE
-- @field Set#SET_BASE CargoSet A set of cargo objects.
-- @field #string Name A string defining the name of the cargo group. The name is the unique identifier of the cargo.
CARGO_GROUP = {
@@ -787,7 +833,7 @@ do -- CARGO_GROUP
-- @param #number NearRadius (optional)
-- @return #CARGO_GROUP
function CARGO_GROUP:New( CargoSet, Type, Name, ReportRadius, NearRadius )
- local self = BASE:Inherit( self, CARGO:New( Type, Name, 0, ReportRadius, NearRadius ) ) -- #CARGO_GROUP
+ local self = BASE:Inherit( self, CARBO_BASE:New( Type, Name, 0, ReportRadius, NearRadius ) ) -- #CARGO_GROUP
self:F( { Type, Name, ReportRadius, NearRadius } )
self.CargoSet = CargoSet
diff --git a/Moose Development/Moose/Process_PatrolZone.lua b/Moose Development/Moose/Fsm/Patrol.lua
similarity index 70%
rename from Moose Development/Moose/Process_PatrolZone.lua
rename to Moose Development/Moose/Fsm/Patrol.lua
index 0f75430c6..183e730e5 100644
--- a/Moose Development/Moose/Process_PatrolZone.lua
+++ b/Moose Development/Moose/Fsm/Patrol.lua
@@ -1,10 +1,10 @@
---- This module contains the PROCESS\_PATROLZONE class.
+--- (AI) (FSM) Make AI patrol routes or zones.
--
-- ===
--
--- 1) @{#PROCESS_PATROLZONE} class, extends @{StateMachine#STATEMACHINE}
+-- 1) @{#PATROLZONE} class, extends @{StateMachine#STATEMACHINE}
-- ================================================================
--- The @{#PROCESS_PATROLZONE} class implements the core functions to patrol a @{Zone} by an AIR @{Controllable}.
+-- The @{#PATROLZONE} class implements the core functions to patrol a @{Zone} by an AIR @{Controllable} @{Group}.
-- The patrol algorithm works that for each airplane patrolling, upon arrival at the patrol zone,
-- a random point is selected as the route point within the 3D space, within the given boundary limits.
-- The airplane will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
@@ -12,47 +12,47 @@
-- This cycle will continue until a fuel treshold has been reached by the airplane.
-- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
--
--- 1.1) PROCESS\_PATROLZONE constructor:
+-- 1.1) PATROLZONE constructor:
-- ----------------------------
--
--- * @{#PROCESS_PATROLZONE.New}(): Creates a new PROCESS\_PATROLZONE object.
+-- * @{#PATROLZONE.New}(): Creates a new PATROLZONE object.
--
--- 1.2) PROCESS\_PATROLZONE state machine:
+-- 1.2) PATROLZONE state machine:
-- ----------------------------------
--- The PROCESS\_PATROLZONE is a state machine: it manages the different events and states of the AIControllable it is controlling.
+-- The PATROLZONE is a state machine: it manages the different events and states of the AIControllable it is controlling.
--
--- ### 1.2.1) PROCESS\_PATROLZONE Events:
+-- ### 1.2.1) PATROLZONE Events:
--
--- * @{#PROCESS_PATROLZONE.Route}( AIControllable ): A new 3D route point is selected and the AIControllable will fly towards that point with the given speed.
--- * @{#PROCESS_PATROLZONE.Patrol}( AIControllable ): The AIControllable reports it is patrolling. This event is called every 30 seconds.
--- * @{#PROCESS_PATROLZONE.RTB}( AIControllable ): The AIControllable will report return to base.
--- * @{#PROCESS_PATROLZONE.End}( AIControllable ): The end of the PROCESS\_PATROLZONE process.
--- * @{#PROCESS_PATROLZONE.Dead}( AIControllable ): The AIControllable is dead. The PROCESS\_PATROLZONE process will be ended.
+-- * @{#PATROLZONE.Route}( AIControllable ): A new 3D route point is selected and the AIControllable will fly towards that point with the given speed.
+-- * @{#PATROLZONE.Patrol}( AIControllable ): The AIControllable reports it is patrolling. This event is called every 30 seconds.
+-- * @{#PATROLZONE.RTB}( AIControllable ): The AIControllable will report return to base.
+-- * @{#PATROLZONE.End}( AIControllable ): The end of the PATROLZONE process.
+-- * @{#PATROLZONE.Dead}( AIControllable ): The AIControllable is dead. The PATROLZONE process will be ended.
--
--- ### 1.2.2) PROCESS\_PATROLZONE States:
+-- ### 1.2.2) PATROLZONE States:
--
-- * **Route**: A new 3D route point is selected and the AIControllable will fly towards that point with the given speed.
--- * **Patrol**: The AIControllable is patrolling. This state is set every 30 seconds, so every 30 seconds, a state transition function can be used.
+-- * **Patrol**: The AIControllable is patrolling. This state is set every 30 seconds, so every 30 seconds, a state transition method can be used.
-- * **RTB**: The AIControllable reports it wants to return to the base.
-- * **Dead**: The AIControllable is dead ...
-- * **End**: The process has come to an end.
--
--- ### 1.2.3) PROCESS\_PATROLZONE state transition functions:
+-- ### 1.2.3) PATROLZONE 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 functions will be called by the state machine:
+-- There are 2 moments when state transition methods 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!
+-- 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 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.
+-- 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.
--
--- An example how to manage a state transition for an PROCESS\_PATROLZONE object **Patrol** for the state **RTB**:
+-- An example how to manage a state transition for an PATROLZONE object **Patrol** for the state **RTB**:
--
-- local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone" )
-- local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
@@ -60,46 +60,46 @@
-- local PatrolSpawn = SPAWN:New( "Patrol Group" )
-- local PatrolGroup = PatrolSpawn:Spawn()
--
--- local Patrol = PROCESS_PATROLZONE:New( PatrolZone, 3000, 6000, 300, 600 )
+-- local Patrol = PATROLZONE:New( PatrolZone, 3000, 6000, 300, 600 )
-- Patrol:SetControllable( PatrolGroup )
-- Patrol:ManageFuel( 0.2, 60 )
--
--- **OnBefore**RTB( AIGroup ) will be called by the PROCESS\_PATROLZONE object when the AIGroup reports RTB, but **before** the RTB default action is processed by the PROCESS_PATROLZONE object.
+-- **OnBefore**RTB( AIGroup ) will be called by the PATROLZONE object when the AIGroup reports RTB, but **before** the RTB default action is processed by the PATROLZONE object.
--
--- --- State transition function for the PROCESS\_PATROLZONE **Patrol** object
--- -- @param #PROCESS_PATROLZONE self
+-- --- State transition function for the PATROLZONE **Patrol** object
+-- -- @param #PATROLZONE self
-- -- @param Controllable#CONTROLLABLE AIGroup
--- -- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
+-- -- @return #boolean If false is returned, then the OnAfter state transition method will not be called.
-- function Patrol:OnBeforeRTB( AIGroup )
-- AIGroup:MessageToRed( "Returning to base", 20 )
-- end
--
--- **OnAfter**RTB( AIGroup ) will be called by the PROCESS\_PATROLZONE object when the AIGroup reports RTB, but **after** the RTB default action was processed by the PROCESS_PATROLZONE object.
+-- **OnAfter**RTB( AIGroup ) will be called by the PATROLZONE object when the AIGroup reports RTB, but **after** the RTB default action was processed by the PATROLZONE object.
--
--- --- State transition function for the PROCESS\_PATROLZONE **Patrol** object
--- -- @param #PROCESS_PATROLZONE self
+-- --- State transition function for the PATROLZONE **Patrol** object
+-- -- @param #PATROLZONE self
-- -- @param Controllable#CONTROLLABLE AIGroup
-- -- @return #Controllable#CONTROLLABLE The new AIGroup object that is set to be patrolling the zone.
-- function Patrol:OnAfterRTB( AIGroup )
-- return PatrolSpawn:Spawn()
-- end
--
--- 1.3) Manage the PROCESS\_PATROLZONE parameters:
+-- 1.3) Manage the PATROLZONE parameters:
-- ------------------------------------------
--- The following methods are available to modify the parameters of a PROCESS\_PATROLZONE object:
+-- The following methods are available to modify the parameters of a PATROLZONE object:
--
--- * @{#PROCESS_PATROLZONE.SetControllable}(): Set the AIControllable.
--- * @{#PROCESS_PATROLZONE.GetControllable}(): Get the AIControllable.
--- * @{#PROCESS_PATROLZONE.SetSpeed}(): Set the patrol speed of the AI, for the next patrol.
--- * @{#PROCESS_PATROLZONE.SetAltitude}(): Set altitude of the AI, for the next patrol.
+-- * @{#PATROLZONE.SetControllable}(): Set the AIControllable.
+-- * @{#PATROLZONE.GetControllable}(): Get the AIControllable.
+-- * @{#PATROLZONE.SetSpeed}(): Set the patrol speed of the AI, for the next patrol.
+-- * @{#PATROLZONE.SetAltitude}(): Set altitude of the AI, for the next patrol.
--
--- 1.3) Manage the out of fuel in the PROCESS\_PATROLZONE:
+-- 1.3) Manage the out of fuel in the PATROLZONE:
-- ----------------------------------------------
-- When the AIControllable is out of fuel, it is required that a new AIControllable is started, before the old AIControllable can return to the home base.
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
--- When the fuel treshold is reached, the AIControllable will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the PROCESS\_PATROLZONE.
+-- When the fuel treshold is reached, the AIControllable will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the PATROLZONE.
-- Once the time is finished, the old AIControllable will return to the base.
--- Use the method @{#PROCESS_PATROLZONE.ManageFuel}() to have this proces in place.
+-- Use the method @{#PATROLZONE.ManageFuel}() to have this proces in place.
--
-- ====
--
@@ -113,9 +113,7 @@
--
-- Hereby the change log:
--
--- 2016-08-17: PROCESS\_PATROLZONE:New( **PatrolSpawn,** PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed ) replaces PROCESS\_PATROLZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed )
---
--- 2016-07-01: Initial class and API.
+-- 2016-09-01: Initial class and API.
--
-- ===
--
@@ -132,25 +130,25 @@
-- * **FlightControl**: Design & Programming.
--
--
--- @module Process_PatrolZone
+-- @module Patrol
-- State Transition Functions
--- OnBefore State Transition Function
--- @function [parent=#PROCESS_PATROLZONE] OnBeforeRoute
--- @param #PROCESS_PATROLZONE self
+-- @function [parent=#PATROLZONE] OnBeforeRoute
+-- @param #PATROLZONE self
-- @param Controllable#CONTROLLABLE Controllable
-- @return #boolean
--- OnAfter State Transition Function
--- @function [parent=#PROCESS_PATROLZONE] OnAfterRoute
--- @param #PROCESS_PATROLZONE self
+-- @function [parent=#PATROLZONE] OnAfterRoute
+-- @param #PATROLZONE self
-- @param Controllable#CONTROLLABLE Controllable
---- PROCESS\_PATROLZONE class
--- @type PROCESS_PATROLZONE
+--- PATROLZONE class
+-- @type PATROLZONE
-- @field Controllable#CONTROLLABLE AIControllable The @{Controllable} patrolling.
-- @field Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
-- @field DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
@@ -158,26 +156,26 @@
-- @field DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
-- @field DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
-- @extends StateMachine#STATEMACHINE_CONTROLLABLE
-PROCESS_PATROLZONE = {
- ClassName = "PROCESS_PATROLZONE",
+PATROLZONE = {
+ ClassName = "PATROLZONE",
}
---- Creates a new PROCESS\_PATROLZONE object
--- @param #PROCESS_PATROLZONE self
+--- Creates a new PATROLZONE object
+-- @param #PATROLZONE self
-- @param Zone#ZONE_BASE PatrolZone The @{Zone} where the patrol needs to be executed.
-- @param DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
-- @param DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
-- @param DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
--- @return #PROCESS_PATROLZONE self
+-- @return #PATROLZONE self
-- @usage
--- -- Define a new PROCESS_PATROLZONE Object. This PatrolArea will patrol an AIControllable within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
+-- -- Define a new PATROLZONE Object. This PatrolArea will patrol an AIControllable within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
-- PatrolZone = ZONE:New( 'PatrolZone' )
-- PatrolSpawn = SPAWN:New( 'Patrol Group' )
--- PatrolArea = PROCESS_PATROLZONE:New( PatrolZone, 3000, 6000, 600, 900 )
-function PROCESS_PATROLZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed )
+-- PatrolArea = PATROLZONE:New( PatrolZone, 3000, 6000, 600, 900 )
+function PATROLZONE:New( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed )
local FSMT = {
initial = 'None',
@@ -207,11 +205,11 @@ end
--- Sets (modifies) the minimum and maximum speed of the patrol.
--- @param #PROCESS_PATROLZONE self
+-- @param #PATROLZONE self
-- @param DCSTypes#Speed PatrolMinSpeed The minimum speed of the @{Controllable} in km/h.
-- @param DCSTypes#Speed PatrolMaxSpeed The maximum speed of the @{Controllable} in km/h.
--- @return #PROCESS_PATROLZONE self
-function PROCESS_PATROLZONE:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
+-- @return #PATROLZONE self
+function PATROLZONE:SetSpeed( PatrolMinSpeed, PatrolMaxSpeed )
self:F2( { PatrolMinSpeed, PatrolMaxSpeed } )
self.PatrolMinSpeed = PatrolMinSpeed
@@ -221,11 +219,11 @@ end
--- Sets the floor and ceiling altitude of the patrol.
--- @param #PROCESS_PATROLZONE self
+-- @param #PATROLZONE self
-- @param DCSTypes#Altitude PatrolFloorAltitude The lowest altitude in meters where to execute the patrol.
-- @param DCSTypes#Altitude PatrolCeilingAltitude The highest altitude in meters where to execute the patrol.
--- @return #PROCESS_PATROLZONE self
-function PROCESS_PATROLZONE:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
+-- @return #PATROLZONE self
+function PATROLZONE:SetAltitude( PatrolFloorAltitude, PatrolCeilingAltitude )
self:F2( { PatrolFloorAltitude, PatrolCeilingAltitude } )
self.PatrolFloorAltitude = PatrolFloorAltitude
@@ -238,7 +236,7 @@ end
function _NewPatrolRoute( AIControllable )
AIControllable:T( "NewPatrolRoute" )
- local PatrolZone = AIControllable:GetState( AIControllable, "PatrolZone" ) -- PatrolZone#PROCESS_PATROLZONE
+ local PatrolZone = AIControllable:GetState( AIControllable, "PatrolZone" ) -- PatrolZone#PATROLZONE
PatrolZone:__Route( 1 )
end
@@ -247,13 +245,13 @@ end
--- When the AIControllable is out of fuel, it is required that a new AIControllable is started, before the old AIControllable can return to the home base.
-- Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
--- When the fuel treshold is reached, the AIControllable will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the PROCESS\_PATROLZONE.
+-- When the fuel treshold is reached, the AIControllable will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the PATROLZONE.
-- Once the time is finished, the old AIControllable will return to the base.
--- @param #PROCESS_PATROLZONE self
+-- @param #PATROLZONE self
-- @param #number PatrolFuelTresholdPercentage The treshold in percentage (between 0 and 1) when the AIControllable is considered to get out of fuel.
-- @param #number PatrolOutOfFuelOrbitTime The amount of seconds the out of fuel AIControllable will orbit before returning to the base.
--- @return #PROCESS_PATROLZONE self
-function PROCESS_PATROLZONE:ManageFuel( PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime )
+-- @return #PATROLZONE self
+function PATROLZONE:ManageFuel( PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime )
self.PatrolManageFuel = true
self.PatrolFuelTresholdPercentage = PatrolFuelTresholdPercentage
@@ -263,9 +261,9 @@ function PROCESS_PATROLZONE:ManageFuel( PatrolFuelTresholdPercentage, PatrolOutO
end
--- Defines a new patrol route using the @{Process_PatrolZone} parameters and settings.
--- @param #PROCESS_PATROLZONE self
--- @return #PROCESS_PATROLZONE self
-function PROCESS_PATROLZONE:onenterRoute()
+-- @param #PATROLZONE self
+-- @return #PATROLZONE self
+function PATROLZONE:onenterRoute()
self:F2()
@@ -360,8 +358,8 @@ function PROCESS_PATROLZONE:onenterRoute()
end
---- @param #PROCESS_PATROLZONE self
-function PROCESS_PATROLZONE:onenterPatrol()
+--- @param #PATROLZONE self
+function PATROLZONE:onenterPatrol()
self:F2()
if self.Controllable and self.Controllable:IsAlive() then
diff --git a/Moose Development/Moose/Process.lua b/Moose Development/Moose/Fsm/Process.lua
similarity index 51%
rename from Moose Development/Moose/Process.lua
rename to Moose Development/Moose/Fsm/Process.lua
index 6c728c301..059c2a2dc 100644
--- a/Moose Development/Moose/Process.lua
+++ b/Moose Development/Moose/Fsm/Process.lua
@@ -2,17 +2,13 @@
--- The PROCESS class
-- @type PROCESS
--- @field Scheduler#SCHEDULER ProcessScheduler
--- @field Unit#UNIT ProcessUnit
-- @field Group#GROUP ProcessGroup
-- @field Menu#MENU_GROUP MissionMenu
-- @field Task#TASK_BASE Task
--- @field StateMachine#STATEMACHINE_TASK Fsm
-- @field #string ProcessName
--- @extends Base#BASE
+-- @extends StateMachine#STATEMACHINE_CONTROLLABLE
PROCESS = {
- ClassName = "TASK",
- ProcessScheduler = nil,
+ ClassName = "PROCESS",
NextEvent = nil,
Scores = {},
}
@@ -23,66 +19,55 @@ PROCESS = {
-- @param Task#TASK_BASE Task
-- @param Unit#UNIT ProcessUnit
-- @return #PROCESS self
-function PROCESS:New( ProcessName, Task, ProcessUnit )
- local self = BASE:Inherit( self, BASE:New() )
+function PROCESS:New( FSMT, ProcessUnit, ProcessName )
+ local self = BASE:Inherit( self, STATEMACHINE_CONTROLLABLE:New( FSMT, ProcessUnit ) )
self:F()
- self.ProcessUnit = ProcessUnit
self.ProcessGroup = ProcessUnit:GetGroup()
- self.MissionMenu = Task.Mission:GetMissionMenu( self.ProcessGroup )
- self.Task = Task
+ --self.MissionMenu = Task.Mission:GetMissionMenu( self.ProcessGroup )
self.ProcessName = ProcessName
- self.ProcessScheduler = SCHEDULER:New()
-
return self
end
---- @param #PROCESS self
-function PROCESS:NextEvent( NextEvent, ... )
- self:F(self.ProcessName)
- self.ProcessScheduler:Schedule( self.Fsm, NextEvent, arg, 1 ) -- This schedules the next event, but only if scheduling is activated.
-end
-
---- @param #PROCESS self
-function PROCESS:StopEvents()
- self:F( { "Stop Process ", self.ProcessName } )
- self.ProcessScheduler:Stop()
-end
-
--- Adds a score for the PROCESS to be achieved.
-- @param #PROCESS self
--- @param #string ProcessStatus is the status of the PROCESS when the score needs to be given.
+-- @param Task#TASK_BASE Task The task for which the process needs to account score.
+-- @param #string ProcessStatus is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).
-- @param #string ScoreText is a text describing the score that is given according the status.
-- @param #number Score is a number providing the score of the status.
-- @return #PROCESS self
-function PROCESS:AddScore( ProcessStatus, ScoreText, Score )
+function PROCESS:AddScore( Task, ProcessStatus, ScoreText, Score )
self:F2( { ProcessStatus, ScoreText, Score } )
self.Scores[ProcessStatus] = self.Scores[ProcessStatus] or {}
self.Scores[ProcessStatus].ScoreText = ScoreText
self.Scores[ProcessStatus].Score = Score
+ self.Scores[ProcessStatus].Task = Task
+
return self
end
--- StateMachine callback function for a PROCESS
-- @param #PROCESS self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
+-- @param Controllable#CONTROLLABLE ProcessUnit
-- @param #string Event
-- @param #string From
-- @param #string To
-function PROCESS:OnStateChange( Fsm, Event, From, To )
- self:E( { self.ProcessName, Event, From, To, self.ProcessUnit.UnitName } )
+function PROCESS:OnStateChange( ProcessUnit, Event, From, To )
+ self:E( { self.ProcessName, Event, From, To, ProcessUnit.UnitName } )
if self:IsTrace() then
MESSAGE:New( "Process " .. self.ProcessName .. " : " .. Event .. " changed to state " .. To, 15 ):ToAll()
end
+ -- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
if self.Scores[To] then
-
- local Scoring = self.Task:GetScoring()
+
+ local Task = self.Scores[To].Task
+ local Scoring = Task:GetScoring()
if Scoring then
- Scoring:_AddMissionTaskScore( self.Task.Mission, self.ProcessUnit, self.Scores[To].ScoreText, self.Scores[To].Score )
+ Scoring:_AddMissionTaskScore( Task.Mission, ProcessUnit, self.Scores[To].ScoreText, self.Scores[To].Score )
end
end
end
diff --git a/Moose Development/Moose/Process_JTAC.lua b/Moose Development/Moose/Fsm/Process_JTAC.lua
similarity index 100%
rename from Moose Development/Moose/Process_JTAC.lua
rename to Moose Development/Moose/Fsm/Process_JTAC.lua
diff --git a/Moose Development/Moose/Process_Pickup.lua b/Moose Development/Moose/Fsm/Process_Pickup.lua
similarity index 100%
rename from Moose Development/Moose/Process_Pickup.lua
rename to Moose Development/Moose/Fsm/Process_Pickup.lua
diff --git a/Moose Development/Moose/Process_Smoke.lua b/Moose Development/Moose/Fsm/Process_Smoke.lua
similarity index 58%
rename from Moose Development/Moose/Process_Smoke.lua
rename to Moose Development/Moose/Fsm/Process_Smoke.lua
index b21b990df..4bcf480f7 100644
--- a/Moose Development/Moose/Process_Smoke.lua
+++ b/Moose Development/Moose/Fsm/Process_Smoke.lua
@@ -21,13 +21,7 @@ do -- PROCESS_SMOKE_TARGETS
-- @return #PROCESS_SMOKE_TARGETS self
function PROCESS_SMOKE_TARGETS:New( Task, ProcessUnit, TargetSetUnit, TargetZone )
- -- Inherits from BASE
- local self = BASE:Inherit( self, PROCESS:New( "ASSIGN_MENU_ACCEPT", Task, ProcessUnit ) ) -- #PROCESS_SMOKE_TARGETS
-
- self.TargetSetUnit = TargetSetUnit
- self.TargetZone = TargetZone
-
- self.Fsm = STATEMACHINE_PROCESS:New( self, {
+ local FSMT = {
initial = 'None',
events = {
{ name = 'Start', from = 'None', to = 'AwaitSmoke' },
@@ -44,49 +38,56 @@ do -- PROCESS_SMOKE_TARGETS
},
endstates = {
},
- } )
+ }
+
+ -- Inherits from BASE
+ local self = BASE:Inherit( self, PROCESS:New( FSMT, ProcessUnit, "SMOKE_TARGETS" ) ) -- #PROCESS_SMOKE_TARGETS
+
+ self.TargetSetUnit = TargetSetUnit
+ self.TargetZone = TargetZone
+
return self
end
- --- StateMachine callback function for a TASK2
+ --- StateMachine callback function
-- @param #PROCESS_SMOKE_TARGETS self
- -- @param StateMachine#STATEMACHINE_TASK Fsm
+ -- @param Controllable#CONTROLLABLE ProcessUnit
-- @param #string Event
-- @param #string From
-- @param #string To
- function PROCESS_SMOKE_TARGETS:OnStart( Fsm, Event, From, To )
- self:E( { Event, From, To, self.ProcessUnit.UnitName} )
+ function PROCESS_SMOKE_TARGETS:OnStart( ProcessUnit, Event, From, To )
+ self:E( { Event, From, To, ProcessUnit.UnitName} )
self:E("Set smoke menu")
- local ProcessGroup = self.ProcessUnit:GetGroup()
- local MissionMenu = self.Task.Mission:GetMissionMenu( ProcessGroup )
+ local ProcessGroup = ProcessUnit:GetGroup()
+ --local MissionMenu = self.Task.Mission:GetMissionMenu( ProcessGroup )
local function MenuSmoke( MenuParam )
self:E( MenuParam )
local self = MenuParam.self
local SmokeColor = MenuParam.SmokeColor
self.SmokeColor = SmokeColor
- self:NextEvent( self.Fsm.Next )
+ self:__Next( 1 )
end
- self.Menu = MENU_GROUP:New( ProcessGroup, "Target acquisition", MissionMenu )
- self.MenuSmokeBlue = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop blue smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.Blue } )
- self.MenuSmokeGreen = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop green smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.Green } )
- self.MenuSmokeOrange = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop Orange smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.Orange } )
- self.MenuSmokeRed = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop Red smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.Red } )
- self.MenuSmokeWhite = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop White smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.White } )
+ --self.Menu = MENU_GROUP:New( ProcessGroup, "Target acquisition", MissionMenu )
+ --self.MenuSmokeBlue = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop blue smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.Blue } )
+ --self.MenuSmokeGreen = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop green smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.Green } )
+ --self.MenuSmokeOrange = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop Orange smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.Orange } )
+ --self.MenuSmokeRed = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop Red smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.Red } )
+ --self.MenuSmokeWhite = MENU_GROUP_COMMAND:New( ProcessGroup, "Drop White smoke on targets", self.Menu, MenuSmoke, { self = self, SmokeColor = SMOKECOLOR.White } )
end
- --- StateMachine callback function for a TASK2
+ --- StateMachine callback function
-- @param #PROCESS_SMOKE_TARGETS self
- -- @param StateMachine#STATEMACHINE_PROCESS Fsm
+ -- @param Controllable#CONTROLLABLE ProcessUnit
-- @param #string Event
-- @param #string From
-- @param #string To
- function PROCESS_SMOKE_TARGETS:OnSmoking( Fsm, Event, From, To )
- self:E( { Event, From, To, self.ProcessUnit.UnitName} )
+ function PROCESS_SMOKE_TARGETS:OnSmoking( ProcessUnit, Event, From, To )
+ self:E( { Event, From, To, ProcessUnit.UnitName} )
self.TargetSetUnit:ForEachUnit(
--- @param Unit#UNIT SmokeUnit
diff --git a/Moose Development/Moose/Fsm/Route.lua b/Moose Development/Moose/Fsm/Route.lua
new file mode 100644
index 000000000..69287d868
--- /dev/null
+++ b/Moose Development/Moose/Fsm/Route.lua
@@ -0,0 +1,233 @@
+--- (SP) (MP) (FSM) Route AI or players through waypoints or to zones.
+--
+-- ===
+--
+-- # @{#ROUTE} FSM class, extends @{Process#PROCESS}
+--
+-- ## ROUTE 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.
+--
+-- ### ROUTE **Events**:
+--
+-- These are the events defined in this class:
+--
+-- * **Start**: The process is started. The process will go into the Report state.
+-- * **Report**: The process is reporting to the player the route to be followed.
+-- * **Route**: The process is routing the controllable.
+-- * **Pause**: The process is pausing the route of the controllable.
+-- * **Arrive**: The controllable has arrived at a route point.
+-- * **More**: There are more route points that need to be followed. The process will go back into the Report state.
+-- * **NoMore**: There are no more route points that need to be followed. The process will go into the Success state.
+--
+-- ### ROUTE **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.
+--
+-- ### ROUTE **States**:
+--
+-- * **None**: The controllable did not receive route commands.
+-- * **Arrived (*)**: The controllable has arrived at a route point.
+-- * **Aborted (*)**: The controllable has aborted the route path.
+-- * **Routing**: The controllable is understay to the route point.
+-- * **Pausing**: The process is pausing the routing. AI air will go into hover, AI ground will stop moving. Players can fly around.
+-- * **Success (*)**: All route points were reached.
+-- * **Failed (*)**: The process has failed.
+--
+-- (*) End states of the process.
+--
+-- ### ROUTE 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) @{#ROUTE_ZONE} class, extends @{Route#ROUTE}
+--
+-- The ROUTE_ZONE class implements the core functions to route an AIR @{Controllable} player @{Unit} to a @{Zone}.
+-- The player receives on perioding times messages with the coordinates of the route to follow.
+-- Upon arrival at the zone, a confirmation of arrival is sent, and the process will be ended.
+--
+-- # 1.1) ROUTE_ZONE constructor:
+--
+-- * @{#ROUTE_ZONE.New}(): Creates a new ROUTE_ZONE object.
+--
+-- ===
+--
+-- @module Route
+
+
+do -- ROUTE
+
+ --- ROUTE class
+ -- @type ROUTE
+ -- @field Task#TASK TASK
+ -- @field Unit#UNIT ProcessUnit
+ -- @field Zone#ZONE_BASE TargetZone
+ -- @extends Task2#TASK2
+ ROUTE = {
+ ClassName = "ROUTE",
+ }
+
+
+ --- Creates a new routing state machine. The task will route a CLIENT to a ZONE until the CLIENT is within that ZONE.
+ -- @param #ROUTE self
+ -- @return #ROUTE self
+ function ROUTE:New()
+
+
+ local FSMT = {
+ initial = 'None',
+ events = {
+ { name = 'Start', from = 'None', to = 'Routing' },
+ { name = 'Report', from = '*', to = 'Reporting' },
+ { name = 'Route', from = '*', to = 'Routing' },
+ { name = 'Pause', from = 'Routing', to = 'Pausing' },
+ { name = 'Abort', from = '*', to = 'Aborted' },
+ { name = 'Arrive', from = 'Routing', to = 'Arrived' },
+ { name = 'Success', from = 'Arrived', to = 'Success' },
+ { name = 'Fail', from = '*', to = 'Failed' },
+ },
+ endstates = {
+ 'Arrived', 'Failed', 'Success'
+ },
+ }
+
+ -- Inherits from BASE
+ local self = BASE:Inherit( self, PROCESS:New( FSMT, "ROUTE" ) ) -- #ROUTE
+
+ self.DisplayInterval = 30
+ self.DisplayCount = 30
+ self.DisplayMessage = true
+ self.DisplayTime = 10 -- 10 seconds is the default
+ self.DisplayCategory = "HQ" -- Route is the default display category
+
+ return self
+ end
+
+ --- Task Events
+
+ --- StateMachine callback function
+ -- @param #ROUTE self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ROUTE:onafterStart( ProcessUnit, Event, From, To )
+
+ self:__Route( 1 )
+ end
+
+ --- Check if the controllable has arrived.
+ -- @param #ROUTE self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @return #boolean
+ function ROUTE:HasArrived( ProcessUnit )
+ return false
+ end
+
+ --- StateMachine callback function
+ -- @param #ROUTE self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ROUTE:onafterRoute( ProcessUnit, Event, From, To )
+
+ if ProcessUnit:IsAlive() then
+ local HasArrived = self:HasArrived( ProcessUnit )
+ if self.DisplayCount >= self.DisplayInterval then
+ self:T( { HasArrived = HasArrived } )
+ if not HasArrived then
+ self:__Report( 1 )
+ end
+ self.DisplayCount = 1
+ else
+ self.DisplayCount = self.DisplayCount + 1
+ end
+
+ self:T( { DisplayCount = self.DisplayCount } )
+ self:__Route( 1 )
+
+ return HasArrived -- if false, then the event will not be executed...
+ end
+
+ return false
+
+ end
+
+end -- ROUTE
+
+
+
+do -- ROUTE_ZONE
+
+ --- ROUTE_ZONE class
+ -- @type ROUTE_ZONE
+ -- @field Task#TASK TASK
+ -- @field Unit#UNIT ProcessUnit
+ -- @field Zone#ZONE_BASE TargetZone
+ -- @extends Task2#TASK2
+ ROUTE_ZONE = {
+ ClassName = "ROUTE_ZONE",
+ }
+
+
+ --- Creates a new routing state machine. The task will route a controllable to a ZONE until the controllable is within that ZONE.
+ -- @param #ROUTE_ZONE self
+ -- @param Zone#ZONE_BASE TargetZone
+ -- @return #ROUTE_ZONE self
+ function ROUTE_ZONE:New( TargetZone )
+
+ local self = BASE:Inherit( self, ROUTE:New() ) -- #ROUTE_ZONE
+
+ self.TargetZone = TargetZone
+
+ return self
+ end
+
+ --- Method override to check if the controllable has arrived.
+ -- @param #ROUTE self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @return #boolean
+ function ROUTE_ZONE:HasArrived( ProcessUnit )
+ return ProcessUnit:IsInZone( self.TargetZone )
+ end
+
+ --- Task Events
+
+ --- StateMachine callback function
+ -- @param #ROUTE_ZONE self
+ -- @param Controllable#CONTROLLABLE ProcessUnit
+ -- @param #string Event
+ -- @param #string From
+ -- @param #string To
+ function ROUTE_ZONE:onenterReporting( ProcessUnit, Event, From, To )
+
+ local ZoneVec2 = self.TargetZone:GetVec2()
+ local ZonePointVec2 = POINT_VEC2:New( ZoneVec2.x, ZoneVec2.y )
+ local TaskUnitVec2 = ProcessUnit:GetVec2()
+ local TaskUnitPointVec2 = POINT_VEC2:New( TaskUnitVec2.x, TaskUnitVec2.y )
+ local RouteText = ProcessUnit:GetCallsign() .. ": Route to " .. TaskUnitPointVec2:GetBRText( ZonePointVec2 ) .. " km to target."
+ MESSAGE:New( RouteText, self.DisplayTime, self.DisplayCategory ):ToGroup( ProcessUnit:GetGroup() )
+ end
+
+end -- ROUTE_ZONE
diff --git a/Moose Development/Moose/AIBalancer.lua b/Moose Development/Moose/Functional/AIBalancer.lua
similarity index 98%
rename from Moose Development/Moose/AIBalancer.lua
rename to Moose Development/Moose/Functional/AIBalancer.lua
index 5ead70e44..fc52ae994 100644
--- a/Moose Development/Moose/AIBalancer.lua
+++ b/Moose Development/Moose/Functional/AIBalancer.lua
@@ -10,7 +10,7 @@
-- of the underlying AI GROUPS.
--
-- The parent class @{StateMachine#STATEMACHINE_SET} manages the functionality to control the Finite State Machine (FSM)
--- and calls for each event the state transition functions providing the internal @{StateMachine#STATEMACHINE_SET.Set} object containing the
+-- and calls for each event the state transition methods providing the internal @{StateMachine#STATEMACHINE_SET.Set} object containing the
-- SET_GROUP and additional event parameters provided during the event.
--
-- 1.1) AIBALANCER construction method
diff --git a/Moose Development/Moose/AirbasePolice.lua b/Moose Development/Moose/Functional/AirbasePolice.lua
similarity index 100%
rename from Moose Development/Moose/AirbasePolice.lua
rename to Moose Development/Moose/Functional/AirbasePolice.lua
diff --git a/Moose Development/Moose/CleanUp.lua b/Moose Development/Moose/Functional/CleanUp.lua
similarity index 100%
rename from Moose Development/Moose/CleanUp.lua
rename to Moose Development/Moose/Functional/CleanUp.lua
diff --git a/Moose Development/Moose/Detection.lua b/Moose Development/Moose/Functional/Detection.lua
similarity index 100%
rename from Moose Development/Moose/Detection.lua
rename to Moose Development/Moose/Functional/Detection.lua
diff --git a/Moose Development/Moose/Escort.lua b/Moose Development/Moose/Functional/Escort.lua
similarity index 100%
rename from Moose Development/Moose/Escort.lua
rename to Moose Development/Moose/Functional/Escort.lua
diff --git a/Moose Development/Moose/MissileTrainer.lua b/Moose Development/Moose/Functional/MissileTrainer.lua
similarity index 100%
rename from Moose Development/Moose/MissileTrainer.lua
rename to Moose Development/Moose/Functional/MissileTrainer.lua
diff --git a/Moose Development/Moose/Movement.lua b/Moose Development/Moose/Functional/Movement.lua
similarity index 100%
rename from Moose Development/Moose/Movement.lua
rename to Moose Development/Moose/Functional/Movement.lua
diff --git a/Moose Development/Moose/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua
similarity index 100%
rename from Moose Development/Moose/Scoring.lua
rename to Moose Development/Moose/Functional/Scoring.lua
diff --git a/Moose Development/Moose/Sead.lua b/Moose Development/Moose/Functional/Sead.lua
similarity index 100%
rename from Moose Development/Moose/Sead.lua
rename to Moose Development/Moose/Functional/Sead.lua
diff --git a/Moose Development/Moose/Spawn.lua b/Moose Development/Moose/Functional/Spawn.lua
similarity index 100%
rename from Moose Development/Moose/Spawn.lua
rename to Moose Development/Moose/Functional/Spawn.lua
diff --git a/Moose Development/Moose/Moose.lua b/Moose Development/Moose/Moose.lua
index 76ec1a202..cf72666e0 100644
--- a/Moose Development/Moose/Moose.lua
+++ b/Moose Development/Moose/Moose.lua
@@ -1,61 +1,60 @@
--- The main include file for the MOOSE system.
--- Core Routines
-Include.File( "Routines" )
-Include.File( "Utils" )
+Include.File( "Utilities/Routines" )
+Include.File( "Utilities/Utils" )
--- Core Classes
-Include.File( "Base" )
-Include.File( "Object" )
-Include.File( "Identifiable" )
-Include.File( "Positionable" )
-Include.File( "Controllable" )
-Include.File( "Scheduler" )
-Include.File( "Event" )
-Include.File( "Menu" )
-Include.File( "Group" )
-Include.File( "Unit" )
-Include.File( "Zone" )
-Include.File( "Client" )
-Include.File( "Static" )
-Include.File( "Airbase" )
-Include.File( "Database" )
-Include.File( "Set" )
-Include.File( "Point" )
-Include.File( "Scoring" )
+Include.File( "Core/Base" )
+Include.File( "Core/Scheduler" )
+Include.File( "Core/Event" )
+Include.File( "Core/Menu" )
+Include.File( "Core/Zone" )
+Include.File( "Core/Database" )
+Include.File( "Core/Set" )
+Include.File( "Core/Point" )
+Include.File( "Core/Message" )
+Include.File( "Core/StateMachine" )
+
+--- Wrapper Classes
+Include.File( "Wrapper/Object" )
+Include.File( "Wrapper/Identifiable" )
+Include.File( "Wrapper/Positionable" )
+Include.File( "Wrapper/Controllable" )
+Include.File( "Wrapper/Group" )
+Include.File( "Wrapper/Unit" )
+Include.File( "Wrapper/Client" )
+Include.File( "Wrapper/Static" )
+Include.File( "Wrapper/Airbase" )
--- Functional Classes
-Include.File( "Cargo" )
-Include.File( "Message" )
-Include.File( "Mission" )
-Include.File( "CleanUp" )
-Include.File( "Spawn" )
-Include.File( "Movement" )
-Include.File( "Sead" )
-Include.File( "Escort" )
-Include.File( "MissileTrainer" )
-Include.File( "AirbasePolice" )
-Include.File( "Detection" )
+Include.File( "Functional/Scoring" )
+Include.File( "Functional/CleanUp" )
+Include.File( "Functional/Spawn" )
+Include.File( "Functional/Movement" )
+Include.File( "Functional/Sead" )
+Include.File( "Functional/Escort" )
+Include.File( "Functional/MissileTrainer" )
+Include.File( "Functional/AirbasePolice" )
+Include.File( "Functional/Detection" )
+Include.File( "Functional/AIBalancer" )
+
+--- Process Classes
+Include.File( "Fsm/Process" )
+Include.File( "Fsm/Assign" )
+Include.File( "Fsm/Route" )
+Include.File( "Fsm/Process_Smoke" )
+Include.File( "Fsm/Account" )
+Include.File( "Fsm/Process_JTAC" )
+Include.File( "Fsm/Patrol" )
+Include.File( "Fsm/Cargo" )
--- Task Handling Classes
-Include.File( "DetectionManager" )
-
-Include.File( "StateMachine" )
-
-Include.File( "Process" )
-Include.File( "Process_Assign" )
-Include.File( "Process_Route" )
-Include.File( "Process_Smoke" )
-Include.File( "Process_Destroy" )
-Include.File( "Process_JTAC" )
-Include.File( "Process_PatrolZone" )
-
-Include.File( "Task" )
-Include.File( "Task_SEAD" )
-Include.File( "Task_A2G" )
-
---- AI Set Handling Classes
-Include.File( "AIBalancer" )
+Include.File( "Tasking/Mission" )
+Include.File( "Tasking/Task" )
+Include.File( "Tasking/DetectionManager" )
+Include.File( "Tasking/Task_SEAD" )
+Include.File( "Tasking/Task_A2G" )
-- The order of the declarations is important here. Don't touch it.
diff --git a/Moose Development/Moose/Process_Assign.lua b/Moose Development/Moose/Process_Assign.lua
deleted file mode 100644
index de51b8499..000000000
--- a/Moose Development/Moose/Process_Assign.lua
+++ /dev/null
@@ -1,185 +0,0 @@
---- This module contains the PROCESS_ASSIGN classes.
---
--- ===
---
--- 1) @{Task_Assign#TASK_ASSIGN_ACCEPT} class, extends @{Task#TASK_BASE}
--- =====================================================================
--- The @{Task_Assign#TASK_ASSIGN_ACCEPT} class accepts by default a task for a player. No player intervention is allowed to reject the task.
---
--- 2) @{Task_Assign#TASK_ASSIGN_MENU_ACCEPT} class, extends @{Task#TASK_BASE}
--- ==========================================================================
--- The @{Task_Assign#TASK_ASSIGN_MENU_ACCEPT} 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.
---
---
---
---
---
---
--- @module Task_Assign
---
-
-
-do -- PROCESS_ASSIGN_ACCEPT
-
- --- PROCESS_ASSIGN_ACCEPT class
- -- @type PROCESS_ASSIGN_ACCEPT
- -- @field Task#TASK_BASE Task
- -- @field Unit#UNIT ProcessUnit
- -- @field Zone#ZONE_BASE TargetZone
- -- @extends Task2#TASK2
- PROCESS_ASSIGN_ACCEPT = {
- ClassName = "PROCESS_ASSIGN_ACCEPT",
- }
-
-
- --- Creates a new task assignment state machine. The process will accept the task by default, no player intervention accepted.
- -- @param #PROCESS_ASSIGN_ACCEPT self
- -- @param Task#TASK Task
- -- @param Unit#UNIT Unit
- -- @return #PROCESS_ASSIGN_ACCEPT self
- function PROCESS_ASSIGN_ACCEPT:New( Task, ProcessUnit, TaskBriefing )
-
- -- Inherits from BASE
- local self = BASE:Inherit( self, PROCESS:New( "ASSIGN_ACCEPT", Task, ProcessUnit ) ) -- #PROCESS_ASSIGN_ACCEPT
-
- self.TaskBriefing = TaskBriefing
-
- self.Fsm = STATEMACHINE_PROCESS:New( self, {
- initial = 'UnAssigned',
- events = {
- { name = 'Start', from = 'UnAssigned', to = 'Assigned' },
- { name = 'Fail', from = 'UnAssigned', to = 'Failed' },
- },
- callbacks = {
- onAssign = self.OnAssign,
- },
- endstates = {
- 'Assigned', 'Failed'
- },
- } )
-
- return self
- end
-
- --- StateMachine callback function for a TASK2
- -- @param #PROCESS_ASSIGN_ACCEPT self
- -- @param StateMachine#STATEMACHINE_PROCESS Fsm
- -- @param #string Event
- -- @param #string From
- -- @param #string To
- function PROCESS_ASSIGN_ACCEPT:OnAssigned( Fsm, Event, From, To )
- self:E( { Event, From, To, self.ProcessUnit.UnitName} )
-
- end
-
-end
-
-
-do -- PROCESS_ASSIGN_MENU_ACCEPT
-
- --- PROCESS_ASSIGN_MENU_ACCEPT class
- -- @type PROCESS_ASSIGN_MENU_ACCEPT
- -- @field Task#TASK_BASE Task
- -- @field Unit#UNIT ProcessUnit
- -- @field Zone#ZONE_BASE TargetZone
- -- @extends Task2#TASK2
- PROCESS_ASSIGN_MENU_ACCEPT = {
- ClassName = "PROCESS_ASSIGN_MENU_ACCEPT",
- }
-
-
- --- 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.
- -- @param #PROCESS_ASSIGN_MENU_ACCEPT self
- -- @param Task#TASK Task
- -- @param Unit#UNIT Unit
- -- @return #PROCESS_ASSIGN_MENU_ACCEPT self
- function PROCESS_ASSIGN_MENU_ACCEPT:New( Task, ProcessUnit, TaskBriefing )
-
- -- Inherits from BASE
- local self = BASE:Inherit( self, PROCESS:New( "ASSIGN_MENU_ACCEPT", Task, ProcessUnit ) ) -- #PROCESS_ASSIGN_MENU_ACCEPT
-
- self.TaskBriefing = TaskBriefing
-
- self.Fsm = STATEMACHINE_PROCESS:New( self, {
- initial = 'UnAssigned',
- events = {
- { name = 'Start', from = 'UnAssigned', to = 'AwaitAccept' },
- { name = 'Assign', from = 'AwaitAccept', to = 'Assigned' },
- { name = 'Reject', from = 'AwaitAccept', to = 'Rejected' },
- { name = 'Fail', from = 'AwaitAccept', to = 'Rejected' },
- },
- callbacks = {
- onStart = self.OnStart,
- onAssign = self.OnAssign,
- onReject = self.OnReject,
- },
- endstates = {
- 'Assigned', 'Rejected'
- },
- } )
-
- return self
- end
-
- --- StateMachine callback function for a TASK2
- -- @param #PROCESS_ASSIGN_MENU_ACCEPT self
- -- @param StateMachine#STATEMACHINE_TASK Fsm
- -- @param #string Event
- -- @param #string From
- -- @param #string To
- function PROCESS_ASSIGN_MENU_ACCEPT:OnStart( Fsm, Event, From, To )
- self:E( { Event, From, To, self.ProcessUnit.UnitName} )
-
- MESSAGE:New( self.TaskBriefing .. "\nAccess the radio menu to accept the task. You have 30 seconds or the assignment will be cancelled.", 30, "Assignment" ):ToGroup( self.ProcessUnit:GetGroup() )
- self.MenuText = self.Task.TaskName
-
- local ProcessGroup = self.ProcessUnit:GetGroup()
- self.Menu = MENU_GROUP:New( ProcessGroup, "Task " .. self.MenuText .. " acceptance" )
- self.MenuAcceptTask = MENU_GROUP_COMMAND:New( ProcessGroup, "Accept task " .. self.MenuText, self.Menu, self.MenuAssign, self )
- self.MenuRejectTask = MENU_GROUP_COMMAND:New( ProcessGroup, "Reject task " .. self.MenuText, self.Menu, self.MenuReject, self )
- end
-
- --- Menu function.
- -- @param #PROCESS_ASSIGN_MENU_ACCEPT self
- function PROCESS_ASSIGN_MENU_ACCEPT:MenuAssign()
- self:E( )
-
- self:NextEvent( self.Fsm.Assign )
- end
-
- --- Menu function.
- -- @param #PROCESS_ASSIGN_MENU_ACCEPT self
- function PROCESS_ASSIGN_MENU_ACCEPT:MenuReject()
- self:E( )
-
- self:NextEvent( self.Fsm.Reject )
- end
-
- --- StateMachine callback function for a TASK2
- -- @param #PROCESS_ASSIGN_MENU_ACCEPT self
- -- @param StateMachine#STATEMACHINE_PROCESS Fsm
- -- @param #string Event
- -- @param #string From
- -- @param #string To
- function PROCESS_ASSIGN_MENU_ACCEPT:OnAssign( Fsm, Event, From, To )
- self:E( { Event, From, To, self.ProcessUnit.UnitName} )
-
- self.Menu:Remove()
- end
-
- --- StateMachine callback function for a TASK2
- -- @param #PROCESS_ASSIGN_MENU_ACCEPT self
- -- @param StateMachine#STATEMACHINE_PROCESS Fsm
- -- @param #string Event
- -- @param #string From
- -- @param #string To
- function PROCESS_ASSIGN_MENU_ACCEPT:OnReject( Fsm, Event, From, To )
- self:E( { Event, From, To, self.ProcessUnit.UnitName} )
-
- self.Menu:Remove()
- self.Task:UnAssignFromUnit( self.ProcessUnit )
- self.ProcessUnit:Destroy()
- end
-end
diff --git a/Moose Development/Moose/Process_Destroy.lua b/Moose Development/Moose/Process_Destroy.lua
deleted file mode 100644
index 3a8c83113..000000000
--- a/Moose Development/Moose/Process_Destroy.lua
+++ /dev/null
@@ -1,180 +0,0 @@
---- @module Process_Destroy
-
---- PROCESS_DESTROY class
--- @type PROCESS_DESTROY
--- @field Unit#UNIT ProcessUnit
--- @field Set#SET_UNIT TargetSetUnit
--- @extends Process#PROCESS
-PROCESS_DESTROY = {
- ClassName = "PROCESS_DESTROY",
- Fsm = {},
- TargetSetUnit = nil,
-}
-
-
---- Creates a new DESTROY process.
--- @param #PROCESS_DESTROY self
--- @param Task#TASK Task
--- @param Unit#UNIT ProcessUnit
--- @param Set#SET_UNIT TargetSetUnit
--- @return #PROCESS_DESTROY self
-function PROCESS_DESTROY:New( Task, ProcessName, ProcessUnit, TargetSetUnit )
-
- -- Inherits from BASE
- local self = BASE:Inherit( self, PROCESS:New( ProcessName, Task, ProcessUnit ) ) -- #PROCESS_DESTROY
-
- self.TargetSetUnit = TargetSetUnit
-
- self.DisplayInterval = 30
- self.DisplayCount = 30
- self.DisplayMessage = true
- self.DisplayTime = 10 -- 10 seconds is the default
- self.DisplayCategory = "HQ" -- Targets is the default display category
-
- self.Fsm = STATEMACHINE_PROCESS:New( self, {
- initial = 'Assigned',
- events = {
- { name = 'Start', from = 'Assigned', to = 'Waiting' },
- { name = 'Start', from = 'Waiting', to = 'Waiting' },
- { name = 'HitTarget', from = 'Waiting', to = 'Destroy' },
- { name = 'MoreTargets', from = 'Destroy', to = 'Waiting' },
- { name = 'Destroyed', from = 'Destroy', to = 'Success' },
- { name = 'Fail', from = 'Assigned', to = 'Failed' },
- { name = 'Fail', from = 'Waiting', to = 'Failed' },
- { name = 'Fail', from = 'Destroy', to = 'Failed' },
- },
- callbacks = {
- onStart = self.OnStart,
- onWaiting = self.OnWaiting,
- onHitTarget = self.OnHitTarget,
- onMoreTargets = self.OnMoreTargets,
- onDestroyed = self.OnDestroyed,
- onKilled = self.OnKilled,
- },
- endstates = { 'Success', 'Failed' }
- } )
-
-
- _EVENTDISPATCHER:OnDead( self.EventDead, self )
-
- return self
-end
-
---- Process Events
-
---- StateMachine callback function for a PROCESS
--- @param #PROCESS_DESTROY self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
--- @param #string Event
--- @param #string From
--- @param #string To
-function PROCESS_DESTROY:OnStart( Fsm, Event, From, To )
-
- self:NextEvent( Fsm.Start )
-end
-
---- StateMachine callback function for a PROCESS
--- @param #PROCESS_DESTROY self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
--- @param #string Event
--- @param #string From
--- @param #string To
-function PROCESS_DESTROY:OnWaiting( Fsm, Event, From, To )
-
- local TaskGroup = self.ProcessUnit:GetGroup()
- if self.DisplayCount >= self.DisplayInterval then
- MESSAGE:New( "Your group with assigned " .. self.Task:GetName() .. " task has " .. self.TargetSetUnit:GetUnitTypesText() .. " targets left to be destroyed.", 5, "HQ" ):ToGroup( TaskGroup )
- self.DisplayCount = 1
- else
- self.DisplayCount = self.DisplayCount + 1
- end
-
- return true -- Process always the event.
-
-end
-
-
---- StateMachine callback function for a PROCESS
--- @param #PROCESS_DESTROY self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
--- @param #string Event
--- @param #string From
--- @param #string To
--- @param Event#EVENTDATA Event
-function PROCESS_DESTROY:OnHitTarget( Fsm, Event, From, To, Event )
-
-
- self.TargetSetUnit:Flush()
-
- if self.TargetSetUnit:FindUnit( Event.IniUnitName ) then
- self.TargetSetUnit:RemoveUnitsByName( Event.IniUnitName )
- local TaskGroup = self.ProcessUnit:GetGroup()
- MESSAGE:New( "You hit a target. Your group with assigned " .. self.Task:GetName() .. " task has " .. self.TargetSetUnit:Count() .. " targets ( " .. self.TargetSetUnit:GetUnitTypesText() .. " ) left to be destroyed.", 15, "HQ" ):ToGroup( TaskGroup )
- end
-
-
- if self.TargetSetUnit:Count() > 0 then
- self:NextEvent( Fsm.MoreTargets )
- else
- self:NextEvent( Fsm.Destroyed )
- end
-end
-
---- StateMachine callback function for a PROCESS
--- @param #PROCESS_DESTROY self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
--- @param #string Event
--- @param #string From
--- @param #string To
-function PROCESS_DESTROY:OnMoreTargets( Fsm, Event, From, To )
-
-
-end
-
---- StateMachine callback function for a PROCESS
--- @param #PROCESS_DESTROY self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
--- @param #string Event
--- @param #string From
--- @param #string To
--- @param Event#EVENTDATA DCSEvent
-function PROCESS_DESTROY:OnKilled( Fsm, Event, From, To )
-
- self:NextEvent( Fsm.Restart )
-
-end
-
---- StateMachine callback function for a PROCESS
--- @param #PROCESS_DESTROY self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
--- @param #string Event
--- @param #string From
--- @param #string To
-function PROCESS_DESTROY:OnRestart( Fsm, Event, From, To )
-
- self:NextEvent( Fsm.Menu )
-
-end
-
---- StateMachine callback function for a PROCESS
--- @param #PROCESS_DESTROY self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
--- @param #string Event
--- @param #string From
--- @param #string To
-function PROCESS_DESTROY:OnDestroyed( Fsm, Event, From, To )
-
-end
-
---- DCS Events
-
---- @param #PROCESS_DESTROY self
--- @param Event#EVENTDATA Event
-function PROCESS_DESTROY:EventDead( Event )
-
- if Event.IniDCSUnit then
- self:NextEvent( self.Fsm.HitTarget, Event )
- end
-end
-
-
diff --git a/Moose Development/Moose/Process_Route.lua b/Moose Development/Moose/Process_Route.lua
deleted file mode 100644
index fd240a700..000000000
--- a/Moose Development/Moose/Process_Route.lua
+++ /dev/null
@@ -1,86 +0,0 @@
---- @module Task_Route
-
---- PROCESS_ROUTE class
--- @type PROCESS_ROUTE
--- @field Task#TASK TASK
--- @field Unit#UNIT ProcessUnit
--- @field Zone#ZONE_BASE TargetZone
--- @extends Task2#TASK2
-PROCESS_ROUTE = {
- ClassName = "PROCESS_ROUTE",
-}
-
-
---- Creates a new routing state machine. The task will route a CLIENT to a ZONE until the CLIENT is within that ZONE.
--- @param #PROCESS_ROUTE self
--- @param Task#TASK Task
--- @param Unit#UNIT Unit
--- @return #PROCESS_ROUTE self
-function PROCESS_ROUTE:New( Task, ProcessUnit, TargetZone )
-
- -- Inherits from BASE
- local self = BASE:Inherit( self, PROCESS:New( "ROUTE", Task, ProcessUnit ) ) -- #PROCESS_ROUTE
-
- self.TargetZone = TargetZone
- self.DisplayInterval = 30
- self.DisplayCount = 30
- self.DisplayMessage = true
- self.DisplayTime = 10 -- 10 seconds is the default
- self.DisplayCategory = "HQ" -- Route is the default display category
-
- self.Fsm = STATEMACHINE_PROCESS:New( self, {
- initial = 'UnArrived',
- events = {
- { name = 'Start', from = 'UnArrived', to = 'UnArrived' },
- { name = 'Fail', from = 'UnArrived', to = 'Failed' },
- },
- callbacks = {
- onleaveUnArrived = self.OnLeaveUnArrived,
- onFail = self.OnFail,
- },
- endstates = {
- 'Arrived', 'Failed'
- },
- } )
-
- return self
-end
-
---- Task Events
-
---- StateMachine callback function for a TASK2
--- @param #PROCESS_ROUTE self
--- @param StateMachine#STATEMACHINE_PROCESS Fsm
--- @param #string Event
--- @param #string From
--- @param #string To
-function PROCESS_ROUTE:OnLeaveUnArrived( Fsm, Event, From, To )
-
- if self.ProcessUnit:IsAlive() then
- local IsInZone = self.ProcessUnit:IsInZone( self.TargetZone )
-
- if self.DisplayCount >= self.DisplayInterval then
- if not IsInZone then
- local ZoneVec2 = self.TargetZone:GetVec2()
- local ZonePointVec2 = POINT_VEC2:New( ZoneVec2.x, ZoneVec2.y )
- local TaskUnitVec2 = self.ProcessUnit:GetVec2()
- local TaskUnitPointVec2 = POINT_VEC2:New( TaskUnitVec2.x, TaskUnitVec2.y )
- local RouteText = self.ProcessUnit:GetCallsign() .. ": Route to " .. TaskUnitPointVec2:GetBRText( ZonePointVec2 ) .. " km to target."
- MESSAGE:New( RouteText, self.DisplayTime, self.DisplayCategory ):ToGroup( self.ProcessUnit:GetGroup() )
- end
- self.DisplayCount = 1
- else
- self.DisplayCount = self.DisplayCount + 1
- end
-
- --if not IsInZone then
- self:NextEvent( Fsm.Start )
- --end
-
- return IsInZone -- if false, then the event will not be executed...
- end
-
- return false
-
-end
-
diff --git a/Moose Development/Moose/DetectionManager.lua b/Moose Development/Moose/Tasking/DetectionManager.lua
similarity index 100%
rename from Moose Development/Moose/DetectionManager.lua
rename to Moose Development/Moose/Tasking/DetectionManager.lua
diff --git a/Moose Development/Moose/Mission.lua b/Moose Development/Moose/Tasking/Mission.lua
similarity index 100%
rename from Moose Development/Moose/Mission.lua
rename to Moose Development/Moose/Tasking/Mission.lua
diff --git a/Moose Development/Moose/Task.lua b/Moose Development/Moose/Tasking/Task.lua
similarity index 91%
rename from Moose Development/Moose/Task.lua
rename to Moose Development/Moose/Tasking/Task.lua
index aa4b3521d..976932395 100644
--- a/Moose Development/Moose/Task.lua
+++ b/Moose Development/Moose/Tasking/Task.lua
@@ -59,14 +59,14 @@
TASK_BASE = {
ClassName = "TASK_BASE",
TaskScheduler = nil,
- Processes = {},
+ ProcessClasses = {}, -- The container of the Process classes that will be used to create and assign new processes for the task to ProcessUnits.
+ Processes = {}, -- The container of actual process objects instantiated and assigned to ProcessUnits.
Players = nil,
Scores = {},
Menu = {},
SetGroup = nil,
}
-
--- Instantiates a new TASK_BASE. Should never be used. Interface Class.
-- @param #TASK_BASE self
-- @param Mission#MISSION The mission wherein the Task is registered.
@@ -113,6 +113,7 @@ end
--- Assign the @{Task}to a @{Group}.
-- @param #TASK_BASE self
-- @param Group#GROUP TaskGroup
+-- @return #TASK_BASE
function TASK_BASE:AssignToGroup( TaskGroup )
self:F2( TaskGroup:GetName() )
@@ -131,6 +132,8 @@ function TASK_BASE:AssignToGroup( TaskGroup )
self:AssignToUnit( TaskUnit )
end
end
+
+ return self
end
--- Send the briefng message of the @{Task} to the assigned @{Group}s.
@@ -401,19 +404,61 @@ function TASK_BASE:GetTaskName()
end
---- Add Process to @{Task} with key @{Unit}.
+--- This is the key worker function for the class. Instantiate a new Process based on the ProcessName to @{Task} and assign it to the ProcessUnit.
-- @param #TASK_BASE self
--- @param Unit#UNIT TaskUnit
--- @return #TASK_BASE self
-function TASK_BASE:AddProcess( TaskUnit, Process )
- local TaskUnitName = TaskUnit:GetName()
+-- @param Unit#UNIT ProcessUnit The unit to which the process should be assigned.
+-- @param #string ProcessName The name of the Process.
+-- @return Process#PROCESS The Process that was added.
+function TASK_BASE:AssignProcess( ProcessUnit, ProcessName )
+ self:F( { ProcessName } )
+ local ProcessUnitName = ProcessUnit:GetName()
+
+ -- Create the Process instance base on the ProcessClasses collection assigned to the Task
+ local ProcessClass, ProcessArguments
+ ProcessClass, ProcessArguments = self:GetProcessClass( ProcessName )
+
+ local Process = ProcessClass:New( unpack( ProcessArguments ) ) -- Process#PROCESS
+ Process:SetControllable( ProcessUnit )
+
self.Processes = self.Processes or {}
- self.Processes[TaskUnitName] = self.Processes[TaskUnitName] or {}
- self.Processes[TaskUnitName][#self.Processes[TaskUnitName]+1] = Process
+ self.Processes[ProcessUnitName] = self.Processes[ProcessUnitName] or {}
+
+ self.Processes[ProcessUnitName][ProcessName] = Process
+
return Process
end
+--- Get the default or currently assigned @{Process} class with key ProcessName.
+-- @param #TASK_BASE self
+-- @param #string ProcessName
+-- @return Process#PROCESS
+-- @return #table
+function TASK_BASE:GetProcessClass( ProcessName )
+
+ local ProcessClass = self.ProcessClasses[ProcessName].Class
+ local ProcessArguments = self.ProcessClasses[ProcessName].Arguments
+
+ return ProcessClass, ProcessArguments
+end
+
+
+--- Set the Process default class with key ProcessName providing the ProcessClass and the constructor initialization parameters when it is assigned to a Unit by the task.
+-- @param #TASK_BASE self
+-- @param #string ProcessName
+-- @param Process#PROCESS ProcessClass
+-- @param #table ... The parameters for the New() constructor of the ProcessClass, when the Task is assigning a new Process to the Unit.
+-- @return Process#PROCESS
+function TASK_BASE:SetProcessClass( ProcessName, ProcessClass, ... )
+
+ self.ProcessClasses[ProcessName] = self.ProcessClasses[ProcessName] or {}
+ self.ProcessClasses[ProcessName].Class = ProcessClass
+ self.ProcessClasses[ProcessName].Arguments = ...
+
+ return ProcessClass
+end
+
+
--- Remove Processes from @{Task} with key @{Unit}
-- @param #TASK_BASE self
-- @param #string TaskUnitName
@@ -749,6 +794,7 @@ function TASK_BASE:AddScore( TaskStatus, ScoreText, Score )
return self
end
+
--- StateMachine callback function for a TASK
-- @param #TASK_BASE self
-- @param Unit#UNIT TaskUnit
diff --git a/Moose Development/Moose/TaskMenu.lua b/Moose Development/Moose/Tasking/TaskMenu.lua
similarity index 100%
rename from Moose Development/Moose/TaskMenu.lua
rename to Moose Development/Moose/Tasking/TaskMenu.lua
diff --git a/Moose Development/Moose/Task_A2G.lua b/Moose Development/Moose/Tasking/Task_A2G.lua
similarity index 99%
rename from Moose Development/Moose/Task_A2G.lua
rename to Moose Development/Moose/Tasking/Task_A2G.lua
index e30cc205b..ec1a94e01 100644
--- a/Moose Development/Moose/Task_A2G.lua
+++ b/Moose Development/Moose/Tasking/Task_A2G.lua
@@ -1,4 +1,4 @@
---- This module contains the TASK_A2G classes.
+--- (AI) (SP) (MP) Tasking for Air to Ground Processes.
--
-- 1) @{#TASK_A2G} class, extends @{Task#TASK_BASE}
-- =================================================
diff --git a/Moose Development/Moose/Task_AIBalancer.lua b/Moose Development/Moose/Tasking/Task_AIBalancer.lua
similarity index 100%
rename from Moose Development/Moose/Task_AIBalancer.lua
rename to Moose Development/Moose/Tasking/Task_AIBalancer.lua
diff --git a/Moose Development/Moose/Task_Pickup.lua b/Moose Development/Moose/Tasking/Task_Pickup.lua
similarity index 100%
rename from Moose Development/Moose/Task_Pickup.lua
rename to Moose Development/Moose/Tasking/Task_Pickup.lua
diff --git a/Moose Development/Moose/Task_SEAD.lua b/Moose Development/Moose/Tasking/Task_SEAD.lua
similarity index 69%
rename from Moose Development/Moose/Task_SEAD.lua
rename to Moose Development/Moose/Tasking/Task_SEAD.lua
index 9cba080f9..301a7be40 100644
--- a/Moose Development/Moose/Task_SEAD.lua
+++ b/Moose Development/Moose/Tasking/Task_SEAD.lua
@@ -19,6 +19,7 @@
-- @module Task_SEAD
+
do -- TASK_SEAD
--- The TASK_SEAD class
@@ -43,6 +44,18 @@ do -- TASK_SEAD
self.TargetSetUnit = TargetSetUnit
self.TargetZone = TargetZone
+
+ -- ASSIGN_ACCEPT:New(TaskBriefing)
+ self:SetProcessClass( "ASSIGN", ASSIGN_ACCEPT, self.TaskBriefing )
+
+ -- ROUTE_ZONE:New(TargetZone)
+ self:SetProcessClass( "ROUTE", ROUTE_ZONE, self.TargetZone )
+
+ -- ACCOUNT_DEADS:New(TargetSetUnit,TaskName)
+ self:SetProcessClass( "ACCOUNT", ACCOUNT_DEADS, self.TargetSetUnit, "SEAD" )
+
+ -- SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone )
+ --self:SetProcessClass( "SMOKE", SMOKE_TARGETS_ZONE, self.TargetSetUnit, self.TargetZone )
_EVENTDISPATCHER:OnPlayerLeaveUnit( self._EventPlayerLeaveUnit, self )
_EVENTDISPATCHER:OnDead( self._EventDead, self )
@@ -71,38 +84,31 @@ do -- TASK_SEAD
function TASK_SEAD:AssignToUnit( TaskUnit )
self:F( TaskUnit:GetName() )
- local ProcessAssign = self:AddProcess( TaskUnit, PROCESS_ASSIGN_ACCEPT:New( self, TaskUnit, self.TaskBriefing ) )
- local ProcessRoute = self:AddProcess( TaskUnit, PROCESS_ROUTE:New( self, TaskUnit, self.TargetZone ) )
- local ProcessSEAD = self:AddProcess( TaskUnit, PROCESS_DESTROY:New( self, "SEAD", TaskUnit, self.TargetSetUnit ) )
- local ProcessSmoke = self:AddProcess( TaskUnit, PROCESS_SMOKE_TARGETS:New( self, TaskUnit, self.TargetSetUnit, self.TargetZone ) )
+ local ProcessAssign = self:AssignProcess( TaskUnit, "ASSIGN" )
+ local ProcessRoute = self:AssignProcess( TaskUnit, "ROUTE" )
+ local ProcessSEAD = self:AssignProcess( TaskUnit, "ACCOUNT" )
+ --local ProcessSmoke = self:AssignProcess( TaskUnit, "SMOKE" )
- local Process = self:AddStateMachine( TaskUnit, STATEMACHINE_TASK:New( self, TaskUnit, {
+ local FSMT = {
initial = 'None',
events = {
- { name = 'Next', from = 'None', to = 'Planned' },
+ { name = 'Next', from = 'None', to = 'Planned' },
{ name = 'Next', from = 'Planned', to = 'Assigned' },
{ name = 'Reject', from = 'Planned', to = 'Rejected' },
{ name = 'Next', from = 'Assigned', to = 'Success' },
{ name = 'Fail', from = 'Assigned', to = 'Failed' },
{ name = 'Fail', from = 'Arrived', to = 'Failed' }
},
- callbacks = {
- onNext = self.OnNext,
- onRemove = self.OnRemove,
- },
subs = {
- Assign = { onstateparent = 'Planned', oneventparent = 'Next', fsm = ProcessAssign.Fsm, event = 'Start', returnevents = { 'Next', 'Reject' } },
- Route = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = ProcessRoute.Fsm, event = 'Start' },
- Sead = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = ProcessSEAD.Fsm, event = 'Start', returnevents = { 'Next' } },
- Smoke = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = ProcessSmoke.Fsm, event = 'Start', }
+ Assign = { onstateparent = 'Planned', oneventparent = 'Next', fsm = ProcessAssign, event = 'Start', returnevents = { 'Next', 'Reject' } },
+ Route = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = ProcessRoute, event = 'Start' },
+ Sead = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = ProcessSEAD, event = 'Start', returnevents = { 'Next' } },
+ --Smoke = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = ProcessSmoke, event = 'Start', }
}
- } ) )
-
- ProcessRoute:AddScore( "Failed", "failed to destroy a radar", -100 )
- ProcessSEAD:AddScore( "Destroy", "destroyed a radar", 25 )
- ProcessSEAD:AddScore( "Failed", "failed to destroy a radar", -100 )
- self:AddScore( "Success", "Destroyed all target radars", 250 )
+ }
+ local Process = self:AddStateMachine( TaskUnit, STATEMACHINE_TASK:New( FSMT, self, TaskUnit ) )
+
Process:Next()
return self
@@ -115,32 +121,15 @@ do -- TASK_SEAD
-- @param #string From
-- @param #string To
-- @param Event#EVENTDATA Event
- function TASK_SEAD:OnNext( Fsm, Event, From, To )
+ function TASK_SEAD:onafterNext( Fsm, Event, From, To )
self:SetState( self, "State", To )
end
-
--- @param #TASK_SEAD self
function TASK_SEAD:GetPlannedMenuText()
return self:GetStateString() .. " - " .. self:GetTaskName() .. " ( " .. self.TargetSetUnit:GetUnitTypesText() .. " )"
end
- --- @param #TASK_SEAD self
- function TASK_SEAD:_Schedule()
- self:F2()
-
- self.TaskScheduler = SCHEDULER:New( self, _Scheduler, {}, 15, 15 )
- return self
- end
-
-
- --- @param #TASK_SEAD self
- function TASK_SEAD._Scheduler()
- self:F2()
-
- return true
- end
-
end
diff --git a/Moose Development/Moose/Routines.lua b/Moose Development/Moose/Utilities/Routines.lua
similarity index 100%
rename from Moose Development/Moose/Routines.lua
rename to Moose Development/Moose/Utilities/Routines.lua
diff --git a/Moose Development/Moose/StatHandler.lua b/Moose Development/Moose/Utilities/StatHandler.lua
similarity index 100%
rename from Moose Development/Moose/StatHandler.lua
rename to Moose Development/Moose/Utilities/StatHandler.lua
diff --git a/Moose Development/Moose/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua
similarity index 100%
rename from Moose Development/Moose/Utils.lua
rename to Moose Development/Moose/Utilities/Utils.lua
diff --git a/Moose Development/Moose/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua
similarity index 100%
rename from Moose Development/Moose/Airbase.lua
rename to Moose Development/Moose/Wrapper/Airbase.lua
diff --git a/Moose Development/Moose/Client.lua b/Moose Development/Moose/Wrapper/Client.lua
similarity index 100%
rename from Moose Development/Moose/Client.lua
rename to Moose Development/Moose/Wrapper/Client.lua
diff --git a/Moose Development/Moose/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua
similarity index 100%
rename from Moose Development/Moose/Controllable.lua
rename to Moose Development/Moose/Wrapper/Controllable.lua
diff --git a/Moose Development/Moose/Group.lua b/Moose Development/Moose/Wrapper/Group.lua
similarity index 100%
rename from Moose Development/Moose/Group.lua
rename to Moose Development/Moose/Wrapper/Group.lua
diff --git a/Moose Development/Moose/Identifiable.lua b/Moose Development/Moose/Wrapper/Identifiable.lua
similarity index 100%
rename from Moose Development/Moose/Identifiable.lua
rename to Moose Development/Moose/Wrapper/Identifiable.lua
diff --git a/Moose Development/Moose/Object.lua b/Moose Development/Moose/Wrapper/Object.lua
similarity index 100%
rename from Moose Development/Moose/Object.lua
rename to Moose Development/Moose/Wrapper/Object.lua
diff --git a/Moose Development/Moose/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua
similarity index 100%
rename from Moose Development/Moose/Positionable.lua
rename to Moose Development/Moose/Wrapper/Positionable.lua
diff --git a/Moose Development/Moose/Static.lua b/Moose Development/Moose/Wrapper/Static.lua
similarity index 100%
rename from Moose Development/Moose/Static.lua
rename to Moose Development/Moose/Wrapper/Static.lua
diff --git a/Moose Development/Moose/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua
similarity index 100%
rename from Moose Development/Moose/Unit.lua
rename to Moose Development/Moose/Wrapper/Unit.lua
diff --git a/Moose Development/ReleaseNotes.txt b/Moose Development/ReleaseNotes.txt
index e4d7d8a73..8872451a8 100644
--- a/Moose Development/ReleaseNotes.txt
+++ b/Moose Development/ReleaseNotes.txt
@@ -1,3 +1,13 @@
+2016-09-01
+
+ - Expanded the CARGO classes and implemented the CARGO_GROUPED classes.
+ -- Finished the correct state machine implementation to Board, UnBoard, Load, UnLoad cargo to and from carriers.
+ -- Created the CARGO_GROUPED class, which groups CARGO_UNITs into one group. The cargo behaves like groups, but can be transported by carriers.
+ -- Documented CARGO event functions, state transition functions + overall documentation.
+ -- Updated test missions located in the directory: Moose_Test_CARGO
+
+ - Expanded the PROCESS_PATROLZONE class.
+
2016-08-21
- Made a new STATEMACHINE_CONTROLLABLE object, which models a base state machine class to be inherited by AI controllable classes.
@@ -8,9 +18,9 @@
-- Added immediate and delayed event processing as part of the STATEMACHINE_CONTROLLABLE class.
--- Events that start with __Event are processed with a delay. The delay is given in seconds as a parameter.
- - Created a new AI_PATROLZONE class, which inherites STATEMACHINE_CONTROLLABLE.
+ - Created a new PROCESS_PATROLZONE class, which inherites STATEMACHINE_CONTROLLABLE.
-- This class implements a complete new revamped patrol zone AI pattern.
- -- Created a new test directory: Moose_Test_AI_PATROLZONE with test missions.
+ -- Created a new test directory: Moose_Test_PROCESS_PATROLZONE with test missions.
2016-08-15
diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
index 12ac8ffe3..833a726be 100644
--- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
+++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20160831_0559' )
+env.info( 'Moose Generation Timestamp: 20160902_0901' )
local base = _G
diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua
index 12ac8ffe3..833a726be 100644
--- a/Moose Mission Setup/Moose.lua
+++ b/Moose Mission Setup/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20160831_0559' )
+env.info( 'Moose Generation Timestamp: 20160902_0901' )
local base = _G
diff --git a/Moose Test Missions/MOOSE_Test_Template.miz b/Moose Test Missions/MOOSE_Test_Template.miz
index 101381aed..4e6f8b3fc 100644
Binary files a/Moose Test Missions/MOOSE_Test_Template.miz and b/Moose Test Missions/MOOSE_Test_Template.miz differ
diff --git a/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.lua b/Moose Test Missions/Moose_Test_AI_Balancer/Moose_Test_AIBALANCER.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.lua
rename to Moose Test Missions/Moose_Test_AI_Balancer/Moose_Test_AIBALANCER.lua
diff --git a/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz b/Moose Test Missions/Moose_Test_AI_Balancer/Moose_Test_AIBALANCER.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz
rename to Moose Test Missions/Moose_Test_AI_Balancer/Moose_Test_AIBALANCER.miz
index ca3fc42bc..adf0909b9 100644
Binary files a/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz and b/Moose Test Missions/Moose_Test_AI_Balancer/Moose_Test_AIBALANCER.miz differ
diff --git a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE-DB.miz b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE-DB.miz
similarity index 97%
rename from Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE-DB.miz
rename to Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE-DB.miz
index 762b9bc34..4812f0a7f 100644
Binary files a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE-DB.miz and b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE-DB.miz differ
diff --git a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE.miz
similarity index 97%
rename from Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz
rename to Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE.miz
index 4c9f9ae77..0b1523440 100644
Binary files a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz and b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE.miz differ
diff --git a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_CAUCASUS.lua b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_CAUCASUS.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_CAUCASUS.lua
rename to Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_CAUCASUS.lua
diff --git a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_CAUCASUS.miz b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_CAUCASUS.miz
similarity index 97%
rename from Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_CAUCASUS.miz
rename to Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_CAUCASUS.miz
index c82a266ee..1e6fb0700 100644
Binary files a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_CAUCASUS.miz and b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_CAUCASUS.miz differ
diff --git a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_NEVADA.lua b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_NEVADA.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_NEVADA.lua
rename to Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_NEVADA.lua
diff --git a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_NEVADA.miz b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_NEVADA.miz
similarity index 87%
rename from Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_NEVADA.miz
rename to Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_NEVADA.miz
index ef4892277..723a6685e 100644
Binary files a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE_NEVADA.miz and b/Moose Test Missions/Moose_Test_Airbase_Police/Moose_Test_AIRBASEPOLICE_NEVADA.miz differ
diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz
deleted file mode 100644
index baf9edec5..000000000
Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz and /dev/null differ
diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz
deleted file mode 100644
index 958f3a9a8..000000000
Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz and /dev/null differ
diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz
deleted file mode 100644
index 17359c9c8..000000000
Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz and /dev/null differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Board/MOOSE_Test_CARGO_GROUPED_Board.miz b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Board/MOOSE_Test_CARGO_GROUPED_Board.miz
index bc954b8cc..7aa494e00 100644
Binary files a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Board/MOOSE_Test_CARGO_GROUPED_Board.miz and b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Board/MOOSE_Test_CARGO_GROUPED_Board.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Board/Moose_Test_CARGO_GROUPED_Board.lua b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Board/Moose_Test_CARGO_GROUPED_Board.lua
index 4069da2f1..3c101175d 100644
--- a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Board/Moose_Test_CARGO_GROUPED_Board.lua
+++ b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Board/Moose_Test_CARGO_GROUPED_Board.lua
@@ -1,11 +1,9 @@
-local Mission = MISSION:New( "Transfer Cargo", "High", "Test for Cargo", coalition.side.RED )
-
local CargoSet = SET_BASE:New()
-CargoSet:Add( "Engineer1", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
-CargoSet:Add( "Engineer2", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
-CargoSet:Add( "Engineer3", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
-CargoSet:Add( "Engineer4", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
+CargoSet:Add( "Engineer1", CARGO_UNIT:New( UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
+CargoSet:Add( "Engineer2", CARGO_UNIT:New( UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
+CargoSet:Add( "Engineer3", CARGO_UNIT:New( UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
+CargoSet:Add( "Engineer4", CARGO_UNIT:New( UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
local InfantryCargo = CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Transfer/MOOSE_Test_CARGO_UNIT_Transfer.miz b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Transfer/MOOSE_Test_CARGO_UNIT_Transfer.miz
index 23e7aac78..67f7cbc5f 100644
Binary files a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Transfer/MOOSE_Test_CARGO_UNIT_Transfer.miz and b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Transfer/MOOSE_Test_CARGO_UNIT_Transfer.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_UnBoard/MOOSE_Test_CARGO_GROUPED_UnBoard.miz b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_UnBoard/MOOSE_Test_CARGO_GROUPED_UnBoard.miz
index 58ffbfda5..941b33450 100644
Binary files a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_UnBoard/MOOSE_Test_CARGO_GROUPED_UnBoard.miz and b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_UnBoard/MOOSE_Test_CARGO_GROUPED_UnBoard.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_UnBoard/Moose_Test_CARGO_GROUPED_UnBoard.lua b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_UnBoard/Moose_Test_CARGO_GROUPED_UnBoard.lua
index 7360fc894..4849e658c 100644
--- a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_UnBoard/Moose_Test_CARGO_GROUPED_UnBoard.lua
+++ b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_UnBoard/Moose_Test_CARGO_GROUPED_UnBoard.lua
@@ -1,11 +1,9 @@
-local Mission = MISSION:New( "Transfer Cargo", "High", "Test for Cargo", coalition.side.RED )
-
local CargoSet = SET_BASE:New()
-CargoSet:Add( "Engineer1", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
-CargoSet:Add( "Engineer2", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
-CargoSet:Add( "Engineer3", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
-CargoSet:Add( "Engineer4", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
+CargoSet:Add( "Engineer1", CARGO_UNIT:New( UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
+CargoSet:Add( "Engineer2", CARGO_UNIT:New( UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
+CargoSet:Add( "Engineer3", CARGO_UNIT:New( UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
+CargoSet:Add( "Engineer4", CARGO_UNIT:New( UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
local InfantryCargo = CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_Board/MOOSE_Test_CARGO_PACKAGE_Board.miz b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_Board/MOOSE_Test_CARGO_PACKAGE_Board.miz
index 6b658f681..4207215be 100644
Binary files a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_Board/MOOSE_Test_CARGO_PACKAGE_Board.miz and b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_Board/MOOSE_Test_CARGO_PACKAGE_Board.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_Board/Moose_Test_CARGO_PACKAGE_Board.lua b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_Board/Moose_Test_CARGO_PACKAGE_Board.lua
index 773a96c7a..d68971c21 100644
--- a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_Board/Moose_Test_CARGO_PACKAGE_Board.lua
+++ b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_Board/Moose_Test_CARGO_PACKAGE_Board.lua
@@ -1,8 +1,6 @@
-local Mission = MISSION:New( "Pickup Cargo", "High", "Test for Cargo Pickup", coalition.side.RED )
-
local DeliveryUnit = UNIT:FindByName( "Delivery" )
-local Letter = CARGO_PACKAGE:New( Mission, DeliveryUnit, "Letter", "Secret Orders", "0.3", 2000, 25 )
+local Letter = CARGO_PACKAGE:New( DeliveryUnit, "Letter", "Secret Orders", "0.3", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_UnBoard/MOOSE_Test_CARGO_PACKAGE_UnBoard.miz b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_UnBoard/MOOSE_Test_CARGO_PACKAGE_UnBoard.miz
index d7618e7c2..85fac6112 100644
Binary files a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_UnBoard/MOOSE_Test_CARGO_PACKAGE_UnBoard.miz and b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_UnBoard/MOOSE_Test_CARGO_PACKAGE_UnBoard.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_UnBoard/Moose_Test_CARGO_PACKAGE_UnBoard.lua b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_UnBoard/Moose_Test_CARGO_PACKAGE_UnBoard.lua
index 259cdc968..a80062fd0 100644
--- a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_UnBoard/Moose_Test_CARGO_PACKAGE_UnBoard.lua
+++ b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_PACKAGE_UnBoard/Moose_Test_CARGO_PACKAGE_UnBoard.lua
@@ -1,8 +1,6 @@
-local Mission = MISSION:New( "Pickup Cargo", "High", "Test for Cargo Pickup", coalition.side.RED )
-
local CargoEngineer = UNIT:FindByName( "Engineer" )
-local InfantryCargo = CARGO_UNIT:New( Mission, CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
+local InfantryCargo = CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Board/MOOSE_Test_CARGO_UNIT_Board.miz b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Board/MOOSE_Test_CARGO_UNIT_Board.miz
index b314f8e00..3e48768b5 100644
Binary files a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Board/MOOSE_Test_CARGO_UNIT_Board.miz and b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Board/MOOSE_Test_CARGO_UNIT_Board.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Board/Moose_Test_CARGO_UNIT_Board.lua b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Board/Moose_Test_CARGO_UNIT_Board.lua
index b45425e7c..3025639fb 100644
--- a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Board/Moose_Test_CARGO_UNIT_Board.lua
+++ b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Board/Moose_Test_CARGO_UNIT_Board.lua
@@ -1,8 +1,6 @@
-local Mission = MISSION:New( "Transfer Cargo", "High", "Test for Cargo", coalition.side.RED )
-
local CargoEngineer = UNIT:FindByName( "Engineer" )
-local InfantryCargo = CARGO_UNIT:New( Mission, CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
+local InfantryCargo = CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Transfer/MOOSE_Test_CARGO_UNIT_Transfer.miz b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Transfer/MOOSE_Test_CARGO_UNIT_Transfer.miz
index 8210ab21e..6f3245720 100644
Binary files a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Transfer/MOOSE_Test_CARGO_UNIT_Transfer.miz and b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Transfer/MOOSE_Test_CARGO_UNIT_Transfer.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Transfer/Moose_Test_CARGO_UNIT_Transfer.lua b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Transfer/Moose_Test_CARGO_UNIT_Transfer.lua
index f6f73732a..4dc304c15 100644
--- a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Transfer/Moose_Test_CARGO_UNIT_Transfer.lua
+++ b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_Transfer/Moose_Test_CARGO_UNIT_Transfer.lua
@@ -1,8 +1,6 @@
-local Mission = MISSION:New( "Transfer Cargo", "High", "Test for Cargo", coalition.side.RED )
-
local CargoEngineer = UNIT:FindByName( "Engineer" )
-local InfantryCargo = CARGO_UNIT:New( Mission, CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
+local InfantryCargo = CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
local CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_UnBoard/MOOSE_Test_CARGO_UNIT_UnBoard.miz b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_UnBoard/MOOSE_Test_CARGO_UNIT_UnBoard.miz
index b91a601b3..69badd3e9 100644
Binary files a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_UnBoard/MOOSE_Test_CARGO_UNIT_UnBoard.miz and b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_UnBoard/MOOSE_Test_CARGO_UNIT_UnBoard.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_UnBoard/Moose_Test_CARGO_UNIT_UnBoard.lua b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_UnBoard/Moose_Test_CARGO_UNIT_UnBoard.lua
index 5ca25a0c3..096577fd8 100644
--- a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_UnBoard/Moose_Test_CARGO_UNIT_UnBoard.lua
+++ b/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_UNIT_UnBoard/Moose_Test_CARGO_UNIT_UnBoard.lua
@@ -1,8 +1,6 @@
-local Mission = MISSION:New( "Transfer Cargo", "High", "Test for Cargo", coalition.side.RED )
-
local CargoEngineer = UNIT:FindByName( "Engineer" )
-local InfantryCargo = CARGO_UNIT:New( Mission, CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
+local InfantryCargo = CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
diff --git a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz
index 84f0b8b1e..3fe2950d8 100644
Binary files a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz and b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz differ
diff --git a/Moose Test Missions/Moose_Test_Cargo/Moose_Test_CARGO_GROUPED_Transfer/MOOSE_Test_CARGO_GROUPED_Transfer.miz b/Moose Test Missions/Moose_Test_Cargo/Moose_Test_CARGO_GROUPED_Transfer/MOOSE_Test_CARGO_GROUPED_Transfer.miz
new file mode 100644
index 000000000..e80f29f3f
Binary files /dev/null and b/Moose Test Missions/Moose_Test_Cargo/Moose_Test_CARGO_GROUPED_Transfer/MOOSE_Test_CARGO_GROUPED_Transfer.miz differ
diff --git a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Transfer/Moose_Test_CARGO_UNIT_Transfer.lua b/Moose Test Missions/Moose_Test_Cargo/Moose_Test_CARGO_GROUPED_Transfer/Moose_Test_CARGO_GROUPED_Transfer.lua
similarity index 60%
rename from Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Transfer/Moose_Test_CARGO_UNIT_Transfer.lua
rename to Moose Test Missions/Moose_Test_Cargo/Moose_Test_CARGO_GROUPED_Transfer/Moose_Test_CARGO_GROUPED_Transfer.lua
index 53e4bee9c..a69e5c482 100644
--- a/Moose Test Missions/Moose_Test_CARGO/Moose_Test_CARGO_GROUPED_Transfer/Moose_Test_CARGO_UNIT_Transfer.lua
+++ b/Moose Test Missions/Moose_Test_Cargo/Moose_Test_CARGO_GROUPED_Transfer/Moose_Test_CARGO_GROUPED_Transfer.lua
@@ -1,11 +1,9 @@
-local Mission = MISSION:New( "Transfer Cargo", "High", "Test for Cargo", coalition.side.RED )
-
local CargoSet = SET_BASE:New()
-CargoSet:Add( "Engineer1", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
-CargoSet:Add( "Engineer2", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
-CargoSet:Add( "Engineer3", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
-CargoSet:Add( "Engineer4", CARGO_UNIT:New( Mission, UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
+CargoSet:Add( "Engineer1", CARGO_UNIT:New( UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
+CargoSet:Add( "Engineer2", CARGO_UNIT:New( UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
+CargoSet:Add( "Engineer3", CARGO_UNIT:New( UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
+CargoSet:Add( "Engineer4", CARGO_UNIT:New( UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
local InfantryCargo = CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
diff --git a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz
deleted file mode 100644
index 6ec1367e5..000000000
Binary files a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz and /dev/null differ
diff --git a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.lua b/Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Areas/Moose_Test_Detection_Areas.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.lua
rename to Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Areas/Moose_Test_Detection_Areas.lua
diff --git a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz b/Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Areas/Moose_Test_Detection_Areas.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz
rename to Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Areas/Moose_Test_Detection_Areas.miz
index f593947bc..c9df34abc 100644
Binary files a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz and b/Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Areas/Moose_Test_Detection_Areas.miz differ
diff --git a/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.lua b/Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Reporting/Moose_Test_Detection_Reporting.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.lua
rename to Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Reporting/Moose_Test_Detection_Reporting.lua
diff --git a/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz b/Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Reporting/Moose_Test_Detection_Reporting.miz
similarity index 97%
rename from Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz
rename to Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Reporting/Moose_Test_Detection_Reporting.miz
index 2a3d5e3fc..b571f8012 100644
Binary files a/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz and b/Moose Test Missions/Moose_Test_Detection/Moose_Test_Detection_Reporting/Moose_Test_Detection_Reporting.miz differ
diff --git a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz
index 65dfac462..0abf3dc39 100644
Binary files a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz and b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz differ
diff --git a/Moose Test Missions/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.lua b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.lua
rename to Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.lua
diff --git a/Moose Test Missions/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.miz b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.miz
rename to Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.miz
index 72176f821..491ef97e2 100644
Binary files a/Moose Test Missions/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.miz and b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_CLIENT/Moose_Test_MENU_CLIENT.miz differ
diff --git a/Moose Test Missions/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.lua b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.lua
rename to Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.lua
diff --git a/Moose Test Missions/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.miz b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.miz
rename to Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.miz
index 2c695a2b4..e1fcabf00 100644
Binary files a/Moose Test Missions/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.miz and b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_COALITION/Moose_Test_MENU_COALITION.miz differ
diff --git a/Moose Test Missions/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.lua b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.lua
rename to Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.lua
diff --git a/Moose Test Missions/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.miz b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.miz
rename to Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.miz
index a889a3879..b02e87abb 100644
Binary files a/Moose Test Missions/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.miz and b/Moose Test Missions/Moose_Test_Menus/Moose_Test_MENU_GROUP/Moose_Test_MENU_GROUP.miz differ
diff --git a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua b/Moose Test Missions/Moose_Test_Missile_Trainer/Moose_Test_MISSILETRAINER.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua
rename to Moose Test Missions/Moose_Test_Missile_Trainer/Moose_Test_MISSILETRAINER.lua
diff --git a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz b/Moose Test Missions/Moose_Test_Missile_Trainer/Moose_Test_MISSILETRAINER.miz
similarity index 99%
rename from Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz
rename to Moose Test Missions/Moose_Test_Missile_Trainer/Moose_Test_MISSILETRAINER.miz
index 0ffc7a1c1..28a946744 100644
Binary files a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz and b/Moose Test Missions/Moose_Test_Missile_Trainer/Moose_Test_MISSILETRAINER.miz differ
diff --git a/Moose Test Missions/Moose_Test_PROCESS_PATROLZONE/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.lua b/Moose Test Missions/Moose_Test_Patrolling/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_PROCESS_PATROLZONE/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.lua
rename to Moose Test Missions/Moose_Test_Patrolling/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.lua
diff --git a/Moose Test Missions/Moose_Test_PROCESS_PATROLZONE/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.miz b/Moose Test Missions/Moose_Test_Patrolling/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_PROCESS_PATROLZONE/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.miz
rename to Moose Test Missions/Moose_Test_Patrolling/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.miz
index a8421d310..723555e63 100644
Binary files a/Moose Test Missions/Moose_Test_PROCESS_PATROLZONE/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.miz and b/Moose Test Missions/Moose_Test_Patrolling/Moose_Test_PROCESS_PATROLZONE_Switching/Moose_Test_PROCESS_PATROLZONE_Switching.miz differ
diff --git a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.lua b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.lua
rename to Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.lua
diff --git a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.miz b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.miz
similarity index 93%
rename from Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.miz
rename to Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.miz
index bdcf24a81..3f660206f 100644
Binary files a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.miz and b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Nested/Moose_Test_SCHEDULER_Nested.miz differ
diff --git a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.lua b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.lua
rename to Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.lua
diff --git a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.miz b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.miz
similarity index 91%
rename from Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.miz
rename to Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.miz
index 0cd820234..37483f995 100644
Binary files a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.miz and b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Repeated/Moose_Test_SCHEDULER_Repeated.miz differ
diff --git a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.lua b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.lua
rename to Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.lua
diff --git a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.miz b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.miz
rename to Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.miz
index 84df7bacf..5e3cad6a9 100644
Binary files a/Moose Test Missions/Moose_Test_SCHEDULER/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.miz and b/Moose Test Missions/Moose_Test_Scheduling/Moose_Test_SCHEDULER_Simple/Moose_Test_SCHEDULER_Simple.miz differ
diff --git a/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz b/Moose Test Missions/Moose_Test_Sead_Avoidance/MOOSE_Test_SEAD.miz
similarity index 96%
rename from Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz
rename to Moose Test Missions/Moose_Test_Sead_Avoidance/MOOSE_Test_SEAD.miz
index 865ba1781..111b28b80 100644
Binary files a/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz and b/Moose Test Missions/Moose_Test_Sead_Avoidance/MOOSE_Test_SEAD.miz differ
diff --git a/Moose Test Missions/Moose_Test_SEAD/Moose_Test_SEAD.lua b/Moose Test Missions/Moose_Test_Sead_Avoidance/Moose_Test_SEAD.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SEAD/Moose_Test_SEAD.lua
rename to Moose Test Missions/Moose_Test_Sead_Avoidance/Moose_Test_SEAD.lua
diff --git a/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.lua b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.lua
rename to Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.lua
diff --git a/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz
similarity index 91%
rename from Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz
rename to Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz
index 5b2ee3ace..444b2f450 100644
Binary files a/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz and b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz differ
diff --git a/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.lua b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.lua
rename to Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.lua
diff --git a/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz
rename to Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz
index 5f00cf2bf..42de28cb2 100644
Binary files a/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz and b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz differ
diff --git a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.lua b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.lua
rename to Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.lua
diff --git a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz
similarity index 97%
rename from Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz
rename to Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz
index 735846213..04b19fc9b 100644
Binary files a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz and b/Moose Test Missions/Moose_Test_Sets/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua b/Moose Test Missions/Moose_Test_Spawning/MOOSE_Test_SPAWN.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua
rename to Moose Test Missions/Moose_Test_Spawning/MOOSE_Test_SPAWN.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz b/Moose Test Missions/Moose_Test_Spawning/MOOSE_Test_SPAWN.miz
similarity index 97%
rename from Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz
rename to Moose Test Missions/Moose_Test_Spawning/MOOSE_Test_SPAWN.miz
index 365a6bf2a..aa66cc7e4 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz and b/Moose Test Missions/Moose_Test_Spawning/MOOSE_Test_SPAWN.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.miz
similarity index 95%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.miz
index a494b6a0c..0fbad5640 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_CleanUp/MOOSE_Test_SPAWN_CleanUp.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.miz
similarity index 97%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.miz
index 9887de4ac..d028f36f3 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitLimit/MOOSE_Test_SPAWN_InitLimit.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.miz
similarity index 96%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.miz
index d61f48736..4e68f87ac 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeTemplate/MOOSE_Test_SPAWN_InitRandomizeTemplate.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.miz
similarity index 89%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.miz
index 9098a3788..22677aec7 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRandomizeZones/Moose_Test_SPAWN_InitRandomizeZones.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.miz
similarity index 96%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.miz
index 38a885c42..016397bd0 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_InitRepeat/MOOSE_Test_SPAWN_InitRepeat.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.miz
similarity index 95%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.miz
index 5a9964587..b46664b8b 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromStatic/Moose_Test_SPAWN_SpawnFromStatic.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.miz
similarity index 96%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.miz
index 307212fc4..61674ccc9 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromUnit/Moose_Test_SPAWN_SpawnFromUnit.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.miz
similarity index 96%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.miz
index 344db0e5c..b9d49c61f 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec2/Moose_Test_SPAWN_SpawnFromVec2.miz differ
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.lua b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.lua
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.lua
diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.miz b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.miz
similarity index 95%
rename from Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.miz
rename to Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.miz
index 6472639c5..a0e3e9724 100644
Binary files a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.miz and b/Moose Test Missions/Moose_Test_Spawning/Moose_Test_SPAWN_SpawnFromVec3/Moose_Test_SPAWN_SpawnFromVec3.miz differ
diff --git a/Moose Test Missions/Moose_Test_TASK_SEAD/Moose_Test_TASK_SEAD.lua b/Moose Test Missions/Moose_Test_TASK_SEAD/Moose_Test_TASK_SEAD.lua
deleted file mode 100644
index cb4f2a967..000000000
--- a/Moose Test Missions/Moose_Test_TASK_SEAD/Moose_Test_TASK_SEAD.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-
-local Mission = MISSION:New( 'SEAD Targets', "Strategic", "SEAD the enemy", coalition.side.RED )
-local Scoring = SCORING:New( "SEAD" )
-
-Mission:AddScoring( Scoring )
-
-local SEADGroup = GROUP:FindByName( "Test SEAD" )
-local TargetSet = SET_UNIT:New():FilterPrefixes( "US Hawk SR" ):FilterStart()
-
-local TargetZone = ZONE:New( "Target Zone" )
-
-local TaskSEAD = TASK_SEAD:New( Mission, TargetSet, TargetZone ):SetName( "SEAD Radars" ):AssignToGroup( SEADGroup )
-
-
-
-
diff --git a/Moose Test Missions/Moose_Test_TASK_SEAD/Moose_Test_TASK_SEAD.miz b/Moose Test Missions/Moose_Test_TASK_SEAD/Moose_Test_TASK_SEAD.miz
deleted file mode 100644
index 75de3ae1d..000000000
Binary files a/Moose Test Missions/Moose_Test_TASK_SEAD/Moose_Test_TASK_SEAD.miz and /dev/null differ
diff --git a/Moose Test Missions/Moose_Test_DETECTION_DISPATCHER/Moose_Test_DETECTION_DISPATCHER.lua b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Detection_Dispatcher/Moose_Test_Detection_Dispatcher.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_DETECTION_DISPATCHER/Moose_Test_DETECTION_DISPATCHER.lua
rename to Moose Test Missions/Moose_Test_Tasking/Moose_Test_Detection_Dispatcher/Moose_Test_Detection_Dispatcher.lua
diff --git a/Moose Test Missions/Moose_Test_DETECTION_DISPATCHER/Moose_Test_DETECTION_DISPATCHER.miz b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Detection_Dispatcher/Moose_Test_Detection_Dispatcher.miz
similarity index 97%
rename from Moose Test Missions/Moose_Test_DETECTION_DISPATCHER/Moose_Test_DETECTION_DISPATCHER.miz
rename to Moose Test Missions/Moose_Test_Tasking/Moose_Test_Detection_Dispatcher/Moose_Test_Detection_Dispatcher.miz
index f6dba1a29..99722364c 100644
Binary files a/Moose Test Missions/Moose_Test_DETECTION_DISPATCHER/Moose_Test_DETECTION_DISPATCHER.miz and b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Detection_Dispatcher/Moose_Test_Detection_Dispatcher.miz differ
diff --git a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.lua b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_Pickup_and_Deploy/MOOSE_Test_Task_Pickup_and_Deploy.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.lua
rename to Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_Pickup_and_Deploy/MOOSE_Test_Task_Pickup_and_Deploy.lua
diff --git a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_Pickup_and_Deploy/MOOSE_Test_Task_Pickup_and_Deploy.miz
similarity index 95%
rename from Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz
rename to Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_Pickup_and_Deploy/MOOSE_Test_Task_Pickup_and_Deploy.miz
index cfe01acdc..e057baf86 100644
Binary files a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz and b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_Pickup_and_Deploy/MOOSE_Test_Task_Pickup_and_Deploy.miz differ
diff --git a/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_SEAD/Moose_Test_Task_SEAD.lua b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_SEAD/Moose_Test_Task_SEAD.lua
new file mode 100644
index 000000000..c35d1b7c2
--- /dev/null
+++ b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_SEAD/Moose_Test_Task_SEAD.lua
@@ -0,0 +1,28 @@
+
+local Mission = MISSION:New( 'SEAD Targets', "Strategic", "SEAD the enemy", coalition.side.RED )
+local Scoring = SCORING:New( "SEAD" )
+
+Mission:AddScoring( Scoring )
+
+local SEADSet = SET_GROUP:New():FilterPrefixes( "Test SEAD"):FilterStart()
+local TargetSet = SET_UNIT:New():FilterPrefixes( "US Hawk SR" ):FilterStart()
+
+local TargetZone = ZONE:New( "Target Zone" )
+
+local TaskSEAD = TASK_SEAD
+ :New( Mission, SEADSet, "SEAD Radars", TargetSet, TargetZone )
+
+TaskSEAD:AddScore( "Success", "Destroyed all target radars", 250 )
+TaskSEAD:AddScore( "Failed", "Failed to destroy all target radars", -100 )
+
+-- ASSIGN_MENU_ACCEPT:New(TaskName,TaskBriefing)
+local AssignProcess = TaskSEAD:SetProcessClass( "ASSIGN", ASSIGN_MENU_ACCEPT, "SEAD", "Hello World" )
+AssignProcess:AddScore( TaskSEAD, "Assign", "You are assigned to the task", 10 )
+
+-- ACCOUNT_DEADS:New(ProcessUnit,TargetSetUnit,TaskName)
+local AccountProcess = TaskSEAD:SetProcessClass( "ACCOUNT", ACCOUNT_DEADS, TargetSet, "SEAD" )
+AccountProcess:AddScore( TaskSEAD, "Account", "destroyed a radar", 25 )
+AccountProcess:AddScore( TaskSEAD, "Failed", "failed to destroy a radar", -100 )
+
+TaskSEAD:AssignToGroup( SEADSet:Get( "Test SEAD" ) )
+
diff --git a/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_SEAD/Moose_Test_Task_SEAD.miz b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_SEAD/Moose_Test_Task_SEAD.miz
new file mode 100644
index 000000000..b6e9631e9
Binary files /dev/null and b/Moose Test Missions/Moose_Test_Tasking/Moose_Test_Task_SEAD/Moose_Test_Task_SEAD.miz differ
diff --git a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz
index a911a88e4..722f8ce67 100644
Binary files a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz and b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz differ
diff --git a/Moose Test Missions/Moose_Test_GROUP_SwitchWayPoint/MOOSE_Test_GROUP_SwitchWayPoint.miz b/Moose Test Missions/Moose_Test_Wrapper/Moose_Test_Group/Moose_Test_GROUP_SwitchWayPoint/MOOSE_Test_GROUP_SwitchWayPoint.miz
similarity index 92%
rename from Moose Test Missions/Moose_Test_GROUP_SwitchWayPoint/MOOSE_Test_GROUP_SwitchWayPoint.miz
rename to Moose Test Missions/Moose_Test_Wrapper/Moose_Test_Group/Moose_Test_GROUP_SwitchWayPoint/MOOSE_Test_GROUP_SwitchWayPoint.miz
index bf1524560..b1794f99d 100644
Binary files a/Moose Test Missions/Moose_Test_GROUP_SwitchWayPoint/MOOSE_Test_GROUP_SwitchWayPoint.miz and b/Moose Test Missions/Moose_Test_Wrapper/Moose_Test_Group/Moose_Test_GROUP_SwitchWayPoint/MOOSE_Test_GROUP_SwitchWayPoint.miz differ
diff --git a/Moose Test Missions/Moose_Test_GROUP_SwitchWayPoint/Moose_Test_GROUP_SwitchWayPoint.lua b/Moose Test Missions/Moose_Test_Wrapper/Moose_Test_Group/Moose_Test_GROUP_SwitchWayPoint/Moose_Test_GROUP_SwitchWayPoint.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_GROUP_SwitchWayPoint/Moose_Test_GROUP_SwitchWayPoint.lua
rename to Moose Test Missions/Moose_Test_Wrapper/Moose_Test_Group/Moose_Test_GROUP_SwitchWayPoint/Moose_Test_GROUP_SwitchWayPoint.lua
diff --git a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.lua b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE/Moose_Test_ZONE.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.lua
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE/Moose_Test_ZONE.lua
diff --git a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE/Moose_Test_ZONE.miz
similarity index 95%
rename from Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE/Moose_Test_ZONE.miz
index 6ca796409..378f323d3 100644
Binary files a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz and b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE/Moose_Test_ZONE.miz differ
diff --git a/Moose Test Missions/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.lua b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.lua
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.lua
diff --git a/Moose Test Missions/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.miz b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.miz
similarity index 94%
rename from Moose Test Missions/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.miz
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.miz
index 5fec38c4d..35880973c 100644
Binary files a/Moose Test Missions/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.miz and b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_GROUP/Moose_Test_ZONE_GROUP.miz differ
diff --git a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.lua b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.lua
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.lua
diff --git a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz
similarity index 96%
rename from Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz
index 157f50660..5d6bf9dc6 100644
Binary files a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz and b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz differ
diff --git a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.lua b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.lua
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.lua
diff --git a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz
similarity index 93%
rename from Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz
index 1329f1a94..666ad57a0 100644
Binary files a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz and b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz differ
diff --git a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.lua b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.lua
similarity index 100%
rename from Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.lua
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.lua
diff --git a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz
similarity index 92%
rename from Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz
rename to Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz
index e7290ad77..4d7ab1558 100644
Binary files a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz and b/Moose Test Missions/Moose_Test_Zones/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz differ
diff --git a/Moose Training/Documentation/AIBalancer.html b/Moose Training/Documentation/AIBalancer.html
index ecefed457..530e7a3be 100644
--- a/Moose Training/Documentation/AIBalancer.html
+++ b/Moose Training/Documentation/AIBalancer.html
@@ -18,8 +18,10 @@
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.
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.
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:
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.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:
Cargo can be of various forms, always are composed out of ONE object ( one unit or one static or one slingload crate ):
+
+
+
CARGO_UNIT, represented by a Unit in a Group: Cargo can be represented by a Unit in a Group. Destruction of the Unit will mean that the cargo is lost.
+
CARGO_STATIC, represented by a Static: Cargo can be represented by a Static. Destruction of the Static will mean that the cargo is lost.
+
CARGO_PACKAGE, contained in a Unit of a Group: Cargo can be contained within a Unit of a Group. The cargo can be delivered by the Unit. If the Unit is destroyed, the cargo will be destroyed also.
+
CARGO_PACKAGE, Contained in a Static: Cargo can be contained within a Static. The cargo can be collected from the @Static. If the Static is destroyed, the cargo will be destroyed.
+
CARGO_SLINGLOAD, represented by a Cargo that is transportable: Cargo can be represented by a Cargo object that is transportable. Destruction of the Cargo will mean that the cargo is lost.
+
CARGOGROUPED, represented by a Group of CARGOUNITs.
The #CARGO_BASE class defines the core functions that defines a cargo object within MOOSE.
-A cargo is a logical object defined within a Mission, that is available for transport, and has a life status within a simulation.
+A cargo is a logical object defined that is available for transport, and has a life status within a simulation.
-
Cargo can be of various forms:
+
The CARGOBASE is a state machine: it manages the different events and states of the cargo.
+All derived classes from CARGOBASE follow the same state machine, expose the same cargo event functions, and provide the same cargo states.
+
+
1.2.1) CARBO_BASE Events:
-
CARGO_UNIT, represented by a Unit in a Group: Cargo can be represented by a Unit in a Group. Destruction of the Unit will mean that the cargo is lost.
-
CARGO_STATIC, represented by a Static: Cargo can be represented by a Static. Destruction of the Static will mean that the cargo is lost.
-
CARGO_PACKAGE, contained in a Unit of a Group: Cargo can be contained within a Unit of a Group. The cargo can be delivered by the Unit. If the Unit is destroyed, the cargo will be destroyed also.
-
CARGO_PACKAGE, Contained in a Static: Cargo can be contained within a Static. The cargo can be collected from the @Static. If the Static is destroyed, the cargo will be destroyed.
-
CARGO_SLINGLOAD, represented by a Cargo that is transportable: Cargo can be represented by a Cargo object that is transportable. Destruction of the Cargo will mean that the cargo is lost.
CARBO_BASE.Dead( Controllable ): The cargo is dead. The cargo process will be ended.
-
1.2) CARGO state machine:
-
The CARGO is a state machine: it manages the different events and states of the Controllable it is controlling.
-
-
1.2.1) CARGO Events:
-
-
-
CARGO.Board( ToCarrier ): Boards the cargo to a Carrier.
-
CARGO.Load( ToCarrier ): Loads the cargo into a Carrier, regardless of its position.
-
CARGO.UnBoard( ToPointVec2 ): UnBoard the cargo from a Carrier. This will trigger a movement of the cargo to the option ToPointVec2.
-
CARGO.UnLoad( ToPointVec2 ): UnLoads the cargo from a Carrier.
-
CARGO.Dead( Controllable ): The cargo is dead. The cargo process will be ended.
-
-
-
1.2.2) PROCESS_PATROLZONE States:
+
1.2.2) CARBO_BASE States:
UnLoaded: The cargo is unloaded from a carrier.
@@ -129,7 +128,7 @@ A cargo is a logical object defined within a Mission,
End: The process has come to an end.
-
1.2.3) PROCESS_PATROLZONE state transition functions:
+
1.2.3) CARBO_BASE 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:
@@ -142,14 +141,24 @@ There are 2 moments when state transition functions will be called by the state
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.
-
+ These state transition functions need to provide a return value, which is specified at the function description.
+
2) #CARGO_UNIT class
+
The CARGOUNIT class defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.
+Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGOUNIT objects to and from carriers.
+
+
5) #CARGO_GROUPED class
+
The CARGOGROUPED class defines a cargo that is represented by a group of UNIT objects within the simulator, and can be transported by a carrier.
+Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGOUNIT objects to and from carriers.
+
+
This module is still under construction, but is described above works already, and will keep working ...
The cargo must be in the Loaded state.
-UnLoads the cargo to a Carrier. The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading.
+
The event will create a movement (= running or driving) of the cargo to the Carrier.
+The cargo must be in the UnLoaded state.
Parameter
-
Point#POINT_VEC2 ToPointVec2 :
-(optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
The cargo must be in the UnLoaded state.
-Loads the cargo to a Carrier. The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading.
+
The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading.
+The cargo must be in the UnLoaded state.
Parameter
@@ -772,8 +937,8 @@ The Carrier that will hold the cargo.
The event will create a movement (= running or driving) of the cargo from the Carrier.
+The cargo must be in the Loaded state.
+
+
Parameter
+
+
+
+
Point#POINT_VEC2 ToPointVec2 :
+(optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading.
+The cargo must be in the Loaded state.
+
+
Parameter
+
+
+
+
Point#POINT_VEC2 ToPointVec2 :
+(optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading.
+The cargo must be in the UnLoaded state.
+
+
Parameters
+
+
+
+
#number DelaySeconds :
+The amount of seconds to delay the action.
The event will create a movement (= running or driving) of the cargo from the Carrier.
+The cargo must be in the Loaded state.
+
+
Parameters
+
+
+
+
#number DelaySeconds :
+The amount of seconds to delay the action.
+
+
+
+
+
Point#POINT_VEC2 ToPointVec2 :
+(optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading.
+The cargo must be in the Loaded state.
+
+
Parameters
+
+
+
+
#number DelaySeconds :
+The amount of seconds to delay the action.
+
+
+
+
+
Point#POINT_VEC2 ToPointVec2 :
+(optional) @{Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
The cargo must be in the Loaded state.
-UnBoards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo from the Carrier.
-
-
Parameter
+
Parameters
-
Point#POINT_VEC2 ToPointVec2 :
-(optional) @{Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
The #PATROLZONE class implements the core functions to patrol a Zone by an AIR ControllableGroup.
+The patrol algorithm works that for each airplane patrolling, upon arrival at the patrol zone,
+a random point is selected as the route point within the 3D space, within the given boundary limits.
+The airplane will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
+Upon arrival at the random 3D point, a new 3D random point will be selected within the patrol zone using the given limits.
+This cycle will continue until a fuel treshold has been reached by the airplane.
+When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.
The PATROLZONE is a state machine: it manages the different events and states of the AIControllable it is controlling.
+
+
1.2.1) PATROLZONE Events:
+
+
+
PATROLZONE.Route( AIControllable ): A new 3D route point is selected and the AIControllable will fly towards that point with the given speed.
+
PATROLZONE.Patrol( AIControllable ): The AIControllable reports it is patrolling. This event is called every 30 seconds.
+
PATROLZONE.RTB( AIControllable ): The AIControllable will report return to base.
+
PATROLZONE.End( AIControllable ): The end of the PATROLZONE process.
+
PATROLZONE.Dead( AIControllable ): The AIControllable is dead. The PATROLZONE process will be ended.
+
+
+
1.2.2) PATROLZONE States:
+
+
+
Route: A new 3D route point is selected and the AIControllable will fly towards that point with the given speed.
+
Patrol: The AIControllable is patrolling. This state is set every 30 seconds, so every 30 seconds, a state transition function can be used.
+
RTB: The AIControllable reports it wants to return to the base.
+
Dead: The AIControllable is dead ...
+
End: The process has come to an end.
+
+
+
1.2.3) PATROLZONE 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.
+
+
+
An example how to manage a state transition for an PATROLZONE object Patrol for the state RTB:
OnBeforeRTB( AIGroup ) will be called by the PATROLZONE object when the AIGroup reports RTB, but before the RTB default action is processed by the PATROLZONE object.
+
+
--- State transition function for the PATROLZONE **Patrol** object
+ -- @param #PATROLZONE self
+ -- @param Controllable#CONTROLLABLE AIGroup
+ -- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
+ function Patrol:OnBeforeRTB( AIGroup )
+ AIGroup:MessageToRed( "Returning to base", 20 )
+ end
+
+
+
OnAfterRTB( AIGroup ) will be called by the PATROLZONE object when the AIGroup reports RTB, but after the RTB default action was processed by the PATROLZONE object.
+
+
--- State transition function for the PATROLZONE **Patrol** object
+ -- @param #PATROLZONE self
+ -- @param Controllable#CONTROLLABLE AIGroup
+ -- @return #Controllable#CONTROLLABLE The new AIGroup object that is set to be patrolling the zone.
+ function Patrol:OnAfterRTB( AIGroup )
+ return PatrolSpawn:Spawn()
+ end
+
+
+
1.3) Manage the PATROLZONE parameters:
+
The following methods are available to modify the parameters of a PATROLZONE object:
When the AIControllable is out of fuel, it is required that a new AIControllable is started, before the old AIControllable can return to the home base.
+Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
+When the fuel treshold is reached, the AIControllable will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the PATROLZONE.
+Once the time is finished, the old AIControllable will return to the base.
+Use the method PATROLZONE.ManageFuel() to have this proces in place.
+
+
+
+
API CHANGE HISTORY
+
+
The underlying change log documents the API changes. Please read this carefully. The following notation is used:
When the AIControllable is out of fuel, it is required that a new AIControllable is started, before the old AIControllable can return to the home base.
When the AIControllable is out of fuel, it is required that a new AIControllable is started, before the old AIControllable can return to the home base.
+
+
+
Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
+When the fuel treshold is reached, the AIControllable will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the PATROLZONE.
+Once the time is finished, the old AIControllable will return to the base.
+
+
Parameters
+
+
+
+
#number PatrolFuelTresholdPercentage :
+The treshold in percentage (between 0 and 1) when the AIControllable is considered to get out of fuel.
+
+
+
+
+
#number PatrolOutOfFuelOrbitTime :
+The amount of seconds the out of fuel AIControllable will orbit before returning to the base.
-- Define a new PATROLZONE Object. This PatrolArea will patrol an AIControllable within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
+PatrolZone = ZONE:New( 'PatrolZone' )
+PatrolSpawn = SPAWN:New( 'Patrol Group' )
+PatrolArea = PATROLZONE:New( PatrolZone, 3000, 6000, 600, 900 )
The #PROCESS_PATROLZONE class implements the core functions to patrol a Zone by an AIR ControllableGroup.
The patrol algorithm works that for each airplane patrolling, upon arrival at the patrol zone,
a random point is selected as the route point within the 3D space, within the given boundary limits.
The airplane will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
@@ -210,9 +208,7 @@ Use the method PROCESS_PATROLZONE.Ma
The #ROUTEZONE class implements the core functions to route an AIR Controllable player Unit to a Zone.
+The player receives on perioding times messages with the coordinates of the route to follow.
+Upon arrival at the zone, a confirmation of arrival is sent, and the process will be ended.
The ROUTEZONE is a state machine: it manages the different events and states of the Controllable it is controlling.
+
+
1.2.1) ROUTEZONE Events:
+
+
+
ROUTEZONE.Start( Controllable ): Start the route to the zone. Messages will appear within defined intervals.
+
+
+
1.2.2) ROUTEZONE States:
+
+
+
UnArrived: The player is still underway to the zone.
+
Arrived: The Controllable has arrived at the zone.
+
+
+
1.2.3) ROUTEZONE 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 ROUTEZONE parameters:
+
The following methods are available to modify the parameters of a ROUTEZONE object:
The #ACCOUNT_DEADS class detects, counts and reports successful hits to DCS objects.
+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 destruction will trigger a status change.
The ACCOUNT is a state machine: it manages the different events and states of the Controllable it is controlling.
+
+
1.2.1) ACCOUNT Events:
+
+
Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions to occur in the process.
+There are two types of event methods:
+
+
+
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.
+
+
+
These are the events defined in this class:
+
+
+
Start: The process is started. The process will go into the Waiting state.
+
Event: A relevant event has occured that needs to be accounted for. The process will go into the Account state.
+
More: There are more DCS events that need to be accounted for. The process will go back into the Waiting state.
+
NoMore: There are no more DCS events that need to be accounted for. The process will go into the Success state.
+
+
+
1.2.2) ACCOUNT States:
+
+
+
Assigned: The player is assigned to the task. This is the initialization state for the process.
+
Waiting: The process is awaiting an DCS event to occur within the simulator. This event is called automatically every 1 second.
+
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.
+
+
1.2.3) ACCOUNT_DEADS 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 ACCOUNT_DEADS parameters:
+
The following methods are available to modify the parameters of a ACCOUNT_DEADS object: