mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #213 from FlightControl-Master/FlightControl
Flightcontrol
This commit is contained in:
commit
d6ff4221e7
@ -896,23 +896,7 @@ end
|
||||
|
||||
return self
|
||||
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 )
|
||||
self:T( "Assign" )
|
||||
|
||||
@ -944,14 +928,14 @@ end
|
||||
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
|
||||
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...
|
||||
if self.Scores[To] then
|
||||
if self._Scores[To] then
|
||||
|
||||
local Task = self.Task
|
||||
local Scoring = Task:GetScoring()
|
||||
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
|
||||
|
||||
@ -274,27 +274,30 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
||||
local PlayerName = PlayerUnit:GetPlayerName()
|
||||
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] = {}
|
||||
PlayerData.Mission[MissionName].ScoreTask = 0
|
||||
PlayerData.Mission[MissionName].ScoreMission = 0
|
||||
if not PlayerData.Mission[MissionName] then
|
||||
PlayerData.Mission[MissionName] = {}
|
||||
PlayerData.Mission[MissionName].ScoreTask = 0
|
||||
PlayerData.Mission[MissionName].ScoreMission = 0
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170123_1416' )
|
||||
env.info( 'Moose Generation Timestamp: 20170123_1503' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -11651,23 +11651,7 @@ end
|
||||
|
||||
return self
|
||||
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 )
|
||||
self:T( "Assign" )
|
||||
|
||||
@ -11699,14 +11683,14 @@ end
|
||||
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
|
||||
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...
|
||||
if self.Scores[To] then
|
||||
if self._Scores[To] then
|
||||
|
||||
local Task = self.Task
|
||||
local Scoring = Task:GetScoring()
|
||||
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
|
||||
@ -17524,27 +17508,30 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
||||
local PlayerName = PlayerUnit:GetPlayerName()
|
||||
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] = {}
|
||||
PlayerData.Mission[MissionName].ScoreTask = 0
|
||||
PlayerData.Mission[MissionName].ScoreMission = 0
|
||||
if not PlayerData.Mission[MissionName] then
|
||||
PlayerData.Mission[MissionName] = {}
|
||||
PlayerData.Mission[MissionName].ScoreTask = 0
|
||||
PlayerData.Mission[MissionName].ScoreMission = 0
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||
env.info( 'Moose Generation Timestamp: 20170123_1416' )
|
||||
env.info( 'Moose Generation Timestamp: 20170123_1503' )
|
||||
local base = _G
|
||||
|
||||
Include = {}
|
||||
@ -11651,23 +11651,7 @@ end
|
||||
|
||||
return self
|
||||
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 )
|
||||
self:T( "Assign" )
|
||||
|
||||
@ -11699,14 +11683,14 @@ end
|
||||
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
|
||||
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...
|
||||
if self.Scores[To] then
|
||||
if self._Scores[To] then
|
||||
|
||||
local Task = self.Task
|
||||
local Scoring = Task:GetScoring()
|
||||
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
|
||||
@ -17524,27 +17508,30 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score )
|
||||
local PlayerName = PlayerUnit:GetPlayerName()
|
||||
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] = {}
|
||||
PlayerData.Mission[MissionName].ScoreTask = 0
|
||||
PlayerData.Mission[MissionName].ScoreMission = 0
|
||||
if not PlayerData.Mission[MissionName] then
|
||||
PlayerData.Mission[MissionName] = {}
|
||||
PlayerData.Mission[MissionName].ScoreTask = 0
|
||||
PlayerData.Mission[MissionName].ScoreMission = 0
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
--- Task Modelling - SEAD
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Name: TSK-010 - Task Modelling - SEAD
|
||||
-- Author: FlightControl
|
||||
-- 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 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.
|
||||
--
|
||||
-- # Status: TESTING - 15 Dec 2016
|
||||
|
||||
|
||||
-- Create the HQ object.
|
||||
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()
|
||||
-- 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" } )
|
||||
|
||||
do 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" } ) -- FSM SUB for type SEADProcess.
|
||||
|
||||
--- OnLeave State Transition for Planned.
|
||||
-- @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
|
||||
SEADProcess:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( TargetZone ), { Arrived = "Update" } ) -- FSM SUB for type SEADProcess.
|
||||
|
||||
-- Adding a new Action...
|
||||
-- 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.
|
||||
-- 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.
|
||||
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.
|
||||
-- @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.
|
||||
SEADProcess:AddTransition( "Rejected", "Eject", "Planned" )
|
||||
|
||||
--- OnAfter State Transition for Eject.
|
||||
-- @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
|
||||
SEADProcess:AddTransition( "Arrived", "Update", "Updated" )
|
||||
|
||||
--- Delayed Event Trigger for Eject
|
||||
-- @function [parent=#SEADProcess] __Eject
|
||||
-- @param #SEADProcess self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
SEADProcess:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( TargetSet, "SEAD" ), { Accounted = "Success" } )
|
||||
|
||||
end -- SEADProcess
|
||||
do SEADProcess:AddTransition( "Arrived", "Update", "Updated" ) -- FSM_CONTROLLABLE TRANSITION for type SEADProcess.
|
||||
SEADProcess:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( TargetSet, TargetZone ) )
|
||||
|
||||
SEADProcess:AddTransition( "Arrived", "Update", "Updated" )
|
||||
|
||||
--- 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.
|
||||
SEADProcess:AddTransition( "Accounted", "Success", "Success" )
|
||||
|
||||
--- OnEnter State Transition for Updated.
|
||||
-- @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:AddTransition( "*", "Fail", "Failed" )
|
||||
|
||||
SEADProcess:AddScoreProcess( "Updated", "Account", "Account", "destroyed a radar", 25 )
|
||||
SEADProcess:AddScoreProcess( "Updated", "Account", "Failed", "failed to destroy a radar", -10 )
|
||||
@ -520,7 +180,6 @@ end
|
||||
function SEADTask:OnEnterPlayerCrashed( PlayerUnit, PlayerName )
|
||||
if not SEADTask:HasAliveUnits() then
|
||||
SEADTask:__Abort()
|
||||
SEADTask:__Replan( 30 )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user