From 5bbe5fca6064b54b21a02551aaf0449c3cd54640 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 7 Jul 2017 10:41:16 +0200 Subject: [PATCH 01/10] Fix to get correct parent class --- Moose Development/Moose/Core/Base.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Base.lua b/Moose Development/Moose/Core/Base.lua index 441e83ec1..165b415d2 100644 --- a/Moose Development/Moose/Core/Base.lua +++ b/Moose Development/Moose/Core/Base.lua @@ -254,7 +254,7 @@ function BASE:Inherit( Child, Parent ) -- This is for "private" methods... -- When a __ is passed to a method as "self", the __index will search for the method on the public method list of the same object too! if rawget( Child, "__" ) then - setmetatable( Child, { __index = Child.__ } ) + setmetatable( Child, { __index = Child.__ } ) setmetatable( Child.__, { __index = Parent } ) else setmetatable( Child, { __index = Parent } ) @@ -277,9 +277,9 @@ end function BASE:GetParent( Child ) local Parent if rawget( Child, "__" ) then - Parent = getmetatable( Child.__ ).__Index + Parent = getmetatable( Child.__ ).__index else - Parent = getmetatable( Child ).__Index + Parent = getmetatable( Child ).__index end return Parent end From 1e6035b282b05cc9d079021add7ff75849abc829 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 7 Jul 2017 11:46:08 +0200 Subject: [PATCH 02/10] Optimized CARGO - Smoke position upon arrival at pickup zone - Solved problem with deploy, deploy function was not called. - Added Smoke to CARGO - Moved Smoke to POSITIONABLE --- Moose Development/Moose/Core/Cargo.lua | 83 ++++++++++++++++ .../Moose/Tasking/Task_CARGO.lua | 3 +- Moose Development/Moose/Wrapper/Group.lua | 94 ++++++++++++++++++- .../Moose/Wrapper/Positionable.lua | 88 +++++++++++++++++ Moose Development/Moose/Wrapper/Unit.lua | 86 ----------------- 5 files changed, 266 insertions(+), 88 deletions(-) diff --git a/Moose Development/Moose/Core/Cargo.lua b/Moose Development/Moose/Core/Cargo.lua index 4da31341a..a0fa950a5 100644 --- a/Moose Development/Moose/Core/Cargo.lua +++ b/Moose Development/Moose/Core/Cargo.lua @@ -374,6 +374,85 @@ function CARGO:Spawn( PointVec2 ) end +--- Signal a flare at the position of the CARGO. +-- @param #CARGO self +-- @param Utilities.Utils#FLARECOLOR FlareColor +function CARGO:Flare( FlareColor ) + if self:IsUnLoaded() then + trigger.action.signalFlare( self.CargoObject:GetVec3(), FlareColor , 0 ) + end +end + +--- Signal a white flare at the position of the CARGO. +-- @param #CARGO self +function CARGO:FlareWhite() + self:Flare( trigger.flareColor.White ) +end + +--- Signal a yellow flare at the position of the CARGO. +-- @param #CARGO self +function CARGO:FlareYellow() + self:Flare( trigger.flareColor.Yellow ) +end + +--- Signal a green flare at the position of the CARGO. +-- @param #CARGO self +function CARGO:FlareGreen() + self:Flare( trigger.flareColor.Green ) +end + +--- Signal a red flare at the position of the CARGO. +-- @param #CARGO self +function CARGO:FlareRed() + self:Flare( trigger.flareColor.Red ) +end + +--- Smoke the CARGO. +-- @param #CARGO self +function CARGO:Smoke( SmokeColor, Range ) + self:F2() + if self:IsUnLoaded() then + if Range then + trigger.action.smoke( self.CargoObject:GetRandomVec3( Range ), SmokeColor ) + else + trigger.action.smoke( self.CargoObject:GetVec3(), SmokeColor ) + end + end +end + +--- Smoke the CARGO Green. +-- @param #CARGO self +function CARGO:SmokeGreen() + self:Smoke( trigger.smokeColor.Green, Range ) +end + +--- Smoke the CARGO Red. +-- @param #CARGO self +function CARGO:SmokeRed() + self:Smoke( trigger.smokeColor.Red, Range ) +end + +--- Smoke the CARGO White. +-- @param #CARGO self +function CARGO:SmokeWhite() + self:Smoke( trigger.smokeColor.White, Range ) +end + +--- Smoke the CARGO Orange. +-- @param #CARGO self +function CARGO:SmokeOrange() + self:Smoke( trigger.smokeColor.Orange, Range ) +end + +--- Smoke the CARGO Blue. +-- @param #CARGO self +function CARGO:SmokeBlue() + self:Smoke( trigger.smokeColor.Blue, Range ) +end + + + + --- Check if Cargo is the given @{Zone}. @@ -1162,6 +1241,10 @@ function CARGO_GROUP:onenterUnBoarding( From, Event, To, ToPointVec2, NearRadius local Timer = 1 if From == "Loaded" then + + if self.CargoObject then + self.CargoObject:Destroy() + end -- For each Cargo object within the CARGO_GROUP, route each object to the CargoLoadPointVec2 self.CargoSet:ForEach( diff --git a/Moose Development/Moose/Tasking/Task_CARGO.lua b/Moose Development/Moose/Tasking/Task_CARGO.lua index 77b17c4bc..189eb5353 100644 --- a/Moose Development/Moose/Tasking/Task_CARGO.lua +++ b/Moose Development/Moose/Tasking/Task_CARGO.lua @@ -342,7 +342,7 @@ do -- TASK_CARGO function Fsm:onafterArriveAtPickup( TaskUnit, Task ) self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } ) if self.Cargo:IsAlive() then - TaskUnit:Smoke( Task:GetSmokeColor(), 15 ) + self.Cargo:Smoke( Task:GetSmokeColor(), 15 ) if TaskUnit:IsAir() then Task:GetMission():GetCommandCenter():MessageToGroup( "Land", TaskUnit:GetGroup() ) self:__Land( -0.1, "Pickup" ) @@ -592,6 +592,7 @@ do -- TASK_CARGO -- TODO:I need to find a more decent solution for this. Task:E( { CargoDeployed = Task.CargoDeployed and "true" or "false" } ) + Task:E( { CargoIsAlive = self.Cargo:IsAlive() and "true" or "false" } ) if self.Cargo:IsAlive() then if Task.CargoDeployed then Task:CargoDeployed( TaskUnit, self.Cargo, self.DeployZone ) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 652e13c7e..3f3215501 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -1186,4 +1186,96 @@ do -- Players return PlayerNames end -end \ No newline at end of file +end + +--do -- Smoke +-- +----- Signal a flare at the position of the GROUP. +---- @param #GROUP self +---- @param Utilities.Utils#FLARECOLOR FlareColor +--function GROUP:Flare( FlareColor ) +-- self:F2() +-- trigger.action.signalFlare( self:GetVec3(), FlareColor , 0 ) +--end +-- +----- Signal a white flare at the position of the GROUP. +---- @param #GROUP self +--function GROUP:FlareWhite() +-- self:F2() +-- trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.White , 0 ) +--end +-- +----- Signal a yellow flare at the position of the GROUP. +---- @param #GROUP self +--function GROUP:FlareYellow() +-- self:F2() +-- trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.Yellow , 0 ) +--end +-- +----- Signal a green flare at the position of the GROUP. +---- @param #GROUP self +--function GROUP:FlareGreen() +-- self:F2() +-- trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.Green , 0 ) +--end +-- +----- Signal a red flare at the position of the GROUP. +---- @param #GROUP self +--function GROUP:FlareRed() +-- self:F2() +-- local Vec3 = self:GetVec3() +-- if Vec3 then +-- trigger.action.signalFlare( Vec3, trigger.flareColor.Red, 0 ) +-- end +--end +-- +----- Smoke the GROUP. +---- @param #GROUP self +--function GROUP:Smoke( SmokeColor, Range ) +-- self:F2() +-- if Range then +-- trigger.action.smoke( self:GetRandomVec3( Range ), SmokeColor ) +-- else +-- trigger.action.smoke( self:GetVec3(), SmokeColor ) +-- end +-- +--end +-- +----- Smoke the GROUP Green. +---- @param #GROUP self +--function GROUP:SmokeGreen() +-- self:F2() +-- trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Green ) +--end +-- +----- Smoke the GROUP Red. +---- @param #GROUP self +--function GROUP:SmokeRed() +-- self:F2() +-- trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Red ) +--end +-- +----- Smoke the GROUP White. +---- @param #GROUP self +--function GROUP:SmokeWhite() +-- self:F2() +-- trigger.action.smoke( self:GetVec3(), trigger.smokeColor.White ) +--end +-- +----- Smoke the GROUP Orange. +---- @param #GROUP self +--function GROUP:SmokeOrange() +-- self:F2() +-- trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Orange ) +--end +-- +----- Smoke the GROUP Blue. +---- @param #GROUP self +--function GROUP:SmokeBlue() +-- self:F2() +-- trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Blue ) +--end +-- +-- +-- +--end \ No newline at end of file diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua index bca3967cf..0cdf5c7e8 100644 --- a/Moose Development/Moose/Wrapper/Positionable.lua +++ b/Moose Development/Moose/Wrapper/Positionable.lua @@ -724,3 +724,91 @@ function POSITIONABLE:CargoItemCount() end return ItemCount end + +--- Signal a flare at the position of the POSITIONABLE. +-- @param #POSITIONABLE self +-- @param Utilities.Utils#FLARECOLOR FlareColor +function POSITIONABLE:Flare( FlareColor ) + self:F2() + trigger.action.signalFlare( self:GetVec3(), FlareColor , 0 ) +end + +--- Signal a white flare at the position of the POSITIONABLE. +-- @param #POSITIONABLE self +function POSITIONABLE:FlareWhite() + self:F2() + trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.White , 0 ) +end + +--- Signal a yellow flare at the position of the POSITIONABLE. +-- @param #POSITIONABLE self +function POSITIONABLE:FlareYellow() + self:F2() + trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.Yellow , 0 ) +end + +--- Signal a green flare at the position of the POSITIONABLE. +-- @param #POSITIONABLE self +function POSITIONABLE:FlareGreen() + self:F2() + trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.Green , 0 ) +end + +--- Signal a red flare at the position of the POSITIONABLE. +-- @param #POSITIONABLE self +function POSITIONABLE:FlareRed() + self:F2() + local Vec3 = self:GetVec3() + if Vec3 then + trigger.action.signalFlare( Vec3, trigger.flareColor.Red, 0 ) + end +end + +--- Smoke the POSITIONABLE. +-- @param #POSITIONABLE self +function POSITIONABLE:Smoke( SmokeColor, Range ) + self:F2() + if Range then + trigger.action.smoke( self:GetRandomVec3( Range ), SmokeColor ) + else + trigger.action.smoke( self:GetVec3(), SmokeColor ) + end + +end + +--- Smoke the POSITIONABLE Green. +-- @param #POSITIONABLE self +function POSITIONABLE:SmokeGreen() + self:F2() + trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Green ) +end + +--- Smoke the POSITIONABLE Red. +-- @param #POSITIONABLE self +function POSITIONABLE:SmokeRed() + self:F2() + trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Red ) +end + +--- Smoke the POSITIONABLE White. +-- @param #POSITIONABLE self +function POSITIONABLE:SmokeWhite() + self:F2() + trigger.action.smoke( self:GetVec3(), trigger.smokeColor.White ) +end + +--- Smoke the POSITIONABLE Orange. +-- @param #POSITIONABLE self +function POSITIONABLE:SmokeOrange() + self:F2() + trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Orange ) +end + +--- Smoke the POSITIONABLE Blue. +-- @param #POSITIONABLE self +function POSITIONABLE:SmokeBlue() + self:F2() + trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Blue ) +end + + diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index 576aed957..6cf6906ed 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -788,92 +788,6 @@ end ---- Signal a flare at the position of the UNIT. --- @param #UNIT self --- @param Utilities.Utils#FLARECOLOR FlareColor -function UNIT:Flare( FlareColor ) - self:F2() - trigger.action.signalFlare( self:GetVec3(), FlareColor , 0 ) -end - ---- Signal a white flare at the position of the UNIT. --- @param #UNIT self -function UNIT:FlareWhite() - self:F2() - trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.White , 0 ) -end - ---- Signal a yellow flare at the position of the UNIT. --- @param #UNIT self -function UNIT:FlareYellow() - self:F2() - trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.Yellow , 0 ) -end - ---- Signal a green flare at the position of the UNIT. --- @param #UNIT self -function UNIT:FlareGreen() - self:F2() - trigger.action.signalFlare( self:GetVec3(), trigger.flareColor.Green , 0 ) -end - ---- Signal a red flare at the position of the UNIT. --- @param #UNIT self -function UNIT:FlareRed() - self:F2() - local Vec3 = self:GetVec3() - if Vec3 then - trigger.action.signalFlare( Vec3, trigger.flareColor.Red, 0 ) - end -end - ---- Smoke the UNIT. --- @param #UNIT self -function UNIT:Smoke( SmokeColor, Range ) - self:F2() - if Range then - trigger.action.smoke( self:GetRandomVec3( Range ), SmokeColor ) - else - trigger.action.smoke( self:GetVec3(), SmokeColor ) - end - -end - ---- Smoke the UNIT Green. --- @param #UNIT self -function UNIT:SmokeGreen() - self:F2() - trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Green ) -end - ---- Smoke the UNIT Red. --- @param #UNIT self -function UNIT:SmokeRed() - self:F2() - trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Red ) -end - ---- Smoke the UNIT White. --- @param #UNIT self -function UNIT:SmokeWhite() - self:F2() - trigger.action.smoke( self:GetVec3(), trigger.smokeColor.White ) -end - ---- Smoke the UNIT Orange. --- @param #UNIT self -function UNIT:SmokeOrange() - self:F2() - trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Orange ) -end - ---- Smoke the UNIT Blue. --- @param #UNIT self -function UNIT:SmokeBlue() - self:F2() - trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Blue ) -end - -- Is methods From 536934390c01646d8316ec2090487010f68c52b9 Mon Sep 17 00:00:00 2001 From: 132nd-etcher <132nd-etcher@users.noreply.github.com> Date: Fri, 7 Jul 2017 12:07:27 +0200 Subject: [PATCH 03/10] Reduce AI CAP logging noise (#609) Replace calls to E by calls to F in order to reduce the amount of log spam during an ongoing AI CAP patrol. --- Moose Development/Moose/AI/AI_CAP.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/AI/AI_CAP.lua b/Moose Development/Moose/AI/AI_CAP.lua index 1d14674c3..8c76674dc 100644 --- a/Moose Development/Moose/AI/AI_CAP.lua +++ b/Moose Development/Moose/AI/AI_CAP.lua @@ -402,7 +402,7 @@ function AI_CAP_ZONE:onafterDetected( Controllable, From, Event, To ) end if Engage == true then - self:E( 'Detected -> Engaging' ) + self:F( 'Detected -> Engaging' ) self:__Engage( 1 ) end end @@ -485,13 +485,13 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To ) if DetectedUnit:IsAlive() and DetectedUnit:IsAir() then if self.EngageZone then if DetectedUnit:IsInZone( self.EngageZone ) then - self:E( {"Within Zone and Engaging ", DetectedUnit } ) + self:F( {"Within Zone and Engaging ", DetectedUnit } ) AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit ) end else if self.EngageRange then if DetectedUnit:GetPointVec3():Get2DDistance(Controllable:GetPointVec3() ) <= self.EngageRange then - self:E( {"Within Range and Engaging", DetectedUnit } ) + self:F( {"Within Range and Engaging", DetectedUnit } ) AttackTasks[#AttackTasks+1] = Controllable:TaskAttackUnit( DetectedUnit ) end else @@ -508,7 +508,7 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To ) if #AttackTasks == 0 then - self:E("No targets found -> Going back to Patrolling") + self:F("No targets found -> Going back to Patrolling") self:__Abort( 1 ) self:__Route( 1 ) self:SetDetectionActivated() From b5c53baf676cec863d6c507e0b8a81e3839c1aa8 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 7 Jul 2017 18:19:08 +0200 Subject: [PATCH 04/10] Fixed #592 --- Moose Development/Moose/Tasking/Mission.lua | 2 +- Moose Development/Moose/Tasking/Task_A2A.lua | 28 +++++++++++- Moose Development/Moose/Tasking/Task_A2G.lua | 45 ++++++++++++++----- .../Moose/Tasking/Task_CARGO.lua | 17 +++++-- 4 files changed, 75 insertions(+), 17 deletions(-) diff --git a/Moose Development/Moose/Tasking/Mission.lua b/Moose Development/Moose/Tasking/Mission.lua index 832dd9d6c..d50ec823b 100644 --- a/Moose Development/Moose/Tasking/Mission.lua +++ b/Moose Development/Moose/Tasking/Mission.lua @@ -882,7 +882,7 @@ function MISSION:ReportOverview( ReportGroup, TaskStatus ) -- Determine how many tasks are remaining. local TasksRemaining = 0 - for TaskID, Task in pairs( self:GetTasks() ) do + for TaskID, Task in UTILS.spairs( self:GetTasks(), function( t, a, b ) return t[a]:ReportOrder( ReportGroup ) < t[b]:ReportOrder( ReportGroup ) end ) do local Task = Task -- Tasking.Task#TASK if Task:Is( TaskStatus ) then Report:Add( " - " .. Task:ReportOverview( ReportGroup ) ) diff --git a/Moose Development/Moose/Tasking/Task_A2A.lua b/Moose Development/Moose/Tasking/Task_A2A.lua index 4d58b9432..8586eb6cf 100644 --- a/Moose Development/Moose/Tasking/Task_A2A.lua +++ b/Moose Development/Moose/Tasking/Task_A2A.lua @@ -330,14 +330,24 @@ do -- TASK_A2A_INTERCEPT local TargetCoordinate = TargetSetUnit:GetFirst():GetCoordinate() self:SetInfo( "Coordinates", TargetCoordinate, 10 ) - + self:SetInfo( "Threat", "[" .. string.rep( "■", TargetSetUnit:CalculateThreatLevelA2G() ) .. "]", 11 ) local DetectedItemsCount = TargetSetUnit:Count() local DetectedItemsTypes = TargetSetUnit:GetTypeNames() self:SetInfo( "Targets", string.format( "%d of %s", DetectedItemsCount, DetectedItemsTypes ), 0 ) return self - end + end + + --- @param #TASK_A2A_INTERCEPT self + -- @param Wrapper.Group#GROUP ReportGroup + function TASK_A2A_INTERCEPT:ReportOrder( ReportGroup ) + self:F( { TaskInfo = self.TaskInfo } ) + local Coordinate = self.TaskInfo.Coordinates.TaskInfoText + local Distance = ReportGroup:GetCoordinate():Get2DDistance( Coordinate ) + + return Distance + end --- @param #TASK_A2A_INTERCEPT self @@ -462,6 +472,13 @@ do -- TASK_A2A_SWEEP return self end + function TASK_A2A_SWEEP:ReportOrder( ReportGroup ) + local Coordinate = self.TaskInfo.Coordinates.TaskInfoText + local Distance = ReportGroup:GetCoordinate():Get2DDistance( Coordinate ) + + return Distance + end + --- @param #TASK_A2A_SWEEP self function TASK_A2A_SWEEP:onafterGoal( TaskUnit, From, Event, To ) local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT @@ -581,6 +598,13 @@ do -- TASK_A2A_ENGAGE return self end + function TASK_A2A_ENGAGE:ReportOrder( ReportGroup ) + local Coordinate = self.TaskInfo.Coordinates.TaskInfoText + local Distance = ReportGroup:GetCoordinate():Get2DDistance( Coordinate ) + + return Distance + end + --- @param #TASK_A2A_ENGAGE self function TASK_A2A_ENGAGE:onafterGoal( TaskUnit, From, Event, To ) local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT diff --git a/Moose Development/Moose/Tasking/Task_A2G.lua b/Moose Development/Moose/Tasking/Task_A2G.lua index ade6da690..d7514b466 100644 --- a/Moose Development/Moose/Tasking/Task_A2G.lua +++ b/Moose Development/Moose/Tasking/Task_A2G.lua @@ -329,7 +329,15 @@ do -- TASK_A2G_SEAD return self end - + + function TASK_A2G_SEAD:ReportOrder( ReportGroup ) + local Coordinate = self.TaskInfo.Coordinates.TaskInfoText + local Distance = ReportGroup:GetCoordinate():Get2DDistance( Coordinate ) + + return Distance + end + + --- @param #TASK_A2G_SEAD self function TASK_A2G_SEAD:onafterGoal( TaskUnit, From, Event, To ) local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT @@ -341,7 +349,7 @@ do -- TASK_A2G_SEAD self:__Goal( -10 ) end - --- Set a score when a target in scope of the A2A attack, has been destroyed . + --- Set a score when a target in scope of the A2G attack, has been destroyed . -- @param #TASK_A2G_SEAD self -- @param #string PlayerName The name of the player. -- @param #number Score The score in points to be granted when task process has been achieved. @@ -357,7 +365,7 @@ do -- TASK_A2G_SEAD return self end - --- Set a score when all the targets in scope of the A2A attack, have been destroyed. + --- Set a score when all the targets in scope of the A2G attack, have been destroyed. -- @param #TASK_A2G_SEAD self -- @param #string PlayerName The name of the player. -- @param #number Score The score in points. @@ -373,7 +381,7 @@ do -- TASK_A2G_SEAD return self end - --- Set a penalty when the A2A attack has failed. + --- Set a penalty when the A2G attack has failed. -- @param #TASK_A2G_SEAD self -- @param #string PlayerName The name of the player. -- @param #number Penalty The penalty in points, must be a negative value! @@ -443,6 +451,15 @@ do -- TASK_A2G_BAI return self end + + function TASK_A2G_BAI:ReportOrder( ReportGroup ) + local Coordinate = self.TaskInfo.Coordinates.TaskInfoText + local Distance = ReportGroup:GetCoordinate():Get2DDistance( Coordinate ) + + return Distance + end + + --- @param #TASK_A2G_BAI self function TASK_A2G_BAI:onafterGoal( TaskUnit, From, Event, To ) local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT @@ -454,7 +471,7 @@ do -- TASK_A2G_BAI self:__Goal( -10 ) end - --- Set a score when a target in scope of the A2A attack, has been destroyed . + --- Set a score when a target in scope of the A2G attack, has been destroyed . -- @param #TASK_A2G_BAI self -- @param #string PlayerName The name of the player. -- @param #number Score The score in points to be granted when task process has been achieved. @@ -470,7 +487,7 @@ do -- TASK_A2G_BAI return self end - --- Set a score when all the targets in scope of the A2A attack, have been destroyed. + --- Set a score when all the targets in scope of the A2G attack, have been destroyed. -- @param #TASK_A2G_BAI self -- @param #string PlayerName The name of the player. -- @param #number Score The score in points. @@ -486,7 +503,7 @@ do -- TASK_A2G_BAI return self end - --- Set a penalty when the A2A attack has failed. + --- Set a penalty when the A2G attack has failed. -- @param #TASK_A2G_BAI self -- @param #string PlayerName The name of the player. -- @param #number Penalty The penalty in points, must be a negative value! @@ -556,6 +573,14 @@ do -- TASK_A2G_CAS return self end + function TASK_A2G_CAS:ReportOrder( ReportGroup ) + local Coordinate = self.TaskInfo.Coordinates.TaskInfoText + local Distance = ReportGroup:GetCoordinate():Get2DDistance( Coordinate ) + + return Distance + end + + --- @param #TASK_A2G_CAS self function TASK_A2G_CAS:onafterGoal( TaskUnit, From, Event, To ) local TargetSetUnit = self.TargetSetUnit -- Core.Set#SET_UNIT @@ -567,7 +592,7 @@ do -- TASK_A2G_CAS self:__Goal( -10 ) end - --- Set a score when a target in scope of the A2A attack, has been destroyed . + --- Set a score when a target in scope of the A2G attack, has been destroyed . -- @param #TASK_A2G_CAS self -- @param #string PlayerName The name of the player. -- @param #number Score The score in points to be granted when task process has been achieved. @@ -583,7 +608,7 @@ do -- TASK_A2G_CAS return self end - --- Set a score when all the targets in scope of the A2A attack, have been destroyed. + --- Set a score when all the targets in scope of the A2G attack, have been destroyed. -- @param #TASK_A2G_CAS self -- @param #string PlayerName The name of the player. -- @param #number Score The score in points. @@ -599,7 +624,7 @@ do -- TASK_A2G_CAS return self end - --- Set a penalty when the A2A attack has failed. + --- Set a penalty when the A2G attack has failed. -- @param #TASK_A2G_CAS self -- @param #string PlayerName The name of the player. -- @param #number Penalty The penalty in points, must be a negative value! diff --git a/Moose Development/Moose/Tasking/Task_CARGO.lua b/Moose Development/Moose/Tasking/Task_CARGO.lua index 189eb5353..cefbcbbef 100644 --- a/Moose Development/Moose/Tasking/Task_CARGO.lua +++ b/Moose Development/Moose/Tasking/Task_CARGO.lua @@ -251,7 +251,9 @@ do -- TASK_CARGO end end if NotInDeployZones then - MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Board cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuBoardCargo, self, Cargo ):SetTime(MenuTime) + if not TaskUnit:InAir() then + MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Board cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuBoardCargo, self, Cargo ):SetTime(MenuTime) + end end else MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Route to Pickup cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuRouteToPickup, self, Cargo ):SetTime(MenuTime) @@ -260,9 +262,9 @@ do -- TASK_CARGO end if Cargo:IsLoaded() then - - MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Unboard cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuUnBoardCargo, self, Cargo ):SetTime(MenuTime) - + if not TaskUnit:InAir() then + MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Unboard cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuUnBoardCargo, self, Cargo ):SetTime(MenuTime) + end -- Deployzones are optional zones that can be selected to request routing information. for DeployZoneName, DeployZone in pairs( Task.DeployZones ) do if not Cargo:IsInZone( DeployZone ) then @@ -607,6 +609,7 @@ do -- TASK_CARGO end + --- Set a limit on the amount of cargo items that can be loaded into the Carriers. -- @param #TASK_CARGO self -- @param CargoLimit Specifies a number of cargo items that can be loaded in the helicopter. @@ -922,6 +925,12 @@ do -- TASK_CARGO_TRANSPORT return self end + + function TASK_CARGO_TRANSPORT:ReportOrder( ReportGroup ) + + return true + end + --- -- @param #TASK_CARGO_TRANSPORT self From 7ebf7a2beee070c95d25a96cbc556ad674a0ecc3 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 7 Jul 2017 18:20:58 +0200 Subject: [PATCH 05/10] Fixed #611 --- Moose Development/Moose/Core/Settings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Core/Settings.lua b/Moose Development/Moose/Core/Settings.lua index 5bb5db0dc..e7cf518a2 100644 --- a/Moose Development/Moose/Core/Settings.lua +++ b/Moose Development/Moose/Core/Settings.lua @@ -55,7 +55,7 @@ do -- SETTINGS if PlayerName == nil then local self = BASE:Inherit( self, BASE:New() ) -- #SETTINGS self:SetMetric() -- Defaults - self:SetA2G_MGRS() -- Defaults + self:SetA2G_BR() -- Defaults self:SetA2A_BRAA() -- Defaults self:SetLL_Accuracy( 2 ) -- Defaults self:SetLL_DMS( true ) -- Defaults From 06e063d594b45a77ada298173d7bdcdb7754e21c Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 7 Jul 2017 18:45:32 +0200 Subject: [PATCH 06/10] Fixes cargo --- Moose Development/Moose/Tasking/Task_CARGO.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Tasking/Task_CARGO.lua b/Moose Development/Moose/Tasking/Task_CARGO.lua index cefbcbbef..812691fcd 100644 --- a/Moose Development/Moose/Tasking/Task_CARGO.lua +++ b/Moose Development/Moose/Tasking/Task_CARGO.lua @@ -913,7 +913,7 @@ do -- TASK_CARGO_TRANSPORT local CargoType = Cargo:GetType() local CargoName = Cargo:GetName() local CargoCoordinate = Cargo:GetCoordinate() - CargoReport:Add( string.format( '- "%s" (%s) at %s', CargoName, CargoType, CargoCoordinate:ToString() ) ) + CargoReport:Add( string.format( '- "%s" (%s) at %s', CargoName, CargoType, CargoCoordinate:ToStringMGRS() ) ) end ) From 367c4d74af7cb59ed756cd6febe7bdc4a6f7010e Mon Sep 17 00:00:00 2001 From: FlightControl Date: Sat, 8 Jul 2017 05:00:47 +0200 Subject: [PATCH 07/10] Fixes imperial / metric menu option setting --- Moose Development/Moose/Core/Settings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Core/Settings.lua b/Moose Development/Moose/Core/Settings.lua index e7cf518a2..da43e3d03 100644 --- a/Moose Development/Moose/Core/Settings.lua +++ b/Moose Development/Moose/Core/Settings.lua @@ -447,7 +447,7 @@ do -- SETTINGS --- @param #SETTINGS self function SETTINGS:MenuGroupMWSystem( PlayerUnit, PlayerGroup, PlayerName, MW ) - self.Metrics = MW + self.Metric = MW MESSAGE:New( string.format("Settings: Measurement format set to %s for player %s.", MW and "Metric" or "Imperial", PlayerName ), 5 ):ToGroup( PlayerGroup ) self:RemovePlayerMenu(PlayerUnit) self:SetPlayerMenu(PlayerUnit) From 8e2aef17e7b1a2dd16c2ebbcdd82380cbf053736 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Sat, 8 Jul 2017 05:54:33 +0200 Subject: [PATCH 08/10] Fixes to resolve exceptions in multi player situations --- .../Moose/AI/AI_A2A_Dispatcher.lua | 16 +- Moose Development/Moose/Wrapper/Group.lua | 2 +- Moose Development/Moose/Wrapper/Unit.lua | 208 +++++++++--------- 3 files changed, 117 insertions(+), 109 deletions(-) diff --git a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua index 78d340f09..78f684a35 100644 --- a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua @@ -1724,14 +1724,16 @@ do -- AI_A2A_DISPATCHER self:E( { DefenderSquadron } ) local SpawnCoord = DefenderSquadron.Airbase:GetCoordinate() -- Core.Point#COORDINATE local TargetCoord = Target.Set:GetFirst():GetCoordinate() - local Distance = SpawnCoord:Get2DDistance( TargetCoord ) - - if ClosestDistance == 0 or Distance < ClosestDistance then + if TargetCoord then + local Distance = SpawnCoord:Get2DDistance( TargetCoord ) - -- Only intercept if the distance to target is smaller or equal to the GciRadius limit. - if Distance <= self.GciRadius then - ClosestDistance = Distance - ClosestDefenderSquadronName = SquadronName + if ClosestDistance == 0 or Distance < ClosestDistance then + + -- Only intercept if the distance to target is smaller or equal to the GciRadius limit. + if Distance <= self.GciRadius then + ClosestDistance = Distance + ClosestDefenderSquadronName = SquadronName + end end end end diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 3f3215501..dcc26164c 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -1170,7 +1170,7 @@ do -- Players -- @return #nil The group has no players function GROUP:GetPlayerNames() - local PlayerNames = nil + local PlayerNames = {} local Units = self:GetUnits() for UnitID, UnitData in pairs( Units ) do diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index 6cf6906ed..d30758c54 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -598,122 +598,128 @@ end -- @param #UNIT self function UNIT:GetThreatLevel() - local Attributes = self:GetDesc().attributes - self:T( Attributes ) local ThreatLevel = 0 local ThreatText = "" - if self:IsGround() then + local Descriptor = self:GetDesc() - self:T( "Ground" ) + if Descriptor then - local ThreatLevels = { - "Unarmed", - "Infantry", - "Old Tanks & APCs", - "Tanks & IFVs without ATGM", - "Tanks & IFV with ATGM", - "Modern Tanks", - "AAA", - "IR Guided SAMs", - "SR SAMs", - "MR SAMs", - "LR SAMs" - } + local Attributes = Descriptor.attributes + self:T( Attributes ) + + if self:IsGround() then + self:T( "Ground" ) - if Attributes["LR SAM"] then ThreatLevel = 10 - elseif Attributes["MR SAM"] then ThreatLevel = 9 - elseif Attributes["SR SAM"] and - not Attributes["IR Guided SAM"] then ThreatLevel = 8 - elseif ( Attributes["SR SAM"] or Attributes["MANPADS"] ) and - Attributes["IR Guided SAM"] then ThreatLevel = 7 - elseif Attributes["AAA"] then ThreatLevel = 6 - elseif Attributes["Modern Tanks"] then ThreatLevel = 5 - elseif ( Attributes["Tanks"] or Attributes["IFV"] ) and - Attributes["ATGM"] then ThreatLevel = 4 - elseif ( Attributes["Tanks"] or Attributes["IFV"] ) and - not Attributes["ATGM"] then ThreatLevel = 3 - elseif Attributes["Old Tanks"] or Attributes["APC"] or Attributes["Artillery"] then ThreatLevel = 2 - elseif Attributes["Infantry"] then ThreatLevel = 1 + local ThreatLevels = { + "Unarmed", + "Infantry", + "Old Tanks & APCs", + "Tanks & IFVs without ATGM", + "Tanks & IFV with ATGM", + "Modern Tanks", + "AAA", + "IR Guided SAMs", + "SR SAMs", + "MR SAMs", + "LR SAMs" + } + + + if Attributes["LR SAM"] then ThreatLevel = 10 + elseif Attributes["MR SAM"] then ThreatLevel = 9 + elseif Attributes["SR SAM"] and + not Attributes["IR Guided SAM"] then ThreatLevel = 8 + elseif ( Attributes["SR SAM"] or Attributes["MANPADS"] ) and + Attributes["IR Guided SAM"] then ThreatLevel = 7 + elseif Attributes["AAA"] then ThreatLevel = 6 + elseif Attributes["Modern Tanks"] then ThreatLevel = 5 + elseif ( Attributes["Tanks"] or Attributes["IFV"] ) and + Attributes["ATGM"] then ThreatLevel = 4 + elseif ( Attributes["Tanks"] or Attributes["IFV"] ) and + not Attributes["ATGM"] then ThreatLevel = 3 + elseif Attributes["Old Tanks"] or Attributes["APC"] or Attributes["Artillery"] then ThreatLevel = 2 + elseif Attributes["Infantry"] then ThreatLevel = 1 + end + + ThreatText = ThreatLevels[ThreatLevel+1] end - ThreatText = ThreatLevels[ThreatLevel+1] - end - - if self:IsAir() then - - self:T( "Air" ) - - local ThreatLevels = { - "Unarmed", - "Tanker", - "AWACS", - "Transport Helicopter", - "UAV", - "Bomber", - "Strategic Bomber", - "Attack Helicopter", - "Battleplane", - "Multirole Fighter", - "Fighter" - } + if self:IsAir() then - - if Attributes["Fighters"] then ThreatLevel = 10 - elseif Attributes["Multirole fighters"] then ThreatLevel = 9 - elseif Attributes["Battleplanes"] then ThreatLevel = 8 - elseif Attributes["Attack helicopters"] then ThreatLevel = 7 - elseif Attributes["Strategic bombers"] then ThreatLevel = 6 - elseif Attributes["Bombers"] then ThreatLevel = 5 - elseif Attributes["UAVs"] then ThreatLevel = 4 - elseif Attributes["Transport helicopters"] then ThreatLevel = 3 - elseif Attributes["AWACS"] then ThreatLevel = 2 - elseif Attributes["Tankers"] then ThreatLevel = 1 + self:T( "Air" ) + + local ThreatLevels = { + "Unarmed", + "Tanker", + "AWACS", + "Transport Helicopter", + "UAV", + "Bomber", + "Strategic Bomber", + "Attack Helicopter", + "Battleplane", + "Multirole Fighter", + "Fighter" + } + + + if Attributes["Fighters"] then ThreatLevel = 10 + elseif Attributes["Multirole fighters"] then ThreatLevel = 9 + elseif Attributes["Battleplanes"] then ThreatLevel = 8 + elseif Attributes["Attack helicopters"] then ThreatLevel = 7 + elseif Attributes["Strategic bombers"] then ThreatLevel = 6 + elseif Attributes["Bombers"] then ThreatLevel = 5 + elseif Attributes["UAVs"] then ThreatLevel = 4 + elseif Attributes["Transport helicopters"] then ThreatLevel = 3 + elseif Attributes["AWACS"] then ThreatLevel = 2 + elseif Attributes["Tankers"] then ThreatLevel = 1 + end + + ThreatText = ThreatLevels[ThreatLevel+1] end - - ThreatText = ThreatLevels[ThreatLevel+1] - end - - if self:IsShip() then - - self:T( "Ship" ) - ---["Aircraft Carriers"] = {"Heavy armed ships",}, ---["Cruisers"] = {"Heavy armed ships",}, ---["Destroyers"] = {"Heavy armed ships",}, ---["Frigates"] = {"Heavy armed ships",}, ---["Corvettes"] = {"Heavy armed ships",}, ---["Heavy armed ships"] = {"Armed ships", "Armed Air Defence", "HeavyArmoredUnits",}, ---["Light armed ships"] = {"Armed ships","NonArmoredUnits"}, ---["Armed ships"] = {"Ships"}, ---["Unarmed ships"] = {"Ships","HeavyArmoredUnits",}, - - local ThreatLevels = { - "Unarmed ship", - "Light armed ships", - "Corvettes", - "", - "Frigates", - "", - "Cruiser", - "", - "Destroyer", - "", - "Aircraft Carrier" - } + if self:IsShip() then + + self:T( "Ship" ) + + --["Aircraft Carriers"] = {"Heavy armed ships",}, + --["Cruisers"] = {"Heavy armed ships",}, + --["Destroyers"] = {"Heavy armed ships",}, + --["Frigates"] = {"Heavy armed ships",}, + --["Corvettes"] = {"Heavy armed ships",}, + --["Heavy armed ships"] = {"Armed ships", "Armed Air Defence", "HeavyArmoredUnits",}, + --["Light armed ships"] = {"Armed ships","NonArmoredUnits"}, + --["Armed ships"] = {"Ships"}, + --["Unarmed ships"] = {"Ships","HeavyArmoredUnits",}, - if Attributes["Aircraft Carriers"] then ThreatLevel = 10 - elseif Attributes["Destroyers"] then ThreatLevel = 8 - elseif Attributes["Cruisers"] then ThreatLevel = 6 - elseif Attributes["Frigates"] then ThreatLevel = 4 - elseif Attributes["Corvettes"] then ThreatLevel = 2 - elseif Attributes["Light armed ships"] then ThreatLevel = 1 + local ThreatLevels = { + "Unarmed ship", + "Light armed ships", + "Corvettes", + "", + "Frigates", + "", + "Cruiser", + "", + "Destroyer", + "", + "Aircraft Carrier" + } + + + if Attributes["Aircraft Carriers"] then ThreatLevel = 10 + elseif Attributes["Destroyers"] then ThreatLevel = 8 + elseif Attributes["Cruisers"] then ThreatLevel = 6 + elseif Attributes["Frigates"] then ThreatLevel = 4 + elseif Attributes["Corvettes"] then ThreatLevel = 2 + elseif Attributes["Light armed ships"] then ThreatLevel = 1 + end + + ThreatText = ThreatLevels[ThreatLevel+1] end - - ThreatText = ThreatLevels[ThreatLevel+1] end self:T2( ThreatLevel ) From 3fe573926bd9854274adf63450958722b33682bb Mon Sep 17 00:00:00 2001 From: FlightControl Date: Sat, 8 Jul 2017 06:35:06 +0200 Subject: [PATCH 09/10] Fixed scoring format --- .../Moose/Functional/Scoring.lua | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index 08289fd79..5b3d96f03 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -1009,8 +1009,8 @@ function SCORING:_EventOnHit( Event ) MESSAGE :New( self.DisplayMessagePrefix .. "Player '" .. Event.WeaponPlayerName .. "' hit a friendly target " .. - TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerHit.PenaltyHit .. " times. " .. - "Penalty: -" .. PlayerHit.Penalty .. ". Score Total:" .. Player.Score - Player.Penalty, + TargetUnitCategory .. " ( " .. TargetType .. " ) " .. + "Penalty: -" .. PlayerHit.Penalty .. " = " .. Player.Score - Player.Penalty, 2 ) :ToAllIf( self:IfMessagesHit() and self:IfMessagesToAll() ) @@ -1022,8 +1022,8 @@ function SCORING:_EventOnHit( Event ) PlayerHit.ScoreHit = PlayerHit.ScoreHit + 1 MESSAGE :New( self.DisplayMessagePrefix .. "Player '" .. Event.WeaponPlayerName .. "' hit an enemy target " .. - TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerHit.ScoreHit .. " times. " .. - "Score: " .. PlayerHit.Score .. ". Score Total:" .. Player.Score - Player.Penalty, + TargetUnitCategory .. " ( " .. TargetType .. " ) " .. + "Score: +" .. PlayerHit.Score .. " = " .. Player.Score - Player.Penalty, 2 ) :ToAllIf( self:IfMessagesHit() and self:IfMessagesToAll() ) @@ -1132,8 +1132,8 @@ function SCORING:_EventOnDeadOrCrash( Event ) if Player.HitPlayers[TargetPlayerName] then -- A player destroyed another player MESSAGE :New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' destroyed friendly player '" .. TargetPlayerName .. "' " .. - TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. TargetDestroy.PenaltyDestroy .. " times. " .. - "Penalty: -" .. TargetDestroy.Penalty .. ". Score Total:" .. Player.Score - Player.Penalty, + TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. + "Penalty: -" .. TargetDestroy.Penalty .. " = " .. Player.Score - Player.Penalty, 15 ) :ToAllIf( self:IfMessagesDestroy() and self:IfMessagesToAll() ) @@ -1141,8 +1141,8 @@ function SCORING:_EventOnDeadOrCrash( Event ) else MESSAGE :New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' destroyed a friendly target " .. - TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. TargetDestroy.PenaltyDestroy .. " times. " .. - "Penalty: -" .. TargetDestroy.Penalty .. ". Score Total:" .. Player.Score - Player.Penalty, + TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. + "Penalty: -" .. TargetDestroy.Penalty .. " = " .. Player.Score - Player.Penalty, 15 ) :ToAllIf( self:IfMessagesDestroy() and self:IfMessagesToAll() ) @@ -1166,8 +1166,8 @@ function SCORING:_EventOnDeadOrCrash( Event ) if Player.HitPlayers[TargetPlayerName] then -- A player destroyed another player MESSAGE :New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' destroyed enemy player '" .. TargetPlayerName .. "' " .. - TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. TargetDestroy.ScoreDestroy .. " times. " .. - "Score: " .. TargetDestroy.Score .. ". Score Total:" .. Player.Score - Player.Penalty, + TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. + "Score: +" .. TargetDestroy.Score .. " = " .. Player.Score - Player.Penalty, 15 ) :ToAllIf( self:IfMessagesDestroy() and self:IfMessagesToAll() ) @@ -1175,8 +1175,8 @@ function SCORING:_EventOnDeadOrCrash( Event ) else MESSAGE :New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' destroyed an enemy " .. - TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. TargetDestroy.ScoreDestroy .. " times. " .. - "Score: " .. TargetDestroy.Score .. ". Total:" .. Player.Score - Player.Penalty, + TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. + "Score: +" .. TargetDestroy.Score .. " = " .. Player.Score - Player.Penalty, 15 ) :ToAllIf( self:IfMessagesDestroy() and self:IfMessagesToAll() ) From 85975c01a4c413a2a2b1573dbebc8b85c7abdf6c Mon Sep 17 00:00:00 2001 From: FlightControl Date: Sat, 8 Jul 2017 09:20:42 +0200 Subject: [PATCH 10/10] Optimizations --- .../Moose/AI/AI_A2A_Dispatcher.lua | 108 +++- .../Moose/Functional/Scoring.lua | 20 +- Moose Development/Moose/Tasking/Task.lua | 2 +- docs/Documentation/AI_A2A.html | 1 - docs/Documentation/AI_A2A_Dispatcher.html | 214 ++++++-- docs/Documentation/Cargo.html | 507 +++++++++++++++++- docs/Documentation/Database.html | 4 +- docs/Documentation/Designate.html | 1 + docs/Documentation/Movement.html | 4 + docs/Documentation/Positionable.html | 423 ++++++++++++++- docs/Documentation/Set.html | 4 +- docs/Documentation/Settings.html | 209 ++++---- docs/Documentation/Spawn.html | 25 +- docs/Documentation/SpawnStatic.html | 1 + docs/Documentation/Spot.html | 4 + docs/Documentation/Task_A2A.html | 81 +++ docs/Documentation/Task_A2G.html | 117 +++- docs/Documentation/Task_Cargo.html | 104 +++- docs/Documentation/Unit.html | 230 -------- 19 files changed, 1577 insertions(+), 482 deletions(-) diff --git a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua index 78f684a35..131fea47f 100644 --- a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua @@ -2083,33 +2083,33 @@ do -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\Dia1.JPG) -- -- The AI_A2A_GCICAP class is designed to create an automatic air defence system for a coalition setting up GCI and CAP air defenses. + -- The class derives from @{AI#AI_A2A_DISPATCHER} and thus all the methods that are defined in this class, can be used also in AI\_A2A\_GCICAP. -- -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\Dia3.JPG) -- - -- It includes automatic spawning of Combat Air Patrol aircraft (CAP) and Ground Controlled Intercept aircraft (GCI) in response to enemy air movements that are detected by a ground based radar network. - -- CAP flights will take off and proceed to designated CAP zones where they will remain on station until the ground radars direct them to intercept detected enemy aircraft or they run short of fuel and must return to base (RTB). When a CAP flight leaves their zone to perform an interception or return to base a new CAP flight will spawn to take their place. + -- AI_A2A_GCICAP includes automatic spawning of Combat Air Patrol aircraft (CAP) and Ground Controlled Intercept aircraft (GCI) in response to enemy + -- air movements that are detected by a ground based radar network. + -- CAP flights will take off and proceed to designated CAP zones where they will remain on station until the ground radars direct them to intercept + -- detected enemy aircraft or they run short of fuel and must return to base (RTB). + -- When a CAP flight leaves their zone to perform an interception or return to base a new CAP flight will spawn to take their place. -- If all CAP flights are engaged or RTB then additional GCI interceptors will scramble to intercept unengaged enemy aircraft under ground radar control. -- With a little time and with a little work it provides the mission designer with a convincing and completely automatic air defence system. -- In short it is a plug in very flexible and configurable air defence module for DCS World. -- - -- Note that in order to create a two way A2A defense system, two AI\_A2A\_GCICAP defense system may need to be created, for each coalition one. - -- This is a good implementation, because maybe in the future, more coalitions may become available in DCS world. + -- The AI_A2A_GCICAP provides a lightweight configuration method using the mission editor. -- - -- ## 1. AI\_A2A\_GCICAP constructor: + -- + -- ## 1) Configure a working AI\_A2A\_GCICAP defense system for ONE coalition. + -- + -- ### 1.1) Define which airbases are for which coalition. -- - -- The @{#AI_A2A_GCICAP.New}() method creates a new AI\_A2A\_GCICAP instance. - -- There are two parameters required, a list of prefix group names that collects the groups of the EWR network, and a radius in meters, - -- that will be used to group the detected targets. + -- Color the airbases red or blue. You can do this by selecting the airbase on the map, and select the coalition blue or red. -- - -- ### 1.1. Define the **EWR network**: - -- - -- As part of the AI\_A2A\_GCICAP constructor, a list of prefixes must be given of the group names defined within the mission editor, - -- that define the EWR network. + -- ### 1.2) Place Groups given a name starting with a **EWR prefix** of your choice to build your EWR network. + -- + -- **All EWR groups starting with the EWR prefix (text) will be included in the detection system.** -- -- An EWR network, or, Early Warning Radar network, is used to early detect potential airborne targets and to understand the position of patrolling targets of the enemy. - -- - -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\Dia5.JPG) - -- -- Typically EWR networks are setup using 55G6 EWR, 1L13 EWR, Hawk sr and Patriot str ground based radar units. -- These radars have different ranges and 55G6 EWR and 1L13 EWR radars are Eastern Bloc units (eg Russia, Ukraine, Georgia) while the Hawk and Patriot radars are Western (eg US). -- Additionally, ANY other radar capable unit can be part of the EWR network! Also AWACS airborne units, planes, helicopters can help to detect targets, as long as they have radar. @@ -2128,28 +2128,80 @@ do -- EWR networks are **dynamically maintained**. By defining in a **smart way the names or name prefixes of the groups** with EWR capable units, these groups will be **automatically added or deleted** from the EWR network, -- increasing or decreasing the radar coverage of the Early Warning System. -- - -- See the following example to setup an EWR network containing EWR stations and AWACS. + -- ### 1.3) Place Airplane or Helicopter Groups with late activation switched on -- - -- -- Setup the A2A GCICAP dispatcher, and initialize it. - -- A2ADispatcher = AI_A2A_DISPATCHER_GCICAP:New( { "DF CCCP AWACS", "DF CCCP EWR" }, 30000 ) + -- These are **templates**, with a given name starting with **a Template prefix** above each airbase that you wanna have a squadron. + -- These **templates** need to be within 10km from the airbase center. They don't need to have a slot at the airplane, they can just be positioned above the airbase, + -- without a route, and should only have ONE unit. -- - -- The above example creates a new AI_A2A_DISPATCHER_GCICAP instance, and stores this in the variable (object) **A2ADispatcher**. - -- The first parameter is are the prefixes of the group names that define the EWR network. - -- The A2A dispatcher will filter all active groups with a group name starting with **DF CCCP AWACS** or **DF CCCP EWR** to be included in the EWR network. + -- ### 1.4) Place floating helicopters to create the CAP zones. -- - -- ### 1.2. Define the detected **target grouping radius**: + -- The helicopter indicates the start of the CAP zone. + -- The route points the form of the CAP zone polygon. + -- The place of the helicopter is important, as the airbase closest to the helicopter will be the airbase from where the CAP planes will take off for CAP. -- - -- As a second parameter of the @{#AI_A2A_DISPATCHER_GCICAP.New}() method, a radius in meters must be given. The radius indicates that detected targets need to be grouped within a radius of 30km. + -- ## 2) There are a lot of defaults set, which can be further modified using the methods in @{AI#AI_A2A_DISPATCHER}: + -- + -- ### 2.1) Planes are taking off in the air from the airbases. + -- + -- This prevents airbases to get cluttered with airplanes taking off, it also reduces the risk of human players colliding with taxiiing airplanes, + -- resulting in the airbase to halt operations. + -- + -- ### 2.2) Planes return near the airbase or will land if damaged. + -- + -- When damaged airplanes return to the airbase, they will be routed and will dissapear in the air when they are near the airbase. + -- There are exceptions to this rule, airplanes that aren't "listening" anymore due to damage or out of fuel, will return to the airbase and land. + -- + -- ### 2.3) CAP operations setup for specific airbases, will be executed with the following parameters: + -- + -- * The altitude will range between 6000 and 10000 meters. + -- * The CAP speed will vary between 500 and 800 km/h. + -- * The engage speed between 800 and 1200 km/h. + -- + -- ### 2.4) Each airbase will perform GCI when required, with the following parameters: + -- + -- * The engage speed is between 800 and 1200 km/h. + -- + -- ### 2.5) Grouping or detected targets. + -- + -- Detected targets are constantly re-grouped, that is, when certain detected aircraft are moving further than the group radius, then these aircraft will become a separate + -- group being detected. + -- + -- Targets will be grouped within a radius of 30km by default. + -- + -- The radius indicates that detected targets need to be grouped within a radius of 30km. -- The grouping radius should not be too small, but also depends on the types of planes and the era of the simulation. -- Fast planes like in the 80s, need a larger radius than WWII planes. -- Typically I suggest to use 30000 for new generation planes and 10000 for older era aircraft. -- - -- Note that detected targets are constantly re-grouped, that is, when certain detected aircraft are moving further than the group radius, then these aircraft will become a separate - -- group being detected. This may result in additional GCI being started by the dispatcher! So don't make this value too small! + -- ## 3) Additional notes: -- - -- ## 2. AI_A2A_DISPATCHER_DOCUMENTATION is derived from @{#AI_A2A_DISPATCHER}, - -- so all further documentation needs to be consulted in this class - -- for documentation consistency. + -- In order to create a two way A2A defense system, **two AI\_A2A\_GCICAP defense systems must need to be created**, for each coalition one. + -- Each defense system needs its own EWR network setup, airplane templates and CAP configurations. + -- + -- This is a good implementation, because maybe in the future, more coalitions may become available in DCS world. + -- + -- + -- + -- + -- ## 4) Coding example how to use the AI\_A2A\_GCICAP class: + -- + -- -- Setup the AI_A2A_GCICAP dispatcher for one coalition, and initialize it. + -- GCI_Red = AI_A2A_GCICAP:New( "EWR CCCP", "SQUADRON CCCP", "CAP CCCP", 2 ) + -- + -- This will create a GCI/CAP system for the RED coalition, and stores the reference to the GCI/CAP system in the `GCI\_Red` variable! + -- In the mission editor, the following setup will have taken place: + -- + -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\Dia5.JPG) + -- + -- The following parameters were given to the :New method of AI_A2A_GCICAP, and mean the following: + -- + -- * `EWR CCCP`: Groups of the RED coalition are placed that define the EWR network. These groups start with the name `EWR CCCP`. + -- * `SQUADRON CCCP`: Late activated Groups objects of the RED coalition are placed above the relevant airbases that will contain these templates in the squadron. + -- These late activated Groups start with the name `SQUADRON CCCP`. Each Group object contains only one Unit, and defines the weapon payload, skin and skill level. + -- * `CAP CCCP`: CAP Zones are defined using floating, late activated Helicopter Group objects, where the route points define the route of the polygon of the CAP Zone. + -- These Helicopter Group objects start with the name `CAP CCCP`, and will be the locations wherein CAP will be performed. + -- * `2` Defines how many CAP airplanes are patrolling in each CAP zone defined simulateneously. -- -- @field #AI_A2A_GCICAP AI_A2A_GCICAP = { diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index 5b3d96f03..53ed278b1 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -294,7 +294,7 @@ end -- @param #string DisplayMessagePrefix (Default="Scoring: ") The scoring prefix string. -- @return #SCORING function SCORING:SetDisplayMessagePrefix( DisplayMessagePrefix ) - self.DisplayMessagePrefix = DisplayMessagePrefix or "Scoring: " + self.DisplayMessagePrefix = DisplayMessagePrefix or "" return self end @@ -637,7 +637,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) MESSAGE:New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' committed FRATRICIDE, he will be COURT MARTIALED and is DISMISSED from this mission!", 10 ):ToAll() - UnitData:Destroy() + UnitData:GetGroup():Destroy() end end @@ -911,7 +911,7 @@ function SCORING:_EventOnHit( Event ) :ToCoalitionIf( InitCoalition, self:IfMessagesHit() and self:IfMessagesToCoalition() ) else MESSAGE - :New( self.DisplayMessagePrefix .. "Player '" .. InitPlayerName .. "' hit a friendly target " .. + :New( self.DisplayMessagePrefix .. "Player '" .. InitPlayerName .. "' hit friendly target " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerHit.PenaltyHit .. " times. " .. "Penalty: -" .. PlayerHit.Penalty .. ". Score Total:" .. Player.Score - Player.Penalty, 2 @@ -935,7 +935,7 @@ function SCORING:_EventOnHit( Event ) :ToCoalitionIf( InitCoalition, self:IfMessagesHit() and self:IfMessagesToCoalition() ) else MESSAGE - :New( self.DisplayMessagePrefix .. "Player '" .. InitPlayerName .. "' hit an enemy target " .. + :New( self.DisplayMessagePrefix .. "Player '" .. InitPlayerName .. "' hit enemy target " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. PlayerHit.ScoreHit .. " times. " .. "Score: " .. PlayerHit.Score .. ". Score Total:" .. Player.Score - Player.Penalty, 2 @@ -947,7 +947,7 @@ function SCORING:_EventOnHit( Event ) end else -- A scenery object was hit. MESSAGE - :New( self.DisplayMessagePrefix .. "Player '" .. InitPlayerName .. "' hit a scenery object.", + :New( self.DisplayMessagePrefix .. "Player '" .. InitPlayerName .. "' hit scenery object.", 2 ) :ToAllIf( self:IfMessagesHit() and self:IfMessagesToAll() ) @@ -1008,7 +1008,7 @@ function SCORING:_EventOnHit( Event ) PlayerHit.PenaltyHit = PlayerHit.PenaltyHit + 1 MESSAGE - :New( self.DisplayMessagePrefix .. "Player '" .. Event.WeaponPlayerName .. "' hit a friendly target " .. + :New( self.DisplayMessagePrefix .. "Player '" .. Event.WeaponPlayerName .. "' hit friendly target " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. "Penalty: -" .. PlayerHit.Penalty .. " = " .. Player.Score - Player.Penalty, 2 @@ -1021,7 +1021,7 @@ function SCORING:_EventOnHit( Event ) PlayerHit.Score = PlayerHit.Score + 1 PlayerHit.ScoreHit = PlayerHit.ScoreHit + 1 MESSAGE - :New( self.DisplayMessagePrefix .. "Player '" .. Event.WeaponPlayerName .. "' hit an enemy target " .. + :New( self.DisplayMessagePrefix .. "Player '" .. Event.WeaponPlayerName .. "' hit enemy target " .. TargetUnitCategory .. " ( " .. TargetType .. " ) " .. "Score: +" .. PlayerHit.Score .. " = " .. Player.Score - Player.Penalty, 2 @@ -1032,7 +1032,7 @@ function SCORING:_EventOnHit( Event ) end else -- A scenery object was hit. MESSAGE - :New( self.DisplayMessagePrefix .. "Player '" .. Event.WeaponPlayerName .. "' hit a scenery object.", + :New( self.DisplayMessagePrefix .. "Player '" .. Event.WeaponPlayerName .. "' hit scenery object.", 2 ) :ToAllIf( self:IfMessagesHit() and self:IfMessagesToAll() ) @@ -1140,7 +1140,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) :ToCoalitionIf( InitCoalition, self:IfMessagesDestroy() and self:IfMessagesToCoalition() ) else MESSAGE - :New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' destroyed a friendly target " .. + :New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' destroyed friendly target " .. TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. "Penalty: -" .. TargetDestroy.Penalty .. " = " .. Player.Score - Player.Penalty, 15 @@ -1174,7 +1174,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) :ToCoalitionIf( InitCoalition, self:IfMessagesDestroy() and self:IfMessagesToCoalition() ) else MESSAGE - :New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' destroyed an enemy " .. + :New( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' destroyed enemy " .. TargetUnitCategory .. " ( " .. ThreatTypeTarget .. " ) " .. "Score: +" .. TargetDestroy.Score .. " = " .. Player.Score - Player.Penalty, 15 diff --git a/Moose Development/Moose/Tasking/Task.lua b/Moose Development/Moose/Tasking/Task.lua index a56d3fc8e..26c5125c6 100644 --- a/Moose Development/Moose/Tasking/Task.lua +++ b/Moose Development/Moose/Tasking/Task.lua @@ -738,7 +738,7 @@ function TASK:SetPlannedMenuForGroup( TaskGroup, MenuTime ) --local MissionMenu = Mission:GetMenu( TaskGroup ) - local TaskPlannedMenu = MENU_GROUP:New( TaskGroup, "Planned Tasks", MissionMenu ):SetTime( MenuTime ) + local TaskPlannedMenu = MENU_GROUP:New( TaskGroup, "Join Planned Task", MissionMenu, Mission.MenuReportTasksPerStatus, Mission, TaskGroup, "Planned" ):SetTime( MenuTime ) local TaskTypeMenu = MENU_GROUP:New( TaskGroup, TaskType, TaskPlannedMenu ):SetTime( MenuTime ):SetRemoveParent( true ) local TaskTypeMenu = MENU_GROUP:New( TaskGroup, TaskText, TaskTypeMenu ):SetTime( MenuTime ):SetRemoveParent( true ) local ReportTaskMenu = MENU_GROUP_COMMAND:New( TaskGroup, string.format( "Report Task Status" ), TaskTypeMenu, self.MenuTaskStatus, self, TaskGroup ):SetTime( MenuTime ):SetRemoveParent( true ) diff --git a/docs/Documentation/AI_A2A.html b/docs/Documentation/AI_A2A.html index 2a24504d1..ee2dc9007 100644 --- a/docs/Documentation/AI_A2A.html +++ b/docs/Documentation/AI_A2A.html @@ -575,7 +575,6 @@
- #number AI_A2A.IdleCount diff --git a/docs/Documentation/AI_A2A_Dispatcher.html b/docs/Documentation/AI_A2A_Dispatcher.html index 2dba4f655..a18b241d8 100644 --- a/docs/Documentation/AI_A2A_Dispatcher.html +++ b/docs/Documentation/AI_A2A_Dispatcher.html @@ -134,13 +134,13 @@ - AI_A2A_DISPATCHER_GCICAP + AI_A2A_GCICAP -

