Updates of working version.

This commit is contained in:
FlightControl 2019-04-26 18:42:42 +02:00
parent ab423b3ba4
commit 3657a19645
3 changed files with 37 additions and 39 deletions

View File

@ -332,22 +332,29 @@ end
--- Defines the default menus
-- @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
function AI_ESCORT:Menus()
function AI_ESCORT:Menus( XStart, XSpace, YStart, YSpace, ZStart, ZSpace, ZLevels )
self:F()
-- self:MenuScanForTargets( 100, 60 )
self:MenuJoinUp()
self:MenuFormationTrail( 50, 100, 50 )
self:MenuFormationStack( 50, 100, 50, 50 )
self:MenuFormationLeftLine( 0, 0, 100, 100 )
self:MenuFormationRightLine( 0, 0, 100, 100 )
self:MenuFormationLeftWing( 0, 50, 0, 100, 100 )
self:MenuFormationRightWing( 0, 50, 0, 100, 100 )
self:MenuFormationCenterWing( 50, 50, 0, 50, 100, 100 )
self:MenuFormationBox( 50, 100, 0, 50, 50, 100, 10 )
self:MenuFormationTrail(XStart,XSpace,YStart)
self:MenuFormationStack(XStart,XSpace,YStart,YSpace)
self:MenuFormationLeftLine(XStart,YStart,ZStart,ZSpace)
self:MenuFormationRightLine(XStart,YStart,ZStart,ZSpace)
self:MenuFormationLeftWing(XStart,XSpace,YStart,ZStart,ZSpace)
self:MenuFormationRightWing(XStart,XSpace,YStart,ZStart,ZSpace)
self:MenuFormationVic(XStart,XSpace,YStart,YSpace,ZStart,ZSpace)
self:MenuFormationBox(XStart,XSpace,YStart,YSpace,ZStart,ZSpace,ZLevels)
self:MenuHoldAtEscortPosition( 1000, 500 )
self:MenuHoldAtLeaderPosition( 1000, 500 )
@ -1474,6 +1481,9 @@ function AI_ESCORT:_FlightReportTargetsScheduler()
local ClientEscortTargets = self.Detection
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.

View File

@ -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.
-- @return #AI_ESCORT_REQUEST self
-- @usage
-- -- Declare a new EscortPlanes object as follows:
--
-- -- 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 EscortGroup = GROUP:FindByName( "Group Name" ) -- The Group Name is the name of the group that will escort the Escort Client.
--
-- -- Now use these 2 objects to construct the new EscortPlanes object.
-- 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." )
-- 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 )
--
-- local EscortUnit = UNIT:FindByName( "Red A2G Pilot" )
--
-- Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" )
-- Escort:FormationTrail( 50, 100, 100 )
-- Escort:Menus()
-- Escort:__Start( 5 )
function AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, EscortAirbase, EscortName, EscortBriefing )
self.EscortGroupSet = SET_GROUP:New()
@ -210,7 +211,6 @@ function AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, EscortAirbase, EscortNa
self.EscortAirbase = EscortAirbase
local self = BASE:Inherit( self, AI_ESCORT:New( EscortUnit, self.EscortGroupSet, EscortName, EscortBriefing ) ) -- #AI_ESCORT_REQUEST
self:F( { EscortUnit } )
self.LeaderGroup = self.EscortUnit:GetGroup()
@ -241,34 +241,20 @@ function AI_ESCORT_REQUEST:SpawnEscort()
Report:Add( "Joining Up ..." )
LeaderEscort:MessageTypeToGroup( Report:Text(), MESSAGE.Type.Information, self.EscortUnit )
self:FormationTrail( 50, 50, 50 )
self:JoinFormation( EscortGroup )
end
)
self:__FormationTrail( 30, 50, 100, 100 )
self:JoinFormation( EscortGroup )
end
--- @param #AI_ESCORT_REQUEST self
-- @param Core.Set#SET_GROUP 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
self.MenuRequestEscort = MENU_GROUP_COMMAND:New( self.LeaderGroup, "Request A2G Escort", nil,
function()
env.info("call")
self:SpawnEscort()
end
)

View File

@ -541,14 +541,17 @@ do -- DETECTION_BASE
end
self.DetectionCount = self.DetectionSet:GetSomeIteratorLimit()
self.DetectionCount = self.DetectionSet:Count()
self.DetectionSet:ForSomeGroupAlive(
self.DetectionSet:ForEachGroupAlive(
function( DetectionGroup )
self:__Detection( DetectDelay, DetectionGroup, DetectionTimeStamp ) -- Process each detection asynchronously.
DetectDelay = DetectDelay + 1
end
)
self:__Detect( -self.RefreshTimeInterval )
end
--- @param #DETECTION_BASE self
@ -803,10 +806,9 @@ do -- DETECTION_BASE
self:__DetectedItem( 0.1, DetectedItem )
end
end
self:__Detect( self.RefreshTimeInterval )
end
end