Got Task_SEAD template working with all the variations and complexity!

This commit is contained in:
FlightControl 2017-03-04 08:51:31 +01:00
parent 5ddeb8d396
commit b46d61d865
13 changed files with 68834 additions and 90 deletions

View File

@ -231,7 +231,6 @@ do -- ACT_ACCOUNT_DEADS
if self.TargetSetUnit:FindUnit( EventData.IniUnitName ) then if self.TargetSetUnit:FindUnit( EventData.IniUnitName ) then
local TaskGroup = ProcessUnit:GetGroup() local TaskGroup = ProcessUnit:GetGroup()
self.TargetSetUnit:RemoveUnitsByName( EventData.IniUnitName )
self:Message( "You hit a target. Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:Count() .. " targets ( " .. self.TargetSetUnit:GetUnitTypesText() .. " ) left to be destroyed." ) self:Message( "You hit a target. Your group with assigned " .. self.TaskName .. " task has " .. self.TargetSetUnit:Count() .. " targets ( " .. self.TargetSetUnit:GetUnitTypesText() .. " ) left to be destroyed." )
end end
end end
@ -244,7 +243,7 @@ do -- ACT_ACCOUNT_DEADS
-- @param #string To -- @param #string To
function ACT_ACCOUNT_DEADS:onafterEvent( ProcessUnit, From, Event, To, EventData ) function ACT_ACCOUNT_DEADS:onafterEvent( ProcessUnit, From, Event, To, EventData )
if self.TargetSetUnit:Count() > 0 then if self.TargetSetUnit:Count() > 1 then
self:__More( 1 ) self:__More( 1 )
else else
self:__NoMore( 1 ) self:__NoMore( 1 )
@ -259,7 +258,7 @@ do -- ACT_ACCOUNT_DEADS
self:T( { "EventDead", EventData } ) self:T( { "EventDead", EventData } )
if EventData.IniDCSUnit then if EventData.IniDCSUnit then
self:__Event( 1, EventData ) self:Event( EventData )
end end
end end

View File

@ -223,6 +223,7 @@ do -- ACT_ROUTE_POINT
-- @param #ACT_ROUTE_POINT self -- @param #ACT_ROUTE_POINT self
-- @param Core.Point#POINT_VEC2 PointVec2 The PointVec2 to route to. -- @param Core.Point#POINT_VEC2 PointVec2 The PointVec2 to route to.
function ACT_ROUTE_POINT:SetPointVec2( PointVec2 ) function ACT_ROUTE_POINT:SetPointVec2( PointVec2 )
self:F2( { PointVec2 } )
self.PointVec2 = PointVec2 self.PointVec2 = PointVec2
end end
@ -230,6 +231,7 @@ do -- ACT_ROUTE_POINT
-- @param #ACT_ROUTE_POINT self -- @param #ACT_ROUTE_POINT self
-- @return Core.Point#POINT_VEC2 PointVec2 The PointVec2 to route to. -- @return Core.Point#POINT_VEC2 PointVec2 The PointVec2 to route to.
function ACT_ROUTE_POINT:GetPointVec2() function ACT_ROUTE_POINT:GetPointVec2()
self:F2( { self.PointVec2 } )
return self.PointVec2 return self.PointVec2
end end
@ -237,6 +239,7 @@ do -- ACT_ROUTE_POINT
-- @param #ACT_ROUTE_POINT self -- @param #ACT_ROUTE_POINT self
-- @param #number Range The Range to consider the arrival. Default is 10000 meters. -- @param #number Range The Range to consider the arrival. Default is 10000 meters.
function ACT_ROUTE_POINT:SetRange( Range ) function ACT_ROUTE_POINT:SetRange( Range )
self:F2( { self.Range } )
self.Range = Range or 10000 self.Range = Range or 10000
end end

View File

@ -405,9 +405,10 @@ end
function SET_BASE:GetFirst() function SET_BASE:GetFirst()
self:F() self:F()
local t = self.List.first._ local ObjectName = self.Index[1]
self:T3( { t } ) local FirstObject = self.Set[ObjectName]
return t self:T3( { FirstObject } )
return FirstObject
end end
--- Gets the last object from the @{Set#SET_BASE} and derived classes. --- Gets the last object from the @{Set#SET_BASE} and derived classes.
@ -416,9 +417,10 @@ end
function SET_BASE:GetLast() function SET_BASE:GetLast()
self:F() self:F()
local t = self.List.last._ local ObjectName = self.Index[#self.Index]
self:T3( { t } ) local LastObject = self.Set[ObjectName]
return t self:T3( { LastObject } )
return LastObject
end end
--- Gets a random object from the @{Set#SET_BASE} and derived classes. --- Gets a random object from the @{Set#SET_BASE} and derived classes.

View File

@ -990,11 +990,11 @@ function SCORING:_EventOnDeadOrCrash( Event )
TargetDestroy.ScoreDestroy = TargetDestroy.ScoreDestroy or 0 TargetDestroy.ScoreDestroy = TargetDestroy.ScoreDestroy or 0
TargetDestroy.Penalty = TargetDestroy.Penalty or 0 TargetDestroy.Penalty = TargetDestroy.Penalty or 0
TargetDestroy.PenaltyDestroy = TargetDestroy.PenaltyDestroy or 0 TargetDestroy.PenaltyDestroy = TargetDestroy.PenaltyDestroy or 0
TargetDestroy.UNIT = TargetDestroy.UNIT or Player.Hit[TargetCategory][TargetUnitName].UNIT local TargetUNIT = Player.Hit[TargetCategory][TargetUnitName].UNIT
if TargetCoalition then if TargetCoalition then
if InitCoalition == TargetCoalition then if InitCoalition == TargetCoalition then
local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel() local ThreatLevelTarget, ThreatTypeTarget = TargetUNIT:GetThreatLevel()
local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1 local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1
local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 ) local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 )
self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } ) self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } )
@ -1025,7 +1025,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
self:ScoreCSV( PlayerName, "DESTROY_PENALTY", 1, ThreatPenalty, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) self:ScoreCSV( PlayerName, "DESTROY_PENALTY", 1, ThreatPenalty, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType )
else else
local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel() local ThreatLevelTarget, ThreatTypeTarget = TargetUNIT:GetThreatLevel()
local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1 local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1
local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 ) local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 )
@ -1055,7 +1055,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
end end
self:ScoreCSV( PlayerName, "DESTROY_SCORE", 1, ThreatScore, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) self:ScoreCSV( PlayerName, "DESTROY_SCORE", 1, ThreatScore, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType )
local UnitName = TargetDestroy.UNIT:GetName() local UnitName = TargetUNIT:GetName()
local Score = self.ScoringObjects[UnitName] local Score = self.ScoringObjects[UnitName]
if Score then if Score then
Player.Score = Player.Score + Score Player.Score = Player.Score + Score
@ -1075,7 +1075,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
self:E( { ScoringZone = ScoreZoneData } ) self:E( { ScoringZone = ScoreZoneData } )
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
local Score = ScoreZoneData.Score local Score = ScoreZoneData.Score
if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then if ScoreZone:IsVec2InZone( TargetUNIT:GetVec2() ) then
Player.Score = Player.Score + Score Player.Score = Player.Score + Score
TargetDestroy.Score = TargetDestroy.Score + Score TargetDestroy.Score = TargetDestroy.Score + Score
MESSAGE MESSAGE
@ -1096,7 +1096,7 @@ function SCORING:_EventOnDeadOrCrash( Event )
self:E( { ScoringZone = ScoreZoneData } ) self:E( { ScoringZone = ScoreZoneData } )
local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE
local Score = ScoreZoneData.Score local Score = ScoreZoneData.Score
if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then if ScoreZone:IsVec2InZone( TargetUNIT:GetVec2() ) then
Player.Score = Player.Score + Score Player.Score = Player.Score + Score
TargetDestroy.Score = TargetDestroy.Score + Score TargetDestroy.Score = TargetDestroy.Score + Score
MESSAGE MESSAGE