AI_A2A_DISPATCHER_GCICAP class, extends AI#AIA2ADISPATCHER

+

AI_A2A_GCICAP class, extends AI#AIA2ADISPATCHER

Banner Image

-

The #AIA2ADISPATCHER class is designed to create an automatic air defence system for a coalition.

+

The AIA2AGCICAP class is designed to create an automatic air defence system for a coalition setting up GCI and CAP air defenses.

@@ -610,12 +610,24 @@ -

Type AI_A2A_DISPATCHER_GCICAP

+

Type AI_A2A_GCICAP

- + + + + + + + + +
AI_A2A_DISPATCHER_GCICAP:New(<, GroupingRadius, EWRPrefixes)AI_A2A_GCICAP.CAPTemplates -

AIA2ADISPATCHER_GCICAP constructor.

+ +
AI_A2A_GCICAP:New(<, GroupingRadius, EWRPrefixes, TemplatePrefixes, CAPPrefixes, CapLimit, EngageRadius) +

AIA2AGCICAP constructor.

+
AI_A2A_GCICAP.Templates +
@@ -1152,49 +1164,48 @@ Therefore if F4s are wanted as a coalition’s CAP or GCI aircraft Germany will
- #AI_A2A_DISPATCHER_GCICAP - -AI_A2A_DISPATCHER_GCICAP + #AI_A2A_GCICAP + +AI_A2A_GCICAP
-

