Progress on SEAD model

This commit is contained in:
FlightControl 2017-03-03 10:27:09 +01:00
parent 846edca815
commit a99924d9ed
5 changed files with 32 additions and 16 deletions

View File

@ -45,7 +45,6 @@ do -- TASK_SEAD
self:F() self:F()
self.TargetSetUnit = TargetSetUnit self.TargetSetUnit = TargetSetUnit
self.TargetDistance = TargetDistance
Mission:AddTask( self ) Mission:AddTask( self )
@ -163,7 +162,9 @@ do -- TASK_SEAD
-- @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 ) function TASK_SEAD:SetRendezVousPointVec2( RendezVousPointVec2, RendezVousRange )
local ActRouteRendezVous = self:GetProcess( "RoutingToRendezVous", "RouteToRendezVousPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT local ProcessUnit = self:GetUnitProcess()
local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
ActRouteRendezVous:SetPointVec2( RendezVousPointVec2 ) ActRouteRendezVous:SetPointVec2( RendezVousPointVec2 )
ActRouteRendezVous:SetRange( RendezVousRange ) ActRouteRendezVous:SetRange( RendezVousRange )
end end
@ -173,7 +174,9 @@ do -- TASK_SEAD
-- @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()
local ActRouteRendezVous = self:GetProcess( "RoutingToRendezVous", "RouteToRendezVousPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT local ProcessUnit = self:GetUnitProcess()
local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
return ActRouteRendezVous:GetPointVec2(), ActRouteRendezVous:GetRange() return ActRouteRendezVous:GetPointVec2(), ActRouteRendezVous:GetRange()
end end
@ -183,14 +186,19 @@ do -- TASK_SEAD
-- @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 ) function TASK_SEAD:SetRendezVousZone( RendezVousZone )
local ActRouteRendezVous = self:GetProcess( "RoutingToRendezVous", "RouteToRendezVousZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE local ProcessUnit = self:GetUnitProcess()
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
-- @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()
local ActRouteRendezVous = self:GetProcess( "RoutingToRendezVous", "RouteToRendezVousZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE
local ProcessUnit = self:GetUnitProcess()
local ActRouteRendezVous = ProcessUnit:GetProcess( "RoutingToRendezVous", "RouteToRendezVousZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE
return ActRouteRendezVous:GetZone() return ActRouteRendezVous:GetZone()
end end
@ -198,7 +206,9 @@ do -- TASK_SEAD
-- @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 ) function TASK_SEAD:SetTargetPointVec2( TargetPointVec2 )
local ActRouteTarget = self:GetProcess( "Engaging", "RouteToTargetPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT local ProcessUnit = self:GetUnitProcess()
local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
ActRouteTarget:SetPointVec2( TargetPointVec2 ) ActRouteTarget:SetPointVec2( TargetPointVec2 )
end end
@ -206,7 +216,10 @@ do -- TASK_SEAD
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @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()
local ActRouteTarget = self:GetProcess( "Engaging", "RouteToTargetPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
local ProcessUnit = self:GetUnitProcess()
local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetPoint" ) -- Actions.Act_Route#ACT_ROUTE_POINT
return ActRouteTarget:GetPointVec2() return ActRouteTarget:GetPointVec2()
end end
@ -215,7 +228,9 @@ do -- TASK_SEAD
-- @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 ) function TASK_SEAD:SetTargetZone( TargetZone )
local ActRouteTarget = self:GetProcess( "Engaging", "RouteToTargetZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE local ProcessUnit = self:GetUnitProcess()
local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE
ActRouteTarget:SetZone( TargetZone ) ActRouteTarget:SetZone( TargetZone )
end end
@ -223,7 +238,9 @@ do -- TASK_SEAD
--- @param #TASK_SEAD self --- @param #TASK_SEAD self
-- @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()
local ActRouteTarget = self:GetProcess( "Engaging", "RouteToTargetZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE local ProcessUnit = self:GetUnitProcess()
local ActRouteTarget = ProcessUnit:GetProcess( "Engaging", "RouteToTargetZone" ) -- Actions.Act_Route#ACT_ROUTE_ZONE
return ActRouteTarget:GetZone() return ActRouteTarget:GetZone()
end end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' ) env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170217_1332' ) env.info( 'Moose Generation Timestamp: 20170303_1010' )
local base = _G local base = _G

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' ) env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170217_1332' ) env.info( 'Moose Generation Timestamp: 20170303_1010' )
local base = _G local base = _G

View File

@ -110,9 +110,8 @@ local TargetZone = ZONE:New( "Target Zone" )
local SEADTask = TASK_SEAD:New( local SEADTask = TASK_SEAD:New(
Mission, Mission,
SEADSet, SEADSet,
"SEAD Radars Vector 1", "SEAD Radars Vector 1"
TargetSet, ) -- Tasking.Task_SEAD#TASK_SEAD
15000 ) -- Tasking.Task_SEAD#TASK_SEAD
SEADTask:SetRendezVousPointVec2( TargetZone:GetPointVec2(), 6000 ) -- Done to test the RendezVousPointVec2 mechanism. SEADTask:SetRendezVousPointVec2( TargetZone:GetPointVec2(), 6000 ) -- Done to test the RendezVousPointVec2 mechanism.
SEADTask:SetTargetZone( TargetZone ) SEADTask:SetTargetZone( TargetZone )
@ -129,8 +128,8 @@ SEADTask:SetTargetZone( TargetZone )
local SEADProcess = SEADTask:GetUnitProcess() -- #SEADProcess local SEADProcess = SEADTask:GetUnitProcess() -- #SEADProcess
SEADProcess:AddScoreProcess( "Accounting", "Account", "Account", "destroyed a radar", 25 ) SEADProcess:AddScoreProcess( "Engaging", "Account", "Account", "destroyed a radar", 25 )
SEADProcess:AddScoreProcess( "Accounting", "Account", "Failed", "failed to destroy a radar", -10 ) SEADProcess:AddScoreProcess( "Engaging", "Account", "Failed", "failed to destroy a radar", -10 )
-- Now we will set the SCORING. Scoring is set using the TaskSEAD object. -- Now we will set the SCORING. Scoring is set using the TaskSEAD object.
-- Scores can be set on the status of the Task, and on Process level. -- Scores can be set on the status of the Task, and on Process level.