mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Updates of working version.
This commit is contained in:
@@ -332,22 +332,29 @@ end
|
|||||||
|
|
||||||
--- Defines the default menus
|
--- Defines the default menus
|
||||||
-- @param #AI_ESCORT self
|
-- @param #AI_ESCORT self
|
||||||
|
-- @param #number XStart The start position on the X-axis in meters for the first group.
|
||||||
|
-- @param #number XSpace The space between groups on the X-axis in meters for each sequent group.
|
||||||
|
-- @param #nubmer YStart The start position on the Y-axis in meters for the first group.
|
||||||
|
-- @param #number YSpace The space between groups on the Y-axis in meters for each sequent group.
|
||||||
|
-- @param #nubmer ZStart The start position on the Z-axis in meters for the first group.
|
||||||
|
-- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group.
|
||||||
|
-- @param #number ZLevels The amount of levels on the Z-axis.
|
||||||
-- @return #AI_ESCORT
|
-- @return #AI_ESCORT
|
||||||
function AI_ESCORT:Menus()
|
function AI_ESCORT:Menus( XStart, XSpace, YStart, YSpace, ZStart, ZSpace, ZLevels )
|
||||||
self:F()
|
self:F()
|
||||||
|
|
||||||
-- self:MenuScanForTargets( 100, 60 )
|
-- self:MenuScanForTargets( 100, 60 )
|
||||||
|
|
||||||
self:MenuJoinUp()
|
self:MenuJoinUp()
|
||||||
self:MenuFormationTrail( 50, 100, 50 )
|
self:MenuFormationTrail(XStart,XSpace,YStart)
|
||||||
self:MenuFormationStack( 50, 100, 50, 50 )
|
self:MenuFormationStack(XStart,XSpace,YStart,YSpace)
|
||||||
self:MenuFormationLeftLine( 0, 0, 100, 100 )
|
self:MenuFormationLeftLine(XStart,YStart,ZStart,ZSpace)
|
||||||
self:MenuFormationRightLine( 0, 0, 100, 100 )
|
self:MenuFormationRightLine(XStart,YStart,ZStart,ZSpace)
|
||||||
self:MenuFormationLeftWing( 0, 50, 0, 100, 100 )
|
self:MenuFormationLeftWing(XStart,XSpace,YStart,ZStart,ZSpace)
|
||||||
self:MenuFormationRightWing( 0, 50, 0, 100, 100 )
|
self:MenuFormationRightWing(XStart,XSpace,YStart,ZStart,ZSpace)
|
||||||
self:MenuFormationCenterWing( 50, 50, 0, 50, 100, 100 )
|
self:MenuFormationVic(XStart,XSpace,YStart,YSpace,ZStart,ZSpace)
|
||||||
self:MenuFormationBox( 50, 100, 0, 50, 50, 100, 10 )
|
self:MenuFormationBox(XStart,XSpace,YStart,YSpace,ZStart,ZSpace,ZLevels)
|
||||||
|
|
||||||
self:MenuHoldAtEscortPosition( 1000, 500 )
|
self:MenuHoldAtEscortPosition( 1000, 500 )
|
||||||
self:MenuHoldAtLeaderPosition( 1000, 500 )
|
self:MenuHoldAtLeaderPosition( 1000, 500 )
|
||||||
|
|
||||||
@@ -1474,6 +1481,9 @@ function AI_ESCORT:_FlightReportTargetsScheduler()
|
|||||||
local ClientEscortTargets = self.Detection
|
local ClientEscortTargets = self.Detection
|
||||||
|
|
||||||
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
for DetectedItemIndex, DetectedItem in pairs( DetectedItems ) do
|
||||||
|
|
||||||
|
self:F("FlightReportTargetScheduler Targets")
|
||||||
|
|
||||||
|
|
||||||
DetectedTargets = true -- There are detected targets, when the content of the for loop is executed. We use it to display a message.
|
DetectedTargets = true -- There are detected targets, when the content of the for loop is executed. We use it to display a message.
|
||||||
|
|
||||||
|
|||||||
@@ -195,14 +195,15 @@ AI_ESCORT_REQUEST = {
|
|||||||
-- @param #string EscortBriefing A text showing the AI_ESCORT_REQUEST briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown.
|
-- @param #string EscortBriefing A text showing the AI_ESCORT_REQUEST briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown.
|
||||||
-- @return #AI_ESCORT_REQUEST self
|
-- @return #AI_ESCORT_REQUEST self
|
||||||
-- @usage
|
-- @usage
|
||||||
-- -- Declare a new EscortPlanes object as follows:
|
-- EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 )
|
||||||
--
|
-- EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig )
|
||||||
-- -- First find the GROUP object and the CLIENT object.
|
--
|
||||||
-- local EscortUnit = CLIENT:FindByName( "Unit Name" ) -- The Unit Name is the name of the unit flagged with the skill Client in the mission editor.
|
-- local EscortUnit = UNIT:FindByName( "Red A2G Pilot" )
|
||||||
-- local EscortGroup = GROUP:FindByName( "Group Name" ) -- The Group Name is the name of the group that will escort the Escort Client.
|
--
|
||||||
--
|
-- Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" )
|
||||||
-- -- Now use these 2 objects to construct the new EscortPlanes object.
|
-- Escort:FormationTrail( 50, 100, 100 )
|
||||||
-- EscortPlanes = AI_ESCORT_REQUEST:New( EscortUnit, EscortGroup, "Desert", "Welcome to the mission. You are escorted by a plane with code name 'Desert', which can be instructed through the F10 radio menu." )
|
-- Escort:Menus()
|
||||||
|
-- Escort:__Start( 5 )
|
||||||
function AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, EscortAirbase, EscortName, EscortBriefing )
|
function AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, EscortAirbase, EscortName, EscortBriefing )
|
||||||
|
|
||||||
self.EscortGroupSet = SET_GROUP:New()
|
self.EscortGroupSet = SET_GROUP:New()
|
||||||
@@ -210,7 +211,6 @@ function AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, EscortAirbase, EscortNa
|
|||||||
self.EscortAirbase = EscortAirbase
|
self.EscortAirbase = EscortAirbase
|
||||||
|
|
||||||
local self = BASE:Inherit( self, AI_ESCORT:New( EscortUnit, self.EscortGroupSet, EscortName, EscortBriefing ) ) -- #AI_ESCORT_REQUEST
|
local self = BASE:Inherit( self, AI_ESCORT:New( EscortUnit, self.EscortGroupSet, EscortName, EscortBriefing ) ) -- #AI_ESCORT_REQUEST
|
||||||
self:F( { EscortUnit } )
|
|
||||||
|
|
||||||
self.LeaderGroup = self.EscortUnit:GetGroup()
|
self.LeaderGroup = self.EscortUnit:GetGroup()
|
||||||
|
|
||||||
@@ -241,34 +241,20 @@ function AI_ESCORT_REQUEST:SpawnEscort()
|
|||||||
Report:Add( "Joining Up ..." )
|
Report:Add( "Joining Up ..." )
|
||||||
|
|
||||||
LeaderEscort:MessageTypeToGroup( Report:Text(), MESSAGE.Type.Information, self.EscortUnit )
|
LeaderEscort:MessageTypeToGroup( Report:Text(), MESSAGE.Type.Information, self.EscortUnit )
|
||||||
|
self:FormationTrail( 50, 50, 50 )
|
||||||
|
self:JoinFormation( EscortGroup )
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
self:__FormationTrail( 30, 50, 100, 100 )
|
|
||||||
self:JoinFormation( EscortGroup )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_ESCORT_REQUEST self
|
--- @param #AI_ESCORT_REQUEST self
|
||||||
-- @param Core.Set#SET_GROUP EscortGroupSet
|
-- @param Core.Set#SET_GROUP EscortGroupSet
|
||||||
function AI_ESCORT_REQUEST:onafterStart( EscortGroupSet )
|
function AI_ESCORT_REQUEST:onafterStart( EscortGroupSet )
|
||||||
|
|
||||||
self:E("Start")
|
|
||||||
|
|
||||||
EscortGroupSet:ForEachGroup(
|
|
||||||
--- @param Core.Group#GROUP EscortGroup
|
|
||||||
function( EscortGroup )
|
|
||||||
--EscortGroup.EscortMenu = MENU_GROUP:New( self.EscortUnit:GetGroup(), EscortGroup:GetName() )
|
|
||||||
EscortGroup:WayPointInitialize( 1 )
|
|
||||||
|
|
||||||
EscortGroup:OptionROTVertical()
|
|
||||||
EscortGroup:OptionROEOpenFire()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
if not self.MenuRequestEscort then
|
if not self.MenuRequestEscort then
|
||||||
self.MenuRequestEscort = MENU_GROUP_COMMAND:New( self.LeaderGroup, "Request A2G Escort", nil,
|
self.MenuRequestEscort = MENU_GROUP_COMMAND:New( self.LeaderGroup, "Request A2G Escort", nil,
|
||||||
function()
|
function()
|
||||||
env.info("call")
|
|
||||||
self:SpawnEscort()
|
self:SpawnEscort()
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -541,14 +541,17 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.DetectionCount = self.DetectionSet:GetSomeIteratorLimit()
|
self.DetectionCount = self.DetectionSet:Count()
|
||||||
|
|
||||||
self.DetectionSet:ForSomeGroupAlive(
|
self.DetectionSet:ForEachGroupAlive(
|
||||||
function( DetectionGroup )
|
function( DetectionGroup )
|
||||||
self:__Detection( DetectDelay, DetectionGroup, DetectionTimeStamp ) -- Process each detection asynchronously.
|
self:__Detection( DetectDelay, DetectionGroup, DetectionTimeStamp ) -- Process each detection asynchronously.
|
||||||
DetectDelay = DetectDelay + 1
|
DetectDelay = DetectDelay + 1
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self:__Detect( -self.RefreshTimeInterval )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #DETECTION_BASE self
|
--- @param #DETECTION_BASE self
|
||||||
@@ -803,10 +806,9 @@ do -- DETECTION_BASE
|
|||||||
self:__DetectedItem( 0.1, DetectedItem )
|
self:__DetectedItem( 0.1, DetectedItem )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self:__Detect( self.RefreshTimeInterval )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user