AI_A2A_DISPATCHER_GCICAP class, extends AI#AIA2ADISPATCHER

+

AI_A2A_GCICAP class, extends AI#AIA2ADISPATCHER

Banner Image

-

The #AIA2ADISPATCHER class is designed to create an automatic air defence system for a coalition.

+

The AIA2AGCICAP class is designed to create an automatic air defence system for a coalition setting up GCI and CAP air defenses.

- +

The class derives from AI#AIA2ADISPATCHER and thus all the methods that are defined in this class, can be used also in AI_A2A_GCICAP.

Banner Image

-

It includes automatic spawning of Combat Air Patrol aircraft (CAP) and Ground Controlled Intercept aircraft (GCI) in response to enemy air movements that are detected by a ground based radar network. -CAP flights will take off and proceed to designated CAP zones where they will remain on station until the ground radars direct them to intercept detected enemy aircraft or they run short of fuel and must return to base (RTB). When a CAP flight leaves their zone to perform an interception or return to base a new CAP flight will spawn to take their place. +

AIA2AGCICAP includes automatic spawning of Combat Air Patrol aircraft (CAP) and Ground Controlled Intercept aircraft (GCI) in response to enemy +air movements that are detected by a ground based radar network. +CAP flights will take off and proceed to designated CAP zones where they will remain on station until the ground radars direct them to intercept +detected enemy aircraft or they run short of fuel and must return to base (RTB). +When a CAP flight leaves their zone to perform an interception or return to base a new CAP flight will spawn to take their place. If all CAP flights are engaged or RTB then additional GCI interceptors will scramble to intercept unengaged enemy aircraft under ground radar control. With a little time and with a little work it provides the mission designer with a convincing and completely automatic air defence system. In short it is a plug in very flexible and configurable air defence module for DCS World.

