mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Implemented a WayPoints functionality for GROUPS
WayPoints can be modified on a GROUP. A function hook is called whenever a group moves over a waypoint.
This commit is contained in:
@@ -96,7 +96,8 @@ ESCORT = {
|
||||
FollowScheduler = nil,
|
||||
ReportTargets = true,
|
||||
OptionROE = AI.Option.Air.val.ROE.OPEN_FIRE,
|
||||
OptionReactionOnThreat = AI.Option.Air.val.REACTION_ON_THREAT.ALLOW_ABORT_MISSION
|
||||
OptionReactionOnThreat = AI.Option.Air.val.REACTION_ON_THREAT.ALLOW_ABORT_MISSION,
|
||||
TaskPoints = {}
|
||||
}
|
||||
|
||||
--- MENUPARAM type
|
||||
@@ -222,10 +223,11 @@ function ESCORT:New( EscortClient, EscortGroup, EscortName, EscortBriefing )
|
||||
|
||||
-- Initialize the EscortGroup
|
||||
|
||||
EscortGroup:OptionROTVertical()
|
||||
EscortGroup:OptionROEOpenFire()
|
||||
self.EscortGroup:WayPointInitialize(1)
|
||||
|
||||
self.EscortGroup:OptionROTVertical()
|
||||
self.EscortGroup:OptionROEOpenFire()
|
||||
|
||||
EscortGroup:SetTask( EscortGroup:TaskRoute( TaskPoints ) )
|
||||
|
||||
self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, 30 )
|
||||
|
||||
@@ -568,20 +570,19 @@ end
|
||||
|
||||
--- Registers the waypoints
|
||||
-- @param #ESCORT self
|
||||
-- @return #table
|
||||
function ESCORT:RegisterRoute()
|
||||
self:F()
|
||||
|
||||
local EscortGroup = self.EscortGroup -- Group#GROUP
|
||||
|
||||
local TaskPoints = EscortGroup:GetTaskRoute()
|
||||
self:T( TaskPoints )
|
||||
|
||||
for TaskPointID, TaskPoint in pairs( TaskPoints ) do
|
||||
self:T( { "TaskPoint:", TaskPointID, #TaskPoint.task.params.tasks+1, TaskPoint } )
|
||||
if TaskPointID > 1 then
|
||||
TaskPoint.task.params.tasks[#TaskPoint.task.params.tasks+1] = EscortGroup:TaskRegisterWayPoint( TaskPointID )
|
||||
for TaskPointID = 1, #TaskPoints do
|
||||
if TaskPointID > 0 then
|
||||
--TaskPoint.task.params.tasks[#TaskPoint.task.params.tasks+1] = EscortGroup:TaskRegisterWayPoint( TaskPointID )
|
||||
TaskPoints[TaskPointID].task = EscortGroup:TaskRegisterWayPoint( TaskPointID )
|
||||
end
|
||||
self:T( TaskPoint )
|
||||
end
|
||||
|
||||
self:T( TaskPoints )
|
||||
|
||||
Reference in New Issue
Block a user