View File

@ -192,9 +192,13 @@ end
--- Get the Task FSM Process Template --- Get the Task FSM Process Template
-- @param #TASK self -- @param #TASK self
-- @return Core.Fsm#FSM_PROCESS -- @return Core.Fsm#FSM_PROCESS
function TASK:GetUnitProcess() function TASK:GetUnitProcess( TaskUnit )
return self.FsmTemplate if TaskUnit then
return self:GetStateMachine( TaskUnit )
else
return self.FsmTemplate
end
end end
--- Sets the Task FSM Process Template --- Sets the Task FSM Process Template
@ -661,15 +665,26 @@ end
--- Add a FiniteStateMachine to @{Task} with key Task@{Unit} --- Add a FiniteStateMachine to @{Task} with key Task@{Unit}
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit
-- @param Core.Fsm#FSM_PROCESS Fsm
-- @return #TASK self -- @return #TASK self
function TASK:SetStateMachine( TaskUnit, Fsm ) function TASK:SetStateMachine( TaskUnit, Fsm )
self:F( { TaskUnit, self.Fsm[TaskUnit] ~= nil } ) self:F2( { TaskUnit, self.Fsm[TaskUnit] ~= nil, Fsm:GetClassNameAndID() } )
self.Fsm[TaskUnit] = Fsm self.Fsm[TaskUnit] = Fsm
return Fsm return Fsm
end end
--- Gets the FiniteStateMachine of @{Task} with key Task@{Unit}
-- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Fsm#FSM_PROCESS
function TASK:GetStateMachine( TaskUnit )
self:F2( { TaskUnit, self.Fsm[TaskUnit] ~= nil } )
return self.Fsm[TaskUnit]
end
--- Remove FiniteStateMachines from @{Task} with key Task@{Unit} --- Remove FiniteStateMachines from @{Task} with key Task@{Unit}
-- @param #TASK self -- @param #TASK self
-- @param Wrapper.Unit#UNIT TaskUnit -- @param Wrapper.Unit#UNIT TaskUnit