-

Note that in order to create a two way A2A defense system, two AI_A2A_DISPATCHER_GCICAP defense system may need to be created, for each coalition one. -This is a good implementation, because maybe in the future, more coalitions may become available in DCS world.

+

The AIA2AGCICAP provides a lightweight configuration method using the mission editor.

-

1. AI_A2A_DISPATCHER_GCICAP constructor:

-

The AIA2ADISPATCHER_GCICAP.New() method creates a new AI_A2A_DISPATCHER_GCICAP instance. -There are two parameters required, a list of prefix group names that collects the groups of the EWR network, and a radius in meters, -that will be used to group the detected targets.

+

1) Configure a working AI_A2A_GCICAP defense system for ONE coalition.

-

1.1. Define the EWR network:

+

1.1) Define which airbases are for which coalition.

-

As part of the AI_A2A_DISPATCHER_GCICAP constructor, a list of prefixes must be given of the group names defined within the mission editor, -that define the EWR network.

+

Color the airbases red or blue. You can do this by selecting the airbase on the map, and select the coalition blue or red.

-

An EWR network, or, Early Warning Radar network, is used to early detect potential airborne targets and to understand the position of patrolling targets of the enemy.

+

1.2) Place Groups given a name starting with a EWR prefix of your choice to build your EWR network.

