Merge pull request #213 from FlightControl-Master/FlightControl

Flightcontrol
This commit is contained in:
Sven Van de Velde 2017-01-23 15:05:34 +01:00 committed by GitHub
commit d6ff4221e7
7 changed files with 89 additions and 469 deletions

View File

@ -896,23 +896,7 @@ end
return self return self
end end
--- Adds a score for the FSM_PROCESS to be achieved.
-- @param #FSM_PROCESS self
-- @param #string State 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 #FSM_PROCESS self
function FSM_PROCESS:AddScore( State, ScoreText, Score )
self:F2( { State, ScoreText, Score } )
self.Scores[State] = self.Scores[State] or {}
self.Scores[State].ScoreText = ScoreText
self.Scores[State].Score = Score
return self
end
function FSM_PROCESS:onenterAssigned( ProcessUnit ) function FSM_PROCESS:onenterAssigned( ProcessUnit )
self:T( "Assign" ) self:T( "Assign" )
@ -944,14 +928,14 @@ end
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll() MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end end
self:T( self.Scores[To] ) self:T( self._Scores[To] )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects... -- 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 if self._Scores[To] then
local Task = self.Task local Task = self.Task
local Scoring = Task:GetScoring() local Scoring = Task:GetScoring()
if Scoring then if Scoring then
Scoring:_AddMissionTaskScore( Task.Mission, 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 end
end end

View File

@ -274,27 +274,30 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
local PlayerName = PlayerUnit:GetPlayerName() local PlayerName = PlayerUnit:GetPlayerName()
local MissionName = Mission:GetName() local MissionName = Mission:GetName()
self:F( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } ) self:E( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
if PlayerName then
local PlayerData = self.Players[PlayerName]
local PlayerData = self.Players[PlayerName] if not PlayerData.Mission[MissionName] then
PlayerData.Mission[MissionName] = {}
if not PlayerData.Mission[MissionName] then PlayerData.Mission[MissionName].ScoreTask = 0
PlayerData.Mission[MissionName] = {} PlayerData.Mission[MissionName].ScoreMission = 0
PlayerData.Mission[MissionName].ScoreTask = 0 end
PlayerData.Mission[MissionName].ScoreMission = 0
self:T( PlayerName )
self:T( PlayerData.Mission[MissionName] )
PlayerData.Score = self.Players[PlayerName].Score + Score
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
MESSAGE:New( "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
Score .. " task score!",
30 ):ToAll()
self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
end end
self:T( PlayerName )
self:T( PlayerData.Mission[MissionName] )
PlayerData.Score = self.Players[PlayerName].Score + Score
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
MESSAGE:New( "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
Score .. " task score!",
30 ):ToAll()
self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
end end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' ) env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170123_1416' ) env.info( 'Moose Generation Timestamp: 20170123_1503' )
local base = _G local base = _G
Include = {} Include = {}
@ -11651,23 +11651,7 @@ end
return self return self
end end
--- Adds a score for the FSM_PROCESS to be achieved.
-- @param #FSM_PROCESS self
-- @param #string State 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 #FSM_PROCESS self
function FSM_PROCESS:AddScore( State, ScoreText, Score )
self:F2( { State, ScoreText, Score } )
self.Scores[State] = self.Scores[State] or {}
self.Scores[State].ScoreText = ScoreText
self.Scores[State].Score = Score
return self
end
function FSM_PROCESS:onenterAssigned( ProcessUnit ) function FSM_PROCESS:onenterAssigned( ProcessUnit )
self:T( "Assign" ) self:T( "Assign" )
@ -11699,14 +11683,14 @@ end
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll() MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end end
self:T( self.Scores[To] ) self:T( self._Scores[To] )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects... -- 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 if self._Scores[To] then
local Task = self.Task local Task = self.Task
local Scoring = Task:GetScoring() local Scoring = Task:GetScoring()
if Scoring then if Scoring then
Scoring:_AddMissionTaskScore( Task.Mission, 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 end
end end
@ -17524,27 +17508,30 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
local PlayerName = PlayerUnit:GetPlayerName() local PlayerName = PlayerUnit:GetPlayerName()
local MissionName = Mission:GetName() local MissionName = Mission:GetName()
self:F( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } ) self:E( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
if PlayerName then
local PlayerData = self.Players[PlayerName]
local PlayerData = self.Players[PlayerName] if not PlayerData.Mission[MissionName] then
PlayerData.Mission[MissionName] = {}
if not PlayerData.Mission[MissionName] then PlayerData.Mission[MissionName].ScoreTask = 0
PlayerData.Mission[MissionName] = {} PlayerData.Mission[MissionName].ScoreMission = 0
PlayerData.Mission[MissionName].ScoreTask = 0 end
PlayerData.Mission[MissionName].ScoreMission = 0
self:T( PlayerName )
self:T( PlayerData.Mission[MissionName] )
PlayerData.Score = self.Players[PlayerName].Score + Score
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
MESSAGE:New( "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
Score .. " task score!",
30 ):ToAll()
self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
end end
self:T( PlayerName )
self:T( PlayerData.Mission[MissionName] )
PlayerData.Score = self.Players[PlayerName].Score + Score
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
MESSAGE:New( "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
Score .. " task score!",
30 ):ToAll()
self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
end end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' ) env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170123_1416' ) env.info( 'Moose Generation Timestamp: 20170123_1503' )
local base = _G local base = _G
Include = {} Include = {}
@ -11651,23 +11651,7 @@ end
return self return self
end end
--- Adds a score for the FSM_PROCESS to be achieved.
-- @param #FSM_PROCESS self
-- @param #string State 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 #FSM_PROCESS self
function FSM_PROCESS:AddScore( State, ScoreText, Score )
self:F2( { State, ScoreText, Score } )
self.Scores[State] = self.Scores[State] or {}
self.Scores[State].ScoreText = ScoreText
self.Scores[State].Score = Score
return self
end
function FSM_PROCESS:onenterAssigned( ProcessUnit ) function FSM_PROCESS:onenterAssigned( ProcessUnit )
self:T( "Assign" ) self:T( "Assign" )
@ -11699,14 +11683,14 @@ end
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll() MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end end
self:T( self.Scores[To] ) self:T( self._Scores[To] )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects... -- 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 if self._Scores[To] then
local Task = self.Task local Task = self.Task
local Scoring = Task:GetScoring() local Scoring = Task:GetScoring()
if Scoring then if Scoring then
Scoring:_AddMissionTaskScore( Task.Mission, 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 end
end end
@ -17524,27 +17508,30 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
local PlayerName = PlayerUnit:GetPlayerName() local PlayerName = PlayerUnit:GetPlayerName()
local MissionName = Mission:GetName() local MissionName = Mission:GetName()
self:F( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } ) self:E( { Mission:GetName(), PlayerUnit.UnitName, PlayerName, Text, Score } )
-- PlayerName can be nil, if the Unit with the player crashed or due to another reason.
if PlayerName then
local PlayerData = self.Players[PlayerName]
local PlayerData = self.Players[PlayerName] if not PlayerData.Mission[MissionName] then
PlayerData.Mission[MissionName] = {}
if not PlayerData.Mission[MissionName] then PlayerData.Mission[MissionName].ScoreTask = 0
PlayerData.Mission[MissionName] = {} PlayerData.Mission[MissionName].ScoreMission = 0
PlayerData.Mission[MissionName].ScoreTask = 0 end
PlayerData.Mission[MissionName].ScoreMission = 0
self:T( PlayerName )
self:T( PlayerData.Mission[MissionName] )
PlayerData.Score = self.Players[PlayerName].Score + Score
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
MESSAGE:New( "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
Score .. " task score!",
30 ):ToAll()
self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
end end
self:T( PlayerName )
self:T( PlayerData.Mission[MissionName] )
PlayerData.Score = self.Players[PlayerName].Score + Score
PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score
MESSAGE:New( "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " ..
Score .. " task score!",
30 ):ToAll()
self:ScoreCSV( PlayerName, "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() )
end end

View File

@ -1,7 +1,4 @@
--- Task Modelling - SEAD -- Name: TSK-010 - Task Modelling - SEAD
--
-- ===
--
-- Author: FlightControl -- Author: FlightControl
-- Date Created: 15 Dec 2016 -- Date Created: 15 Dec 2016
-- --
@ -62,9 +59,6 @@
-- * When a player joins the task, a message is displayed of the player joining, but only to the group assigned to execute the task. -- * When a player joins the task, a message is displayed of the player joining, but only to the group assigned to execute the task.
-- * When a player crashes into the ground, a message is displayed of that event. -- * When a player crashes into the ground, a message is displayed of that event.
-- * In multi player, when the Task was assigned to the group, but all players in that group aborted the Task, the Task should become Aborted. It will be replanned in 30 seconds. -- * In multi player, when the Task was assigned to the group, but all players in that group aborted the Task, the Task should become Aborted. It will be replanned in 30 seconds.
--
-- # Status: TESTING - 15 Dec 2016
-- Create the HQ object. -- Create the HQ object.
local HQ = COMMANDCENTER:New( GROUP:FindByName( "HQ" ) ) local HQ = COMMANDCENTER:New( GROUP:FindByName( "HQ" ) )
@ -140,89 +134,9 @@ local SEADProcess = SEADTask:GetUnitProcess() -- #SEADProcess
-- 4.2 When the return state is Rejected, fire the event in the Task FsmSEAD:Eject() -- 4.2 When the return state is Rejected, fire the event in the Task FsmSEAD:Eject()
-- All other AddProcess calls are working in a similar manner. -- All other AddProcess calls are working in a similar manner.
SEADProcess:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "SEAD the Area" ), { Assigned = "Route", Rejected = "Eject" } ) -- FSM SUB for type SEADProcess.
--SEADProcess:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "SEAD the Area" ), { Assigned = "Route", Rejected = "Eject" } )
do SEADProcess:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "SEAD the Area" ), { Assigned = "Route", Rejected = "Eject" } ) -- FSM SUB for type SEADProcess.
--- OnLeave State Transition for Planned. SEADProcess:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( TargetZone ), { Arrived = "Update" } ) -- FSM SUB for type SEADProcess.
-- @function [parent=#SEADProcess] OnLeavePlanned
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnBefore State Transition for Accept.
-- @function [parent=#SEADProcess] OnBeforeAccept
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter State Transition for Accept.
-- @function [parent=#SEADProcess] OnAfterAccept
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Embedded Event Trigger for Accept.
-- @function [parent=#SEADProcess] Accept
-- @param #SEADProcess self
--- Delayed Event Trigger for Accept
-- @function [parent=#SEADProcess] __Accept
-- @param #SEADProcess self
-- @param #number Delay The delay in seconds.
end -- SEADProcess
-- Same, adding a process.
--SEADProcess:AddProcess ( "Assigned", "Route", ACT_ROUTE_ZONE:New( TargetZone ), { Arrived = "Update" } )
do SEADProcess:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( TargetZone ), { Arrived = "Update" } ) -- FSM SUB for type SEADProcess.
--- OnLeave State Transition for Assigned.
-- @function [parent=#SEADProcess] OnLeaveAssigned
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnBefore State Transition for Route.
-- @function [parent=#SEADProcess] OnBeforeRoute
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter State Transition for Route.
-- @function [parent=#SEADProcess] OnAfterRoute
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Embedded Event Trigger for Route.
-- @function [parent=#SEADProcess] Route
-- @param #SEADProcess self
--- Delayed Event Trigger for Route
-- @function [parent=#SEADProcess] __Route
-- @param #SEADProcess self
-- @param #number Delay The delay in seconds.
end -- SEADProcess
-- Adding a new Action... -- Adding a new Action...
-- Actions define also the flow of the Task, but the actions will need to be programmed within your script. -- Actions define also the flow of the Task, but the actions will need to be programmed within your script.
@ -231,272 +145,18 @@ end -- SEADProcess
-- 1. State From "Rejected". When the FsmSEAD is in state "Rejected", the event "Eject" can be fired. -- 1. State From "Rejected". When the FsmSEAD is in state "Rejected", the event "Eject" can be fired.
-- 2. Event "Eject". This event can be triggered synchronously through FsmSEAD:Eject() or asynchronously through FsmSEAD:__Eject(secs). -- 2. Event "Eject". This event can be triggered synchronously through FsmSEAD:Eject() or asynchronously through FsmSEAD:__Eject(secs).
-- 3. State To "Planned". After the event has been fired, the FsmSEAD will transition to Planned. -- 3. State To "Planned". After the event has been fired, the FsmSEAD will transition to Planned.
do SEADProcess:AddTransition( "Rejected", "Eject", "Planned" ) -- FSM_CONTROLLABLE TRANSITION for type SEADProcess.
--- OnLeave State Transition for Rejected.
-- @function [parent=#SEADProcess] OnLeaveRejected
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter State Transition for Planned. SEADProcess:AddTransition( "Rejected", "Eject", "Planned" )
-- @function [parent=#SEADProcess] OnEnterPlanned
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- OnBefore State Transition for Eject.
-- @function [parent=#SEADProcess] OnBeforeEject
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter State Transition for Eject. SEADProcess:AddTransition( "Arrived", "Update", "Updated" )
-- @function [parent=#SEADProcess] OnAfterEject
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #SEADProcess self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Embedded Event Trigger for Eject.
-- @function [parent=#SEADProcess] Eject
-- @param #SEADProcess self
--- Delayed Event Trigger for Eject SEADProcess:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( TargetSet, "SEAD" ), { Accounted = "Success" } )
-- @function [parent=#SEADProcess] __Eject
-- @param #SEADProcess self
-- @param #number Delay The delay in seconds.
end -- SEADProcess SEADProcess:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( TargetSet, TargetZone ) )
do SEADProcess:AddTransition( "Arrived", "Update", "Updated" ) -- FSM_CONTROLLABLE TRANSITION for type SEADProcess.
SEADProcess:AddTransition( "Arrived", "Update", "Updated" ) SEADProcess:AddTransition( "Accounted", "Success", "Success" )
--- OnLeave State Transition for Arrived.
-- @function [parent=#SEADProcess] OnLeaveArrived
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter State Transition for Updated. SEADProcess:AddTransition( "*", "Fail", "Failed" )
-- @function [parent=#SEADProcess] OnEnterUpdated
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- OnBefore State Transition for Update.
-- @function [parent=#SEADProcess] OnBeforeUpdate
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter State Transition for Update.
-- @function [parent=#SEADProcess] OnAfterUpdate
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #SEADProcess self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Embedded Event Trigger for Update.
-- @function [parent=#SEADProcess] Update
-- @param #SEADProcess self
--- Delayed Event Trigger for Update
-- @function [parent=#SEADProcess] __Update
-- @param #SEADProcess self
-- @param #number Delay The delay in seconds.
end -- SEADProcess
do SEADProcess:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( TargetSet, "SEAD" ), { Accounted = "Success" } ) -- FSM_CONTROLLABLE Process for #SEADProcess.
--- OnLeave State Transition for Updated.
-- @function [parent=#SEADProcess] OnLeaveUpdated
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnBefore State Transition for Account.
-- @function [parent=#SEADProcess] OnBeforeAccount
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter State Transition for Account.
-- @function [parent=#SEADProcess] OnAfterAccount
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Embedded Event Trigger for Account.
-- @function [parent=#SEADProcess] Account
-- @param #SEADProcess self
--- Delayed Event Trigger for Account
-- @function [parent=#SEADProcess] __Account
-- @param #SEADProcess self
-- @param #number Delay The delay in seconds.
end -- SEADProcess
do SEADProcess:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( TargetSet, TargetZone ) ) -- FSM_CONTROLLABLE Process for #SEADProcess.
--- OnLeave State Transition for Updated.
-- @function [parent=#SEADProcess] OnLeaveUpdated
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnBefore State Transition for Smoke.
-- @function [parent=#SEADProcess] OnBeforeSmoke
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter State Transition for Smoke.
-- @function [parent=#SEADProcess] OnAfterSmoke
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Embedded Event Trigger for Smoke.
-- @function [parent=#SEADProcess] Smoke
-- @param #SEADProcess self
--- Delayed Event Trigger for Smoke
-- @function [parent=#SEADProcess] __Smoke
-- @param #SEADProcess self
-- @param #number Delay The delay in seconds.
end -- SEADProcess
do SEADProcess:AddTransition( "Accounted", "Success", "Success" ) -- FSM_CONTROLLABLE Transition for type #SEADProcess.
--- OnLeave State Transition for Accounted.
-- @function [parent=#SEADProcess] OnLeaveAccounted
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter State Transition for Success.
-- @function [parent=#SEADProcess] OnEnterSuccess
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- OnBefore State Transition for Success.
-- @function [parent=#SEADProcess] OnBeforeSuccess
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter State Transition for Success.
-- @function [parent=#SEADProcess] OnAfterSuccess
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #SEADProcess self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Embedded Event Trigger for Success.
-- @function [parent=#SEADProcess] Success
-- @param #SEADProcess self
--- Delayed Event Trigger for Success
-- @function [parent=#SEADProcess] __Success
-- @param #SEADProcess self
-- @param #number Delay The delay in seconds.
end -- SEADProcess
do SEADProcess:AddTransition( "*", "Fail", "Failed" ) -- FSM_CONTROLLABLE Transition for type #SEADProcess.
--- OnLeave State Transition for *.
-- @function [parent=#SEADProcess] OnLeave*
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnEnter State Transition for Failed.
-- @function [parent=#SEADProcess] OnEnterFailed
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- OnBefore State Transition for Fail.
-- @function [parent=#SEADProcess] OnBeforeFail
-- @param #SEADProcess self
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
-- @return #boolean Return false to cancel Transition.
--- OnAfter State Transition for Fail.
-- @function [parent=#SEADProcess] OnAfterFail
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
-- @param #SEADProcess self
-- @param #string From The From State string.
-- @param #string Event The Event string.
-- @param #string To The To State string.
--- Embedded Event Trigger for Fail.
-- @function [parent=#SEADProcess] Fail
-- @param #SEADProcess self
--- Delayed Event Trigger for Fail
-- @function [parent=#SEADProcess] __Fail
-- @param #SEADProcess self
-- @param #number Delay The delay in seconds.
end -- SEADProcess
SEADProcess:AddScoreProcess( "Updated", "Account", "Account", "destroyed a radar", 25 ) SEADProcess:AddScoreProcess( "Updated", "Account", "Account", "destroyed a radar", 25 )
SEADProcess:AddScoreProcess( "Updated", "Account", "Failed", "failed to destroy a radar", -10 ) SEADProcess:AddScoreProcess( "Updated", "Account", "Failed", "failed to destroy a radar", -10 )
@ -520,7 +180,6 @@ end
function SEADTask:OnEnterPlayerCrashed( PlayerUnit, PlayerName ) function SEADTask:OnEnterPlayerCrashed( PlayerUnit, PlayerName )
if not SEADTask:HasAliveUnits() then if not SEADTask:HasAliveUnits() then
SEADTask:__Abort() SEADTask:__Abort()
SEADTask:__Replan( 30 )
end end
end end