View File

@ -51,27 +51,28 @@ do -- TASK_SEAD
local Fsm = self:GetUnitProcess() local Fsm = self:GetUnitProcess()
Fsm:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "RouteToRendezVous", Rejected = "Reject" } ) Fsm:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "RouteToRendezVous", Rejected = "Reject" } )
Fsm:AddTransition( "Assigned", "RouteToRendezVous", "RoutingToRendezVous" ) Fsm:AddTransition( "Assigned", "RouteToRendezVous", "RoutingToRendezVous" )
Fsm:AddProcess ( "RoutingToRendezVous", "RouteToRendezVousPoint", ACT_ROUTE_POINT:New(), { Arrived = "ArriveAtRendezVous" } ) Fsm:AddProcess ( "RoutingToRendezVous", "RouteToRendezVousPoint", ACT_ROUTE_POINT:New(), { Arrived = "ArriveAtRendezVous" } )
Fsm:AddProcess ( "RoutingToRendezVous", "RouteToRendezVousZone", ACT_ROUTE_ZONE:New(), { Arrived = "ArriveAtRendezVous" } ) Fsm:AddProcess ( "RoutingToRendezVous", "RouteToRendezVousZone", ACT_ROUTE_ZONE:New(), { Arrived = "ArriveAtRendezVous" } )
Fsm:AddTransition( { "Arrived", "RoutingToRendezVous" }, "ArriveAtRendezVous", "ArrivedAtRendezVous" ) Fsm:AddTransition( { "Arrived", "RoutingToRendezVous" }, "ArriveAtRendezVous", "ArrivedAtRendezVous" )
Fsm:AddTransition( { "ArrivedAtRendezVous", "HoldingAtRendezVous" }, "Engage", "Engaging" ) Fsm:AddTransition( { "ArrivedAtRendezVous", "HoldingAtRendezVous" }, "Engage", "Engaging" )
Fsm:AddTransition( { "ArrivedAtRendezVous", "HoldingAtRendezVous" }, "HoldAtRendezVous", "HoldingAtRendezVous" ) Fsm:AddTransition( { "ArrivedAtRendezVous", "HoldingAtRendezVous" }, "HoldAtRendezVous", "HoldingAtRendezVous" )
Fsm:AddProcess ( "Engaging", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } ) Fsm:AddProcess ( "Engaging", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } )
--Fsm:AddProcess ( "Accounting", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) --Fsm:AddProcess ( "Accounting", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) )
Fsm:AddTransition( "Engaging", "RouteToTarget", "Engaging" ) Fsm:AddTransition( "Engaging", "RouteToTarget", "Engaging" )
Fsm:AddProcess( "Engaging", "RouteToTargetZone", ACT_ROUTE_ZONE:New(), {} ) Fsm:AddProcess( "Engaging", "RouteToTargetZone", ACT_ROUTE_ZONE:New(), {} )
Fsm:AddProcess( "Engaging", "RouteToTargetPoint", ACT_ROUTE_POINT:New(), {} ) Fsm:AddProcess( "Engaging", "RouteToTargetPoint", ACT_ROUTE_POINT:New(), {} )
Fsm:AddTransition( "Engaging", "RouteToTargets", "Engaging" ) Fsm:AddTransition( "Engaging", "RouteToTargets", "Engaging" )
Fsm:AddTransition( "Accounted", "DestroyedAll", "Accounted" ) Fsm:AddTransition( "Accounted", "DestroyedAll", "Accounted" )
Fsm:AddTransition( "Rejected", "Reject", "Aborted" ) Fsm:AddTransition( "Accounted", "Success", "Success" )
Fsm:AddTransition( "Failed", "Fail", "Failed" ) Fsm:AddTransition( "Rejected", "Reject", "Aborted" )
Fsm:AddTransition( "Failed", "Fail", "Failed" )
--- Test --- Test
@ -82,10 +83,10 @@ do -- TASK_SEAD
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } ) self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
-- Determine the first Unit from the self.RendezVousSetUnit -- Determine the first Unit from the self.RendezVousSetUnit
if Task:GetRendezVousZone() then if Task:GetRendezVousZone( TaskUnit ) then
self:__RouteToRendezVousZone( 0.1 ) self:__RouteToRendezVousZone( 0.1 )
else else
if Task:GetRendezVousPointVec2() then if Task:GetRendezVousPointVec2( TaskUnit ) then
self:__RouteToRendezVousPoint( 0.1 ) self:__RouteToRendezVousPoint( 0.1 )
else else
self:__ArriveAtRendezVous( 0.1 ) self:__ArriveAtRendezVous( 0.1 )
@ -123,16 +124,16 @@ do -- TASK_SEAD
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } ) self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
-- Determine the first Unit from the self.TargetSetUnit -- Determine the first Unit from the self.TargetSetUnit
if Task:GetTargetZone() then if Task:GetTargetZone( TaskUnit ) then
self:__RouteToTargetZone( 0.1 ) self:__RouteToTargetZone( 0.1 )
else else
if Task:GetTargetPointVec2() then local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT
local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT if TargetUnit then
if TargetUnit then local PointVec2 = TargetUnit:GetPointVec2()
Task:SetTargetPointVec2( TargetUnit:GetPointVec2() ) self:T( { TargetPointVec2 = PointVec2, PointVec2:GetX(), PointVec2:GetAlt(), PointVec2:GetZ() } )
end Task:SetTargetPointVec2( TargetUnit:GetPointVec2(), TaskUnit )
self:__RouteToTargetPoint( 0.1 )
end end
self:__RouteToTargetPoint( 0.1 )
end end
end end
@ -144,8 +145,9 @@ do -- TASK_SEAD
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } ) self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT local TargetUnit = Task.TargetSetUnit:GetFirst() -- Wrapper.Unit#UNIT
if TargetUnit then if TargetUnit then
Task:SetTargetPointVec2( TargetUnit:GetPointVec2() ) Task:SetTargetPointVec2( TargetUnit:GetPointVec2(), TaskUnit )
end end
self:__RouteToTargets( -10 )
end end
return self return self
@ -160,9 +162,10 @@ do -- TASK_SEAD
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @param Core.Point#POINT_VEC2 RendezVousPointVec2 The PointVec2 object referencing to the 2D point where the RendezVous point is located on the map. -- @param Core.Point#POINT_VEC2 RendezVousPointVec2 The PointVec2 object referencing to the 2D point where the RendezVous point is located on the map.
-- @param #number RendezVousRange The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point. -- @param #number RendezVousRange The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point.
function TASK_SEAD:SetRendezVousPointVec2( RendezVousPointVec2, RendezVousRange ) -- @param Wrapper.Unit#UNIT TaskUnit
function TASK_SEAD:SetRendezVousPointVec2( RendezVousPointVec2, RendezVousRange, TaskUnit )
local ProcessUnit = self:GetUnitProcess() local ProcessUnit = self:GetUnitProcess( TaskUnit )
local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
ActRouteRendezVous:SetPointVec2( RendezVousPointVec2 ) ActRouteRendezVous:SetPointVec2( RendezVousPointVec2 )
@ -170,11 +173,12 @@ do -- TASK_SEAD
end end
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Point#POINT_VEC2 The PointVec2 object referencing to the 2D point where the RendezVous point is located on the map. -- @return Core.Point#POINT_VEC2 The PointVec2 object referencing to the 2D point where the RendezVous point is located on the map.
-- @return #number The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point. -- @return #number The RendezVousRange that defines when the player is considered to have arrived at the RendezVous point.
function TASK_SEAD:GetRendezVousPointVec2() function TASK_SEAD:GetRendezVousPointVec2( TaskUnit )
local ProcessUnit = self:GetUnitProcess() local ProcessUnit = self:GetUnitProcess( TaskUnit )
local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
return ActRouteRendezVous:GetPointVec2(), ActRouteRendezVous:GetRange() return ActRouteRendezVous:GetPointVec2(), ActRouteRendezVous:GetRange()
@ -184,19 +188,21 @@ do -- TASK_SEAD
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @param Core.Zone#ZONE_BASE RendezVousZone The Zone object where the RendezVous is located on the map. -- @param Core.Zone#ZONE_BASE RendezVousZone The Zone object where the RendezVous is located on the map.
function TASK_SEAD:SetRendezVousZone( RendezVousZone ) -- @param Wrapper.Unit#UNIT TaskUnit
function TASK_SEAD:SetRendezVousZone( RendezVousZone, TaskUnit )
local ProcessUnit = self:GetUnitProcess() local ProcessUnit = self:GetUnitProcess( TaskUnit )
local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE
ActRouteRendezVous:SetZone( RendezVousZone ) ActRouteRendezVous:SetZone( RendezVousZone )
end end
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Zone#ZONE_BASE The Zone object where the RendezVous is located on the map. -- @return Core.Zone#ZONE_BASE The Zone object where the RendezVous is located on the map.
function TASK_SEAD:GetRendezVousZone() function TASK_SEAD:GetRendezVousZone( TaskUnit )
local ProcessUnit = self:GetUnitProcess() local ProcessUnit = self:GetUnitProcess( TaskUnit )
local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE
return ActRouteRendezVous:GetZone() return ActRouteRendezVous:GetZone()
@ -204,9 +210,10 @@ do -- TASK_SEAD
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @param Core.Point#POINT_VEC2 TargetPointVec2 The PointVec2 object where the Target is located on the map. -- @param Core.Point#POINT_VEC2 TargetPointVec2 The PointVec2 object where the Target is located on the map.
function TASK_SEAD:SetTargetPointVec2( TargetPointVec2 ) -- @param Wrapper.Unit#UNIT TaskUnit
function TASK_SEAD:SetTargetPointVec2( TargetPointVec2, TaskUnit )
local ProcessUnit = self:GetUnitProcess() local ProcessUnit = self:GetUnitProcess( TaskUnit )
local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
ActRouteTarget:SetPointVec2( TargetPointVec2 ) ActRouteTarget:SetPointVec2( TargetPointVec2 )
@ -214,10 +221,11 @@ do -- TASK_SEAD
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Point#POINT_VEC2 The PointVec2 object where the Target is located on the map. -- @return Core.Point#POINT_VEC2 The PointVec2 object where the Target is located on the map.
function TASK_SEAD:GetTargetPointVec2() function TASK_SEAD:GetTargetPointVec2( TaskUnit )
local ProcessUnit = self:GetUnitProcess() local ProcessUnit = self:GetUnitProcess( TaskUnit )
local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
return ActRouteTarget:GetPointVec2() return ActRouteTarget:GetPointVec2()
@ -226,9 +234,10 @@ do -- TASK_SEAD
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @param Core.Zone#ZONE_BASE TargetZone The Zone object where the Target is located on the map. -- @param Core.Zone#ZONE_BASE TargetZone The Zone object where the Target is located on the map.
function TASK_SEAD:SetTargetZone( TargetZone ) -- @param Wrapper.Unit#UNIT TaskUnit
function TASK_SEAD:SetTargetZone( TargetZone, TaskUnit )
local ProcessUnit = self:GetUnitProcess() local ProcessUnit = self:GetUnitProcess( TaskUnit )
local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE
ActRouteTarget:SetZone( TargetZone ) ActRouteTarget:SetZone( TargetZone )
@ -236,9 +245,11 @@ do -- TASK_SEAD
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return Core.Zone#ZONE_BASE The Zone object where the Target is located on the map. -- @return Core.Zone#ZONE_BASE The Zone object where the Target is located on the map.
function TASK_SEAD:GetTargetZone() function TASK_SEAD:GetTargetZone( TaskUnit )
local ProcessUnit = self:GetUnitProcess()
local ProcessUnit = self:GetUnitProcess( TaskUnit )
local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE
return ActRouteTarget:GetZone() return ActRouteTarget:GetZone()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -88,7 +88,7 @@ SEADSet:Flush()
-- Define the set of units that are the targets. -- Define the set of units that are the targets.
-- Note that I use FilterOnce, which means that the set will be defined only once, -- Note that I use FilterOnce, which means that the set will be defined only once,
-- and will not be continuously updated! -- and will not be continuously updated!
local TargetSet = SET_UNIT:New():FilterPrefixes( "US Hawk SR" ):FilterOnce() local TargetSet = SET_UNIT:New():FilterPrefixes( "US Hawk SR" ):FilterStart()
-- Define the RendezVous Zone where the pilot needs to RendezVous with other players before engaging. -- Define the RendezVous Zone where the pilot needs to RendezVous with other players before engaging.
local RendezVousZone = ZONE:New( "RendezVous Zone" ) local RendezVousZone = ZONE:New( "RendezVous Zone" )