-

Banner Image

+

All EWR groups starting with the EWR prefix (text) will be included in the detection system.

-

Typically EWR networks are setup using 55G6 EWR, 1L13 EWR, Hawk sr and Patriot str ground based radar units. +

An EWR network, or, Early Warning Radar network, is used to early detect potential airborne targets and to understand the position of patrolling targets of the enemy. +Typically EWR networks are setup using 55G6 EWR, 1L13 EWR, Hawk sr and Patriot str ground based radar units. These radars have different ranges and 55G6 EWR and 1L13 EWR radars are Eastern Bloc units (eg Russia, Ukraine, Georgia) while the Hawk and Patriot radars are Western (eg US). Additionally, ANY other radar capable unit can be part of the EWR network! Also AWACS airborne units, planes, helicopters can help to detect targets, as long as they have radar. The position of these units is very important as they need to provide enough coverage @@ -1212,29 +1223,87 @@ It all depends on what the desired effect is.

EWR networks are dynamically maintained. By defining in a smart way the names or name prefixes of the groups with EWR capable units, these groups will be automatically added or deleted from the EWR network, increasing or decreasing the radar coverage of the Early Warning System.

-

See the following example to setup an EWR network containing EWR stations and AWACS.

+

1.3) Place Airplane or Helicopter Groups with late activation switched on

-
-- Setup the A2A GCICAP dispatcher, and initialize it.
-A2ADispatcher = AI_A2A_DISPATCHER_GCICAP:New( { "DF CCCP AWACS", "DF CCCP EWR" }, 30000 )
-
+

These are templates, with a given name starting with a Template prefix above each airbase that you wanna have a squadron. +These templates need to be within 10km from the airbase center. They don't need to have a slot at the airplane, they can just be positioned above the airbase, +without a route, and should only have ONE unit.

-

The above example creates a new AIA2ADISPATCHER_GCICAP instance, and stores this in the variable (object) A2ADispatcher. -The first parameter is are the prefixes of the group names that define the EWR network. -The A2A dispatcher will filter all active groups with a group name starting with DF CCCP AWACS or DF CCCP EWR to be included in the EWR network.

+

1.4) Place floating helicopters to create the CAP zones.

-

1.2. Define the detected target grouping radius:

+

The helicopter indicates the start of the CAP zone. +The route points the form of the CAP zone polygon. +The place of the helicopter is important, as the airbase closest to the helicopter will be the airbase from where the CAP planes will take off for CAP.

-

As a second parameter of the AIA2ADISPATCHER_GCICAP.New() method, a radius in meters must be given. The radius indicates that detected targets need to be grouped within a radius of 30km. +

2) There are a lot of defaults set, which can be further modified using the methods in AI#AIA2ADISPATCHER:

+ +

2.1) Planes are taking off in the air from the airbases.

+ +

This prevents airbases to get cluttered with airplanes taking off, it also reduces the risk of human players colliding with taxiiing airplanes, +resulting in the airbase to halt operations.

+ +

2.2) Planes return near the airbase or will land if damaged.

+ +

When damaged airplanes return to the airbase, they will be routed and will dissapear in the air when they are near the airbase. +There are exceptions to this rule, airplanes that aren't "listening" anymore due to damage or out of fuel, will return to the airbase and land.

+ +

2.3) CAP operations setup for specific airbases, will be executed with the following parameters:

+ +
    +
  • The altitude will range between 6000 and 10000 meters.
  • +
  • The CAP speed will vary between 500 and 800 km/h.
  • +
  • The engage speed between 800 and 1200 km/h.
  • +
+ +

2.4) Each airbase will perform GCI when required, with the following parameters:

+ +
    +
  • The engage speed is between 800 and 1200 km/h.
  • +
+ +

2.5) Grouping or detected targets.

+ +

Detected targets are constantly re-grouped, that is, when certain detected aircraft are moving further than the group radius, then these aircraft will become a separate +group being detected.

+ +

Targets will be grouped within a radius of 30km by default.

+ +

The radius indicates that detected targets need to be grouped within a radius of 30km. The grouping radius should not be too small, but also depends on the types of planes and the era of the simulation. Fast planes like in the 80s, need a larger radius than WWII planes.
Typically I suggest to use 30000 for new generation planes and 10000 for older era aircraft.

-

Note that detected targets are constantly re-grouped, that is, when certain detected aircraft are moving further than the group radius, then these aircraft will become a separate -group being detected. This may result in additional GCI being started by the dispatcher! So don't make this value too small!

+

3) Additional notes:

-

2. AIA2ADISPATCHER_DOCUMENTATION is derived from #AIA2ADISPATCHER,

-

so all further documentation needs to be consulted in this class -for documentation consistency.

+

In order to create a two way A2A defense system, two AI_A2A_GCICAP defense systems must need to be created, for each coalition one. +Each defense system needs its own EWR network setup, airplane templates and CAP configurations.

+ +

This is a good implementation, because maybe in the future, more coalitions may become available in DCS world.

+ + + + +

4) Coding example how to use the AI_A2A_GCICAP class:

+ +
 -- Setup the AI_A2A_GCICAP dispatcher for one coalition, and initialize it.
+ GCI_Red = AI_A2A_GCICAP:New( "EWR CCCP", "SQUADRON CCCP", "CAP CCCP", 2 )
+
+ +

This will create a GCI/CAP system for the RED coalition, and stores the reference to the GCI/CAP system in the GCI\_Red variable! +In the mission editor, the following setup will have taken place:

+ +

Banner Image

+ +

The following parameters were given to the :New method of AIA2AGCICAP, and mean the following:

+ +
    +
  • EWR CCCP: Groups of the RED coalition are placed that define the EWR network. These groups start with the name EWR CCCP.
  • +
  • SQUADRON CCCP: Late activated Groups objects of the RED coalition are placed above the relevant airbases that will contain these templates in the squadron. + These late activated Groups start with the name SQUADRON CCCP. Each Group object contains only one Unit, and defines the weapon payload, skin and skill level.
  • +
  • CAP CCCP: CAP Zones are defined using floating, late activated Helicopter Group objects, where the route points define the route of the polygon of the CAP Zone. + These Helicopter Group objects start with the name CAP CCCP, and will be the locations wherein CAP will be performed.
  • +
  • 2 Defines how many CAP airplanes are patrolling in each CAP zone defined simulateneously.
  • +
@@ -3585,20 +3654,33 @@ Provide a value of true to display every 30 seconds a tactical

Type AI_A2A_DISPATCHER_GCICAP

- -

AIA2ADISPATCHER_GCICAP class.

- -

Field(s)

+ +

Type AI_A2A_GCICAP

+

Field(s)

- -AI_A2A_DISPATCHER_GCICAP:New(<, GroupingRadius, EWRPrefixes) + + +AI_A2A_GCICAP.CAPTemplates
-

AIA2ADISPATCHER_GCICAP constructor.

+ + +
+
+
+
+ + +AI_A2A_GCICAP:New(<, GroupingRadius, EWRPrefixes, TemplatePrefixes, CAPPrefixes, CapLimit, EngageRadius) + +
+
+ +

AIA2AGCICAP constructor.

Parameters

    @@ -3619,6 +3701,26 @@ For airplanes, 6000 (6km) is recommended, and is also the default value of this

    EWRPrefixes :

    + +
  • + +

    TemplatePrefixes :

    + +
  • +
  • + +

    CAPPrefixes :

    + +
  • +
  • + +

    CapLimit :

    + +
  • +
  • + +

    EngageRadius :

    +

Return value

@@ -3628,12 +3730,26 @@ For airplanes, 6000 (6km) is recommended, and is also the default value of this

Usage:

  
-  -- Set a new AI A2A Dispatcher object, based on an EWR network with a 30 km grouping radius
+  -- Set a new AI A2A GCICAP object, based on an EWR network with a 30 km grouping radius
   -- This for ground and awacs installations.
   
-  A2ADispatcher = AI_A2A_DISPATCHER_GCICAP:New( { "BlueEWRGroundRadars", "BlueEWRAwacs" }, 30000 )
+  A2ADispatcher = AI_A2A_GCICAP:New( { "BlueEWRGroundRadars", "BlueEWRAwacs" }, 30000 )
   
+
+
+
+
+ + + +AI_A2A_GCICAP.Templates + +
+
+ + +
diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html index d774a472f..0401d71f2 100644 --- a/docs/Documentation/Cargo.html +++ b/docs/Documentation/Cargo.html @@ -227,6 +227,48 @@ CARGO.Containable

This flag defines if the cargo can be contained within a DCS Unit.

+ + + + CARGO.Deployed + + + + + + CARGO:Destroy() + +

Destroy the cargo.

+ + + + CARGO:Flare(FlareColor) + +

Signal a flare at the position of the CARGO.

+ + + + CARGO:FlareGreen() + +

Signal a green flare at the position of the CARGO.

+ + + + CARGO:FlareRed() + +

Signal a red flare at the position of the CARGO.

+ + + + CARGO:FlareWhite() + +

Signal a white flare at the position of the CARGO.

+ + + + CARGO:FlareYellow() + +

Signal a yellow flare at the position of the CARGO.

@@ -263,6 +305,18 @@ CARGO:IsAlive()

Check if cargo is alive.

+ + + + CARGO:IsDeployed() + +

Is the cargo deployed

+ + + + CARGO:IsDestroyed() + +

Check if cargo is destroyed.

@@ -371,6 +425,12 @@ CARGO.Representable

This flag defines if the cargo can be represented by a DCS Unit.

+ + + + CARGO:SetDeployed(Deployed) + +

Set the cargo as deployed

@@ -383,6 +443,42 @@ CARGO.Slingloadable

This flag defines if the cargo can be slingloaded.

+ + + + CARGO:Smoke(SmokeColor, Range) + +

Smoke the CARGO.

+ + + + CARGO:SmokeBlue() + +

Smoke the CARGO Blue.

+ + + + CARGO:SmokeGreen() + +

Smoke the CARGO Green.

+ + + + CARGO:SmokeOrange() + +

Smoke the CARGO Orange.

+ + + + CARGO:SmokeRed() + +

Smoke the CARGO Red.

+ + + + CARGO:SmokeWhite() + +

Smoke the CARGO White.

@@ -447,6 +543,12 @@ CARGO_GROUP.CargoCarrier + + + + CARGO_GROUP.CargoGroup + + @@ -456,15 +558,27 @@ - CARGO_GROUP.CargoSet + CARGO_GROUP:GetCount() - +

Get the amount of cargo units in the group.

CARGO_GROUP:New(CargoGroup, Type, Name, ReportRadius, NearRadius)

CARGO_GROUP constructor.

+ + + + CARGO_GROUP.OnEventCargoDead(Cargo, EventData, self) + + + + + + CARGO_GROUP:RespawnOnDestroyed(RespawnDestroyed) + +

Respawn the cargo when destroyed

@@ -483,6 +597,12 @@ CARGO_GROUP:onenterBoarding(CargoCarrier, Event, From, To, NearRadius, ...)

Enter Boarding State.

+ + + + CARGO_GROUP:onenterDestroyed() + + @@ -587,6 +707,12 @@ CARGO_REPORTABLE.CargoObject + + + + CARGO_REPORTABLE.CargoSet + + @@ -623,6 +749,12 @@ CARGO_REPORTABLE.ReportRadius + + + + CARGO_REPORTABLE:Respawn() + +

Respawn the cargo.

@@ -941,7 +1073,7 @@ The radius when the cargo will board the Carrier (to avoid collision).

- Wrapper.Controllable#CONTROLLABLE + Wrapper.Client#CLIENT CARGO.CargoCarrier @@ -992,6 +1124,106 @@ The radius when the cargo will board the Carrier (to avoid collision).

This flag defines if the cargo can be contained within a DCS Unit.

+ +
+
+
+ + + +CARGO.Deployed + +
+
+ + + +
+
+
+
+ + +CARGO:Destroy() + +
+
+ +

Destroy the cargo.

+ +
+
+
+
+ + +CARGO:Flare(FlareColor) + +
+
+ +

Signal a flare at the position of the CARGO.

+ +

Parameter

+ +
+
+
+
+ + +CARGO:FlareGreen() + +
+
+ +

Signal a green flare at the position of the CARGO.

+ +
+
+
+
+ + +CARGO:FlareRed() + +
+
+ +

Signal a red flare at the position of the CARGO.

+ +
+
+
+
+ + +CARGO:FlareWhite() + +
+
+ +

Signal a white flare at the position of the CARGO.

+ +
+
+
+
+ + +CARGO:FlareYellow() + +
+
+ +

Signal a yellow flare at the position of the CARGO.

+
@@ -1105,6 +1337,42 @@ true if unloaded

+ +CARGO:IsDeployed() + +
+
+ +

Is the cargo deployed

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CARGO:IsDestroyed() + +
+
+ +

Check if cargo is destroyed.

+ +

Return value

+ +

#boolean: +true if destroyed

+ +
+
+
+
+ CARGO:IsInZone(Zone) @@ -1520,6 +1788,27 @@ The radius when the cargo will board the Carrier (to avoid collision).

+ +CARGO:SetDeployed(Deployed) + +
+
+ +

Set the cargo as deployed

+ +

Parameter

+
    +
  • + +

    Deployed :

    + +
  • +
+
+
+
+
+ CARGO:SetWeight(Weight) @@ -1561,6 +1850,97 @@ The weight in kg.

+ +CARGO:Smoke(SmokeColor, Range) + +
+
+ +

Smoke the CARGO.

+ +

Parameters

+
    +
  • + +

    SmokeColor :

    + +
  • +
  • + +

    Range :

    + +
  • +
+
+
+
+
+ + +CARGO:SmokeBlue() + +
+
+ +

Smoke the CARGO Blue.

+ +
+
+
+
+ + +CARGO:SmokeGreen() + +
+
+ +

Smoke the CARGO Green.

+ +
+
+
+
+ + +CARGO:SmokeOrange() + +
+
+ +

Smoke the CARGO Orange.

+ +
+
+
+
+ + +CARGO:SmokeRed() + +
+
+ +

Smoke the CARGO Red.

+ +
+
+
+
+ + +CARGO:SmokeWhite() + +
+
+ +

Smoke the CARGO White.

+ +
+
+
+
+ CARGO:Spawn(PointVec2) @@ -1815,6 +2195,23 @@ The amount of seconds to delay the action.

+ +

self.CargoObject:Destroy()

+ + +
+
+
+ + + +CARGO_GROUP.CargoGroup + +
+
+ + +
@@ -1834,13 +2231,17 @@ The amount of seconds to delay the action.

- - -CARGO_GROUP.CargoSet + +CARGO_GROUP:GetCount()
+

Get the amount of cargo units in the group.

+ +

Return value

+ +

#CARGO_GROUP:

@@ -1896,6 +2297,58 @@ The amount of seconds to delay the action.

+ +CARGO_GROUP.OnEventCargoDead(Cargo, EventData, self) + +
+
+ + + +

Parameters

+ +
+
+
+
+ + +CARGO_GROUP:RespawnOnDestroyed(RespawnDestroyed) + +
+
+ +

Respawn the cargo when destroyed

+ +

Parameter

+
    +
  • + +

    #boolean RespawnDestroyed :

    + +
  • +
+
+
+
+
+ CARGO_GROUP:onafterBoarding(CargoCarrier, Event, From, To, NearRadius, ...) @@ -2029,6 +2482,19 @@ The amount of seconds to delay the action.

+ +
+
+
+ + +CARGO_GROUP:onenterDestroyed() + +
+
+ + +
@@ -2667,6 +3133,20 @@ The UNIT carrying the package.

+ +
+
+
+ + Core.Set#SET_CARGO + +CARGO_REPORTABLE.CargoSet + +
+
+ + +
@@ -2823,6 +3303,19 @@ The range till cargo will board.

+ +
+
+
+ + +CARGO_REPORTABLE:Respawn() + +
+
+ +

Respawn the cargo.

+
@@ -3410,8 +3903,6 @@ Point#POINT_VEC2

-

Type COMMANDCENTER

-

Type sring

diff --git a/docs/Documentation/Database.html b/docs/Documentation/Database.html index 85a5a5865..38a7a8f78 100644 --- a/docs/Documentation/Database.html +++ b/docs/Documentation/Database.html @@ -280,7 +280,7 @@ The following iterator methods are currently available within the DATABASE:

DATABASE:FindAirbase(AirbaseName) -

Finds an AIRBASE based on the AirbaseName.

+

Finds a AIRBASE based on the AirbaseName.

@@ -1021,7 +1021,7 @@ The name of the airbase

-

Finds an AIRBASE based on the AirbaseName.

+

Finds a AIRBASE based on the AirbaseName.

Parameter

    diff --git a/docs/Documentation/Designate.html b/docs/Documentation/Designate.html index c0c7ee573..70e3562df 100644 --- a/docs/Documentation/Designate.html +++ b/docs/Documentation/Designate.html @@ -900,6 +900,7 @@ function below will use the range 1-7 just in case

    + DESIGNATE.LaserCodes diff --git a/docs/Documentation/Movement.html b/docs/Documentation/Movement.html index 4307c3aaa..be5ce073c 100644 --- a/docs/Documentation/Movement.html +++ b/docs/Documentation/Movement.html @@ -227,6 +227,7 @@ on defined intervals (currently every minute).

    + #number MOVEMENT.AliveUnits @@ -235,6 +236,9 @@ on defined intervals (currently every minute).

    + +

    Contains the counter how many units are currently alive

    +
diff --git a/docs/Documentation/Positionable.html b/docs/Documentation/Positionable.html index b2012f1a1..82d94f58f 100644 --- a/docs/Documentation/Positionable.html +++ b/docs/Documentation/Positionable.html @@ -146,6 +146,54 @@

Type POSITIONABLE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -298,7 +352,7 @@ @@ -356,15 +410,67 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
POSITIONABLE:AddCargo(Cargo) +

Add cargo.

+
POSITIONABLE:CargoItemCount() +

Get cargo item count.

+
POSITIONABLE:ClearCargo() +

Clear all cargo.

+
POSITIONABLE:Flare(FlareColor) +

Signal a flare at the position of the POSITIONABLE.

+
POSITIONABLE:FlareGreen() +

Signal a green flare at the position of the POSITIONABLE.

+
POSITIONABLE:FlareRed() +

Signal a red flare at the position of the POSITIONABLE.

+
POSITIONABLE:FlareWhite() +

Signal a white flare at the position of the POSITIONABLE.

+
POSITIONABLE:FlareYellow() +

Signal a yellow flare at the position of the POSITIONABLE.

+
POSITIONABLE:GetAltitude()

Returns the altitude of the POSITIONABLE.

@@ -263,6 +311,12 @@
POSITIONABLE:GetVelocityMPS()

Returns the POSITIONABLE velocity in meters per second.

+
POSITIONABLE:HasCargo(Cargo) +

Returns if carrier has given cargo.

POSITIONABLE.LaserCode -

The last assigned laser code.

+
POSITIONABLE.PositionableNamePOSITIONABLE:RemoveCargo(Cargo) -

The name of the measurable.

+

Remove cargo.

+
POSITIONABLE:Smoke(SmokeColor, Range) +

Smoke the POSITIONABLE.

+
POSITIONABLE:SmokeBlue() +

Smoke the POSITIONABLE Blue.

+
POSITIONABLE:SmokeGreen() +

Smoke the POSITIONABLE Green.

+
POSITIONABLE:SmokeOrange() +

Smoke the POSITIONABLE Orange.

+
POSITIONABLE:SmokeRed() +

Smoke the POSITIONABLE Red.

+
POSITIONABLE:SmokeWhite() +

Smoke the POSITIONABLE White.

POSITIONABLE.Spot -

The laser Spot.

+ +
POSITIONABLE.__ + +
+ +

Type POSITIONABLE.__

+ + + +
POSITIONABLE.__.Cargo +
@@ -438,10 +544,137 @@ The method POSITIONABLE.GetVelocity()

Type POSITIONABLE

- -

The POSITIONABLE class

+

Field(s)

+
+
-

Field(s)

+ +POSITIONABLE:AddCargo(Cargo) + +
+
+ +

Add cargo.

+ +

Parameter

+ +

Return value

+ +

#POSITIONABLE:

+ + +
+
+
+
+ + +POSITIONABLE:CargoItemCount() + +
+
+ +

Get cargo item count.

+ +

Return value

+ +

Core.Cargo#CARGO: +Cargo

+ +
+
+
+
+ + +POSITIONABLE:ClearCargo() + +
+
+ +

Clear all cargo.

+ +
+
+
+
+ + +POSITIONABLE:Flare(FlareColor) + +
+
+ +

Signal a flare at the position of the POSITIONABLE.

+ +

Parameter

+ +
+
+
+
+ + +POSITIONABLE:FlareGreen() + +
+
+ +

Signal a green flare at the position of the POSITIONABLE.

+ +
+
+
+
+ + +POSITIONABLE:FlareRed() + +
+
+ +

Signal a red flare at the position of the POSITIONABLE.

+ +
+
+
+
+ + +POSITIONABLE:FlareWhite() + +
+
+ +

Signal a white flare at the position of the POSITIONABLE.

+ +
+
+
+
+ + +POSITIONABLE:FlareYellow() + +
+
+ +

Signal a yellow flare at the position of the POSITIONABLE.

+ +
+
@@ -976,6 +1209,32 @@ The velocity in meters per second.

+ +POSITIONABLE:HasCargo(Cargo) + +
+
+ +

Returns if carrier has given cargo.

+ +

Parameter

+
    +
  • + +

    Cargo :

    + +
  • +
+

Return value

+ +

Core.Cargo#CARGO: +Cargo

+ +
+
+
+
+ POSITIONABLE:InAir() @@ -1107,14 +1366,14 @@ true if it is lasing a target

- #number + POSITIONABLE.LaserCode
-

The last assigned laser code.

+
@@ -1462,14 +1721,117 @@ self

- #string - -POSITIONABLE.PositionableName + +POSITIONABLE:RemoveCargo(Cargo)
-

The name of the measurable.

+

Remove cargo.

+ +

Parameter

+ +

Return value

+ +

#POSITIONABLE:

+ + +
+
+
+
+ + +POSITIONABLE:Smoke(SmokeColor, Range) + +
+
+ +

Smoke the POSITIONABLE.

+ +

Parameters

+
    +
  • + +

    SmokeColor :

    + +
  • +
  • + +

    Range :

    + +
  • +
+
+
+
+
+ + +POSITIONABLE:SmokeBlue() + +
+
+ +

Smoke the POSITIONABLE Blue.

+ +
+
+
+
+ + +POSITIONABLE:SmokeGreen() + +
+
+ +

Smoke the POSITIONABLE Green.

+ +
+
+
+
+ + +POSITIONABLE:SmokeOrange() + +
+
+ +

Smoke the POSITIONABLE Orange.

+ +
+
+
+
+ + +POSITIONABLE:SmokeRed() + +
+
+ +

Smoke the POSITIONABLE Red.

+ +
+
+
+
+ + +POSITIONABLE:SmokeWhite() + +
+
+ +

Smoke the POSITIONABLE White.

@@ -1483,11 +1845,44 @@ self

-

The laser Spot.

+ + +
+
+
+
+ + #POSITIONABLE.__ + +POSITIONABLE.__ + +
+
+ +
+

Type POSITIONABLE.__

+

Field(s)

+
+
+ + #POSITIONABLE.__.Cargo + +POSITIONABLE.__.Cargo + +
+
+ + + +
+
+ +

Type POSITIONABLE.__.Cargo

+

Type RADIO

diff --git a/docs/Documentation/Set.html b/docs/Documentation/Set.html index cde3e33b5..e0ef0a7bc 100644 --- a/docs/Documentation/Set.html +++ b/docs/Documentation/Set.html @@ -2957,8 +2957,8 @@ self

Return value

-

#SET_CARGO: -self

+

#SET_CARGO:

+

Usage:

-- Define a new SET_CARGO Object. The DatabaseSet will contain a reference to all Cargos.
diff --git a/docs/Documentation/Settings.html b/docs/Documentation/Settings.html
index 7dca37cbf..b101bcee0 100644
--- a/docs/Documentation/Settings.html
+++ b/docs/Documentation/Settings.html
@@ -148,7 +148,7 @@
 			

Type SETTINGS

- + @@ -160,7 +160,7 @@ - + @@ -169,12 +169,6 @@ - - - - @@ -196,7 +190,7 @@ - + @@ -208,7 +202,7 @@ - + @@ -292,31 +286,25 @@ - + - + - + - - - - - + @@ -325,12 +313,6 @@ - - - - @@ -352,7 +334,7 @@ - + @@ -364,7 +346,7 @@ - + @@ -418,13 +400,7 @@ - - - - - + @@ -455,17 +431,27 @@
-SETTINGS:A2AMenuSystem(A2ASystem) +SETTINGS:A2AMenuSystem(MenuGroup, RootMenu, A2ASystem)
-

Parameter

+

Parameters

+ + + +
SETTINGS:A2AMenuSystem(A2ASystem)SETTINGS:A2AMenuSystem(MenuGroup, RootMenu, A2ASystem)
SETTINGS:A2GMenuSystem(A2GSystem)SETTINGS:A2GMenuSystem(MenuGroup, RootMenu, A2GSystem) SETTINGS.A2GSystem -
SETTINGS.DefaultMenu -
SETTINGS:IsA2A_BRA()SETTINGS:IsA2A_BRAA()

Is BRA

SETTINGS:IsA2G_BRA()SETTINGS:IsA2G_BR()

Is BRA

SETTINGS:MenuLL_Accuracy(LL_Accuracy)SETTINGS:MenuLL_Accuracy(MenuGroup, RootMenu, LL_Accuracy)
SETTINGS:MenuLL_DMS(LL_DMS)SETTINGS:MenuLL_DMS(MenuGroup, RootMenu, LL_DMS)
SETTINGS:MenuMGRS_Accuracy(MGRS_Accuracy)SETTINGS:MenuMGRS_Accuracy(MenuGroup, RootMenu, MGRS_Accuracy)
SETTINGS:MenuMWSystem(MW) - -
SETTINGS.MenuTextSETTINGS:MenuMWSystem(MenuGroup, RootMenu, MW) SETTINGS.Metric -
SETTINGS.Metrics -
SETTINGS:SetA2A_BRA()SETTINGS:SetA2A_BRAA()

Sets A2A BRA

SETTINGS:SetA2G_BRA()SETTINGS:SetA2G_BR()

Sets A2G BRA

SETTINGS:SetSystemMenu(RootMenu, MenuText) - -
SETTINGS.SettingsMenuSETTINGS:SetSystemMenu(MenuGroup, RootMenu) SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) +
SPAWN.uncontrolled +
@@ -2726,9 +2732,6 @@ when nothing was spawned.

- -

Overwrite unit names by default with group name.

-
@@ -3147,7 +3150,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 ) -

Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.

+

When the first Spawn executes, all the Groups need to be made visible before start.

@@ -3727,6 +3730,20 @@ True = Continue Scheduler

+ +
+
+
+ + + +SPAWN.uncontrolled + +
+
+ + +
diff --git a/docs/Documentation/SpawnStatic.html b/docs/Documentation/SpawnStatic.html index bc91b9624..d8aa5e633 100644 --- a/docs/Documentation/SpawnStatic.html +++ b/docs/Documentation/SpawnStatic.html @@ -436,6 +436,7 @@ ptional) The name of the new static.

+ #number SPAWNSTATIC.SpawnIndex diff --git a/docs/Documentation/Spot.html b/docs/Documentation/Spot.html index ead3792db..5fdc3b305 100644 --- a/docs/Documentation/Spot.html +++ b/docs/Documentation/Spot.html @@ -765,6 +765,7 @@ true if it is lasing

+ SPOT.ScheduleID @@ -778,6 +779,7 @@ true if it is lasing

+ SPOT.SpotIR @@ -791,6 +793,7 @@ true if it is lasing

+ SPOT.SpotLaser @@ -804,6 +807,7 @@ true if it is lasing

+ SPOT.Target diff --git a/docs/Documentation/Task_A2A.html b/docs/Documentation/Task_A2A.html index 5cc0a0d9d..a4ca3be69 100644 --- a/docs/Documentation/Task_A2A.html +++ b/docs/Documentation/Task_A2A.html @@ -244,6 +244,12 @@ based on the tasking capabilities defined in Task#TA TASK_A2A_ENGAGE:New(Mission, SetGroup, TaskName, TargetSetUnit, TaskBriefing)

Instantiates a new TASKA2AENGAGE.

+ + + + TASK_A2A_ENGAGE:ReportOrder(ReportGroup) + + @@ -284,6 +290,12 @@ based on the tasking capabilities defined in Task#TA TASK_A2A_INTERCEPT:New(Mission, SetGroup, TaskName, TargetSetUnit, TaskBriefing)

Instantiates a new TASKA2AINTERCEPT.

+ + + + TASK_A2A_INTERCEPT:ReportOrder(ReportGroup) + + @@ -324,6 +336,12 @@ based on the tasking capabilities defined in Task#TA TASK_A2A_SWEEP:New(Mission, SetGroup, TaskName, TargetSetUnit, TaskBriefing)

Instantiates a new TASKA2ASWEEP.

+ + + + TASK_A2A_SWEEP:ReportOrder(ReportGroup) + + @@ -907,6 +925,27 @@ self

+ +TASK_A2A_ENGAGE:ReportOrder(ReportGroup) + +
+
+ + + +

Parameter

+
    +
  • + +

    ReportGroup :

    + +
  • +
+
+
+
+
+ TASK_A2A_ENGAGE:SetScoreOnFail(PlayerName, Penalty, TaskUnit) @@ -1126,6 +1165,27 @@ The briefing of the task.

+ +TASK_A2A_INTERCEPT:ReportOrder(ReportGroup) + +
+
+ + + +

Parameter

+ +
+
+
+
+ TASK_A2A_INTERCEPT:SetScoreOnFail(PlayerName, Penalty, TaskUnit) @@ -1345,6 +1405,27 @@ self

+ +TASK_A2A_SWEEP:ReportOrder(ReportGroup) + +
+
+ + + +

Parameter

+
    +
  • + +

    ReportGroup :

    + +
  • +
+
+
+
+
+ TASK_A2A_SWEEP:SetScoreOnFail(PlayerName, Penalty, TaskUnit) diff --git a/docs/Documentation/Task_A2G.html b/docs/Documentation/Task_A2G.html index 058ae5687..c1a63b897 100644 --- a/docs/Documentation/Task_A2G.html +++ b/docs/Documentation/Task_A2G.html @@ -244,24 +244,30 @@ based on the tasking capabilities defined in Task#TA TASK_A2G_BAI:New(Mission, SetGroup, TaskName, TargetSetUnit, TaskBriefing)

Instantiates a new TASKA2GBAI.

+ + + + TASK_A2G_BAI:ReportOrder(ReportGroup) + + TASK_A2G_BAI:SetScoreOnFail(PlayerName, Penalty, TaskUnit) -

Set a penalty when the A2A attack has failed.

+

Set a penalty when the A2G attack has failed.

TASK_A2G_BAI:SetScoreOnProgress(PlayerName, Score, TaskUnit) -

Set a score when a target in scope of the A2A attack, has been destroyed .

+

Set a score when a target in scope of the A2G attack, has been destroyed .

TASK_A2G_BAI:SetScoreOnSuccess(PlayerName, Score, TaskUnit) -

Set a score when all the targets in scope of the A2A attack, have been destroyed.

+

Set a score when all the targets in scope of the A2G attack, have been destroyed.

@@ -284,24 +290,30 @@ based on the tasking capabilities defined in Task#TA TASK_A2G_CAS:New(Mission, SetGroup, TaskName, TargetSetUnit, TaskBriefing)

Instantiates a new TASKA2GCAS.

+ + + + TASK_A2G_CAS:ReportOrder(ReportGroup) + + TASK_A2G_CAS:SetScoreOnFail(PlayerName, Penalty, TaskUnit) -

Set a penalty when the A2A attack has failed.

+

Set a penalty when the A2G attack has failed.

TASK_A2G_CAS:SetScoreOnProgress(PlayerName, Score, TaskUnit) -

Set a score when a target in scope of the A2A attack, has been destroyed .

+

Set a score when a target in scope of the A2G attack, has been destroyed .

TASK_A2G_CAS:SetScoreOnSuccess(PlayerName, Score, TaskUnit) -

Set a score when all the targets in scope of the A2A attack, have been destroyed.

+

Set a score when all the targets in scope of the A2G attack, have been destroyed.

@@ -324,24 +336,30 @@ based on the tasking capabilities defined in Task#TA TASK_A2G_SEAD:New(Mission, SetGroup, TaskName, TargetSetUnit, TaskBriefing)

Instantiates a new TASKA2GSEAD.

+ + + + TASK_A2G_SEAD:ReportOrder(ReportGroup) + + TASK_A2G_SEAD:SetScoreOnFail(PlayerName, Penalty, TaskUnit) -

Set a penalty when the A2A attack has failed.

+

Set a penalty when the A2G attack has failed.

TASK_A2G_SEAD:SetScoreOnProgress(PlayerName, Score, TaskUnit) -

Set a score when a target in scope of the A2A attack, has been destroyed .

+

Set a score when a target in scope of the A2G attack, has been destroyed .

TASK_A2G_SEAD:SetScoreOnSuccess(PlayerName, Score, TaskUnit) -

Set a score when all the targets in scope of the A2A attack, have been destroyed.

+

Set a score when all the targets in scope of the A2G attack, have been destroyed.

@@ -887,13 +905,34 @@ self

+ +TASK_A2G_BAI:ReportOrder(ReportGroup) + +
+
+ + + +

Parameter

+
    +
  • + +

    ReportGroup :

    + +
  • +
+
+
+
+
+ TASK_A2G_BAI:SetScoreOnFail(PlayerName, Penalty, TaskUnit)
-

Set a penalty when the A2A attack has failed.

+

Set a penalty when the A2G attack has failed.

Parameters

    @@ -931,7 +970,7 @@ The penalty in points, must be a negative value!

-

Set a score when a target in scope of the A2A attack, has been destroyed .

+

Set a score when a target in scope of the A2G attack, has been destroyed .

Parameters

    @@ -969,7 +1008,7 @@ The score in points to be granted when task process has been achieved.

-

Set a score when all the targets in scope of the A2A attack, have been destroyed.

+

Set a score when all the targets in scope of the A2G attack, have been destroyed.

Parameters

-

Set a score when a target in scope of the A2A attack, has been destroyed .

+

Set a score when a target in scope of the A2G attack, has been destroyed .

Parameters

    @@ -1188,7 +1248,7 @@ The score in points to be granted when task process has been achieved.

-

Set a score when all the targets in scope of the A2A attack, have been destroyed.

+

Set a score when all the targets in scope of the A2G attack, have been destroyed.

Parameters

-

Set a score when a target in scope of the A2A attack, has been destroyed .

+

Set a score when a target in scope of the A2G attack, has been destroyed .

Parameters

    @@ -1407,7 +1488,7 @@ The score in points to be granted when task process has been achieved.

-

Set a score when all the targets in scope of the A2A attack, have been destroyed.

+

Set a score when all the targets in scope of the A2G attack, have been destroyed.

Parameters

+
+
+
+ + + +TASK_CARGO.CargoItemCount + +
+
+ + + + +

Map of Carriers having a cargo item count to check the cargo loading limits.

+ +
+
+
+
+ + + +TASK_CARGO.CargoLimit + +
+
+ + +
@@ -807,6 +861,33 @@ self

+ +
+
+
+ + +TASK_CARGO:SetCargoLimit(CargoLimit) + +
+
+ +

Set a limit on the amount of cargo items that can be loaded into the Carriers.

+ +

Parameter

+
    +
  • + +

    CargoLimit : +Specifies a number of cargo items that can be loaded in the helicopter.

    + +
  • +
+

Return value

+ +

#TASK_CARGO:

+ +
@@ -1455,6 +1536,27 @@ Return false to cancel Transition.

+ +TASK_CARGO_TRANSPORT:ReportOrder(ReportGroup) + +
+
+ + + +

Parameter

+
    +
  • + +

    ReportGroup :

    + +
  • +
+
+
+
+
+ TASK_CARGO_TRANSPORT:__CargoDeployed(Delay, TaskUnit, Cargo, DeployZone) diff --git a/docs/Documentation/Unit.html b/docs/Documentation/Unit.html index 975b845d9..be295ced4 100644 --- a/docs/Documentation/Unit.html +++ b/docs/Documentation/Unit.html @@ -152,36 +152,6 @@ UNIT:FindByName(UnitName)

Find a UNIT in the _DATABASE using the name of an existing DCS Unit.

- - - - UNIT:Flare(FlareColor) - -

Signal a flare at the position of the UNIT.

- - - - UNIT:FlareGreen() - -

Signal a green flare at the position of the UNIT.

- - - - UNIT:FlareRed() - -

Signal a red flare at the position of the UNIT.

- - - - UNIT:FlareWhite() - -

Signal a white flare at the position of the UNIT.

- - - - UNIT:FlareYellow() - -

Signal a yellow flare at the position of the UNIT.

@@ -390,42 +360,6 @@ UNIT:ResetEvents()

Reset the subscriptions.

- - - - UNIT:Smoke(SmokeColor, Range) - -

Smoke the UNIT.

- - - - UNIT:SmokeBlue() - -

Smoke the UNIT Blue.

- - - - UNIT:SmokeGreen() - -

Smoke the UNIT Green.

- - - - UNIT:SmokeOrange() - -

Smoke the UNIT Orange.

- - - - UNIT:SmokeRed() - -

Smoke the UNIT Red.

- - - - UNIT:SmokeWhite() - -

Smoke the UNIT White.

@@ -609,79 +543,6 @@ self

- -UNIT:Flare(FlareColor) - -
-
- -

Signal a flare at the position of the UNIT.

- -

Parameter

- -
-
-
-
- - -UNIT:FlareGreen() - -
-
- -

Signal a green flare at the position of the UNIT.

- -
-
-
-
- - -UNIT:FlareRed() - -
-
- -

Signal a red flare at the position of the UNIT.

- -
-
-
-
- - -UNIT:FlareWhite() - -
-
- -

Signal a white flare at the position of the UNIT.

- -
-
-
-
- - -UNIT:FlareYellow() - -
-
- -

Signal a yellow flare at the position of the UNIT.

- -
-
-
-
- UNIT:GetAmmo() @@ -1631,97 +1492,6 @@ The name of the DCS unit.

#UNIT:

- -
-
-
- - -UNIT:Smoke(SmokeColor, Range) - -
-
- -

Smoke the UNIT.

- -

Parameters

-
    -
  • - -

    SmokeColor :

    - -
  • -
  • - -

    Range :

    - -
  • -
-
-
-
-
- - -UNIT:SmokeBlue() - -
-
- -

Smoke the UNIT Blue.

- -
-
-
-
- - -UNIT:SmokeGreen() - -
-
- -

Smoke the UNIT Green.

- -
-
-
-
- - -UNIT:SmokeOrange() - -
-
- -

Smoke the UNIT Orange.

- -
-
-
-
- - -UNIT:SmokeRed() - -
-
- -

Smoke the UNIT Red.

- -
-
-
-
- - -UNIT:SmokeWhite() - -
-
- -

Smoke the UNIT White.

-