From e32b57d6b380af65df7b0c93910d9d10de52f7ac Mon Sep 17 00:00:00 2001 From: kaltokri Date: Mon, 1 Jan 2024 19:37:48 +0100 Subject: [PATCH] New folder structure --- .../CAP-100 - AI_A2A_CAP - Normal CAP.lua | 50 +- .../CAP-100 - AI_A2A_CAP - Normal CAP.miz | Bin .../Moose.lua | 0 ...-001 - BAI in a Zone by Airplane Group.lua | 148 ++--- ...-001 - BAI in a Zone by Airplane Group.miz | Bin .../Moose.lua | 0 ... by Airplane Group - Engage with Speed.lua | 150 ++--- ... by Airplane Group - Engage with Speed.miz | Bin .../Moose.lua | 0 ... a Zone by Airplane Group - Test Abort.lua | 162 ++--- ... a Zone by Airplane Group - Test Abort.miz | Bin .../Moose.lua | 0 ...plane Group - Engage with WeaponExpend.lua | 156 ++--- ...plane Group - Engage with WeaponExpend.miz | Bin .../Moose.lua | 0 .../BAI-100 - BAI of a Bridge.lua | 152 ++--- .../BAI-100 - BAI of a Bridge.miz | Bin .../BAI-100 - BAI of a Bridge/Moose.lua | 0 .../CAP-001 - Combat Air Patrol.lua | 46 +- .../CAP-001 - Combat Air Patrol.miz | Bin .../CAP-001 - Combat Air Patrol/Moose.lua | 0 .../CAP-010 - CAP and Engage within Range.lua | 54 +- .../CAP-010 - CAP and Engage within Range.miz | Bin .../Moose.lua | 0 .../CAP-010 - CAP and Engage within Zone.lua | 46 +- .../CAP-011 - CAP and Engage within Zone.lua | 64 +- .../CAP-011 - CAP and Engage within Zone.miz | Bin .../Moose.lua | 0 .../CAP-012 - CAP - Test Abort.lua | 86 +-- .../CAP-012 - CAP - Test Abort.miz | Bin .../CAP-012 - CAP - Test Abort/Moose.lua | 0 .../CAP-020 - Combat Air Patrol RTB Test.lua | 54 +- .../CAP-020 - Combat Air Patrol RTB Test.miz | Bin .../Moose.lua | 0 ...-001 - CAS in a Zone by Airplane Group.lua | 148 ++--- ...-001 - CAS in a Zone by Airplane Group.miz | Bin .../Moose.lua | 0 ... by Airplane Group - Engage with Speed.lua | 150 ++--- ... by Airplane Group - Engage with Speed.miz | Bin .../Moose.lua | 0 ...Group - Engage with Speed and Altitude.lua | 152 ++--- ...Group - Engage with Speed and Altitude.miz | Bin .../Moose.lua | 0 ... a Zone by Airplane Group - Test Abort.lua | 162 ++--- ... a Zone by Airplane Group - Test Abort.miz | Bin .../Moose.lua | 0 ...plane Group - Engage with WeaponExpend.lua | 156 ++--- ...plane Group - Engage with WeaponExpend.miz | Bin .../Moose.lua | 0 .../CAS-010 - CAS in a Zone by Helicopter.lua | 152 ++--- .../CAS-010 - CAS in a Zone by Helicopter.miz | Bin .../Moose.lua | 0 ...11 - CAS in a Zone by Helicopter Group.lua | 150 ++--- ...11 - CAS in a Zone by Helicopter Group.miz | Bin .../Moose.lua | 0 ...Zone by Helicopter and AirPlane Groups.lua | 182 +++--- ...Zone by Helicopter and AirPlane Groups.miz | Bin .../Moose.lua | 0 ...-112 - Moose Detection and AI_CAS_ZONE.lua | 596 +++++++++--------- ...-112 - Moose Detection and AI_CAS_ZONE.miz | Bin .../Moose.lua | 0 .../AmmoTruck 100 - NTTR - Basic.lua | 114 ++-- .../AmmoTruck 100 - NTTR - Basic.miz | Bin .../AmmoTruck 100 - NTTR - Basic}/Moose.lua | 0 64 files changed, 1565 insertions(+), 1565 deletions(-) rename {CAP - Combat Air Patrol => AI/AI_A2A_Cap}/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua (95%) rename {CAP - Combat Air Patrol => AI/AI_A2A_Cap}/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz (100%) rename {AMT - AmmoTruck/AmmoTruck 100 - NTTR - Basic => AI/AI_A2A_Cap/CAP-100 - AI_A2A_CAP - Normal CAP}/Moose.lua (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua (97%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-001 - BAI in a Zone by Airplane Group/Moose.lua (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua (97%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/Moose.lua (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua (97%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/Moose.lua (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua (97%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua (97%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz (100%) rename {BAI - Battlefield Air Interdiction => AI/AI_BAI}/BAI-100 - BAI of a Bridge/Moose.lua (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua (96%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-001 - Combat Air Patrol/Moose.lua (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua (97%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-010 - CAP and Engage within Range/Moose.lua (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua (96%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua (97%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-011 - CAP and Engage within Zone/Moose.lua (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua (97%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-012 - CAP - Test Abort/Moose.lua (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua (96%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz (100%) rename {CAP - Combat Air Patrol => AI/AI_CAP}/CAP-020 - Combat Air Patrol RTB Test/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua (97%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz (100%) rename {CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP => AI/AI_CAS/CAS-001 - CAS in a Zone by Airplane Group}/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua (97%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz (100%) rename {CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group => AI/AI_CAS/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed}/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua (97%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz (100%) rename {CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed => AI/AI_CAS/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude}/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua (97%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz (100%) rename {CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude => AI/AI_CAS/CAS-004 - CAS in a Zone by Airplane Group - Test Abort}/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua (97%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz (100%) rename {CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort => AI/AI_CAS/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend}/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua (97%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz (100%) rename {CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend => AI/AI_CAS/CAS-010 - CAS in a Zone by Helicopter}/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua (97%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz (100%) rename {CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter => AI/AI_CAS/CAS-011 - CAS in a Zone by Helicopter Group}/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua (98%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz (100%) rename {CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group => AI/AI_CAS/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups}/Moose.lua (100%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.lua (97%) rename {CAS - Close Air Support => AI/AI_CAS}/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.miz (100%) rename {CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups => AI/AI_CAS/CAS-112 - Moose Detection and AI_CAS_ZONE}/Moose.lua (100%) rename {AMT - AmmoTruck => Functional/AmmoTruck}/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.lua (97%) rename {AMT - AmmoTruck => Functional/AmmoTruck}/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.miz (100%) rename {CAS - Close Air Support/CAS-112 - Moose Detection and AI_CAS_ZONE => Functional/AmmoTruck/AmmoTruck 100 - NTTR - Basic}/Moose.lua (100%) diff --git a/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua b/AI/AI_A2A_Cap/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua similarity index 95% rename from CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua rename to AI/AI_A2A_Cap/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua index 926acdfda2..7b5db069a6 100644 --- a/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua +++ b/AI/AI_A2A_Cap/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.lua @@ -1,26 +1,26 @@ ---- --- Name: CAP-100 - AI_A2A_CAP - Normal CAP --- Author: FlightControl --- Date Created: 30 May 2017 --- --- # Situation: --- The Su-27 airplane will patrol in PatrolZone. --- It will not engage any enemy automatically. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- - -local CapPlane = GROUP:FindByName( "Plane" ) - -local PatrolZone = ZONE:New( "Patrol Zone" ) - -A2ACap = AI_A2A_CAP:New( CapPlane, PatrolZone, 500, 1000, 500, 600 ) - -A2ACap:Patrol() - -local IntruderUnit = UNIT:FindByName( "Intruder" ) - - +--- +-- Name: CAP-100 - AI_A2A_CAP - Normal CAP +-- Author: FlightControl +-- Date Created: 30 May 2017 +-- +-- # Situation: +-- The Su-27 airplane will patrol in PatrolZone. +-- It will not engage any enemy automatically. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- + +local CapPlane = GROUP:FindByName( "Plane" ) + +local PatrolZone = ZONE:New( "Patrol Zone" ) + +A2ACap = AI_A2A_CAP:New( CapPlane, PatrolZone, 500, 1000, 500, 600 ) + +A2ACap:Patrol() + +local IntruderUnit = UNIT:FindByName( "Intruder" ) + + A2ACap:__Engage( 120, { IntruderUnit } ) \ No newline at end of file diff --git a/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz b/AI/AI_A2A_Cap/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz similarity index 100% rename from CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz rename to AI/AI_A2A_Cap/CAP-100 - AI_A2A_CAP - Normal CAP/CAP-100 - AI_A2A_CAP - Normal CAP.miz diff --git a/AMT - AmmoTruck/AmmoTruck 100 - NTTR - Basic/Moose.lua b/AI/AI_A2A_Cap/CAP-100 - AI_A2A_CAP - Normal CAP/Moose.lua similarity index 100% rename from AMT - AmmoTruck/AmmoTruck 100 - NTTR - Basic/Moose.lua rename to AI/AI_A2A_Cap/CAP-100 - AI_A2A_CAP - Normal CAP/Moose.lua diff --git a/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua b/AI/AI_BAI/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua similarity index 97% rename from BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua rename to AI/AI_BAI/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua index bd9499bc4a..5bb060dd35 100644 --- a/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua +++ b/AI/AI_BAI/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.lua @@ -1,74 +1,74 @@ ---- --- Name: BAI-001 - BAI in a Zone by Airplane Group --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 4 bombers at patrolling north of an engage zone for 10 minutes. --- After 10 minutes, the command center orders the bombers to engage the zone and execute a BAI strike. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone. --- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. --- 5. Observe the bombers eliminating the targets. --- 6. Observe the bombers defenses. --- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. --- 8. The bombers will return to base. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) -AIBAIZone:__Engage( 600 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-001 - BAI in a Zone by Airplane Group +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 4 bombers at patrolling north of an engage zone for 10 minutes. +-- After 10 minutes, the command center orders the bombers to engage the zone and execute a BAI strike. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone. +-- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. +-- 5. Observe the bombers eliminating the targets. +-- 6. Observe the bombers defenses. +-- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. +-- 8. The bombers will return to base. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) +AIBAIZone:__Engage( 600 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz b/AI/AI_BAI/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz rename to AI/AI_BAI/BAI-001 - BAI in a Zone by Airplane Group/BAI-001 - BAI in a Zone by Airplane Group.miz diff --git a/BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/Moose.lua b/AI/AI_BAI/BAI-001 - BAI in a Zone by Airplane Group/Moose.lua similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-001 - BAI in a Zone by Airplane Group/Moose.lua rename to AI/AI_BAI/BAI-001 - BAI in a Zone by Airplane Group/Moose.lua diff --git a/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua b/AI/AI_BAI/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua similarity index 97% rename from BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua rename to AI/AI_BAI/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua index 5e5deef03d..f8fdfdb665 100644 --- a/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua +++ b/AI/AI_BAI/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.lua @@ -1,75 +1,75 @@ ---- --- Name: BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 4 bombers at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the bombers to engage the zone and execute a BAI. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone. --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. --- 5. Observe the bombers eliminating the targets. --- 6. Observe the bombers defenses. --- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. --- 8. The bombers will return to base. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) -AIBAIZone:__Engage( 60, 400 ) -- Engage after one minute with a speed of 400 km/h. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 4 bombers at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the bombers to engage the zone and execute a BAI. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone. +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. +-- 5. Observe the bombers eliminating the targets. +-- 6. Observe the bombers defenses. +-- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. +-- 8. The bombers will return to base. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) +AIBAIZone:__Engage( 60, 400 ) -- Engage after one minute with a speed of 400 km/h. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz b/AI/AI_BAI/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz rename to AI/AI_BAI/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed.miz diff --git a/BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/Moose.lua b/AI/AI_BAI/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/Moose.lua similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/Moose.lua rename to AI/AI_BAI/BAI-002 - BAI in a Zone by Airplane Group - Engage with Speed/Moose.lua diff --git a/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua b/AI/AI_BAI/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua similarity index 97% rename from BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua rename to AI/AI_BAI/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua index e9401f29b5..43ff85443e 100644 --- a/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua +++ b/AI/AI_BAI/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.lua @@ -1,81 +1,81 @@ ---- --- Name: BAI-004 - BAI in a Zone by Airplane Group - Test Abort --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 4 bombers at patrolling north of an engage zone for 1 minute. --- After 10 minutes, the command center orders the bombers to engage the zone and execute a BAI. --- After 12 minutes, the mission is aborted. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 350 km/h. --- 3.2. The altitude to the engage zone and BAI execution is set to 4000 meters. --- 4. Observe the mission being aborted. A message will be sent. --- 5. The bombers will go back patrolling. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) -AIBAIZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. - --- After 12 minutes, tell the group BAIPlane to abort the engagement. -AIBAIZone:__Abort( 720 ) -- Abort the engagement. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - -function AIBAIZone:OnAfterAbort(Controllable,From,Event,To) - BASE:E( "MISSION ABORT! Back to patrol zone." ) - MESSAGE:New("Mission ABORTED! Back to the Patrol Zone!",30,"ALERT!"):ToAll() -end - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-004 - BAI in a Zone by Airplane Group - Test Abort +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 4 bombers at patrolling north of an engage zone for 1 minute. +-- After 10 minutes, the command center orders the bombers to engage the zone and execute a BAI. +-- After 12 minutes, the mission is aborted. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 350 km/h. +-- 3.2. The altitude to the engage zone and BAI execution is set to 4000 meters. +-- 4. Observe the mission being aborted. A message will be sent. +-- 5. The bombers will go back patrolling. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) +AIBAIZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. + +-- After 12 minutes, tell the group BAIPlane to abort the engagement. +AIBAIZone:__Abort( 720 ) -- Abort the engagement. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + +function AIBAIZone:OnAfterAbort(Controllable,From,Event,To) + BASE:E( "MISSION ABORT! Back to patrol zone." ) + MESSAGE:New("Mission ABORTED! Back to the Patrol Zone!",30,"ALERT!"):ToAll() +end + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz b/AI/AI_BAI/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz rename to AI/AI_BAI/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/BAI-004 - BAI in a Zone by Airplane Group - Test Abort.miz diff --git a/BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/Moose.lua b/AI/AI_BAI/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/Moose.lua similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/Moose.lua rename to AI/AI_BAI/BAI-004 - BAI in a Zone by Airplane Group - Test Abort/Moose.lua diff --git a/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua b/AI/AI_BAI/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua similarity index 97% rename from BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua rename to AI/AI_BAI/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua index f6b85b0478..85468404d9 100644 --- a/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua +++ b/AI/AI_BAI/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.lua @@ -1,78 +1,78 @@ ---- --- Name: BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 4 bombers at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the bombers to engage the zone and execute a BAI. --- The planes should expend 4 weapons per run. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 3.2. The altitude to the engage zone and BAI execution is set to 500 meters. --- 3.3. The planes should expend 4 weapons per run. --- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. --- 5. Observe the bombers eliminating the targets. --- 6. Observe the bombers defenses. --- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. --- 8. The bombers will return to base. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 1 minute, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) -AIBAIZone:__Engage( 60, 600, 8000, AI.Task.WeaponExpend.FOUR ) -- Engage with a speed of 600 km/h and an altitude of 8000 meters, weapn expend 4. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 4 bombers at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the bombers to engage the zone and execute a BAI. +-- The planes should expend 4 weapons per run. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 3.2. The altitude to the engage zone and BAI execution is set to 500 meters. +-- 3.3. The planes should expend 4 weapons per run. +-- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. +-- 5. Observe the bombers eliminating the targets. +-- 6. Observe the bombers defenses. +-- 7. When all targets within the engage zone are destroyed, the bombers BAI task is set to Accomplished. +-- 8. The bombers will return to base. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 1 minute, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. (600 is 600 seconds) +AIBAIZone:__Engage( 60, 600, 8000, AI.Task.WeaponExpend.FOUR ) -- Engage with a speed of 600 km/h and an altitude of 8000 meters, weapn expend 4. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz b/AI/AI_BAI/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz rename to AI/AI_BAI/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend.miz diff --git a/BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua b/AI/AI_BAI/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua rename to AI/AI_BAI/BAI-005 - BAI in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua diff --git a/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua b/AI/AI_BAI/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua similarity index 97% rename from BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua rename to AI/AI_BAI/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua index b3d8c0ec34..f6f922876e 100644 --- a/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua +++ b/AI/AI_BAI/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.lua @@ -1,76 +1,76 @@ ---- --- Name: BAI-100 - BAI of a Bridge --- Author: FlightControl --- Date Created: 09 May 2017 --- --- # Situation: --- --- A group of 2 bombers are patrolling north of an engage zone. --- The command center orders the bombers to engage the zone and execute a BAI strike on a bridge. --- --- # Test cases: --- --- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. --- 2. The bombers are not detecting any target during the patrol. --- 3. When the bombers is commanded to engage, the group will fly to the engage zone. --- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. --- 5. Observe the bombers eliminating the bridge. --- 6. Observe the bombers defenses. --- 7. When the bridge within the engage zone is destroyed, the bombers BAI task is set to Accomplished. --- 8. The bombers will return to base. - - - --- Create a local variable (in this case called BAIEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -BAIEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called BAIPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -BAIPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AIBAIZone) and --- using the functions AI_BAI_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) -AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - --- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function -AIBAIZone:SetControllable( BAIPlane ) - --- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location. -AIBAIZone:SearchOff() - --- Tell the group BAIPlane to start the mission in 1 second. -AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. -AIBAIZone:__Engage( 10 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() ~= 0 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The bridge is destroyed." ) - AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the bombers back to base." ) - Check:Stop( CheckScheduleID ) - AIBAIZone:__RTB( 1 ) -end +--- +-- Name: BAI-100 - BAI of a Bridge +-- Author: FlightControl +-- Date Created: 09 May 2017 +-- +-- # Situation: +-- +-- A group of 2 bombers are patrolling north of an engage zone. +-- The command center orders the bombers to engage the zone and execute a BAI strike on a bridge. +-- +-- # Test cases: +-- +-- 1. Observe that the bombers is patrolling in the patrol zone, until the engage command is given. +-- 2. The bombers are not detecting any target during the patrol. +-- 3. When the bombers is commanded to engage, the group will fly to the engage zone. +-- 4. Detection is activated and detected targets within the engage zone are assigned for BAI. +-- 5. Observe the bombers eliminating the bridge. +-- 6. Observe the bombers defenses. +-- 7. When the bridge within the engage zone is destroyed, the bombers BAI task is set to Accomplished. +-- 8. The bombers will return to base. + + + +-- Create a local variable (in this case called BAIEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +BAIEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called BAIPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +BAIPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AIBAIZone) and +-- using the functions AI_BAI_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, BAIEngagementZone) +AIBAIZone = AI_BAI_ZONE:New( PatrolZone, 500, 1000, 500, 600, BAIEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + +-- Tell the program to use the object (in this case called BAIPlane) as the group to use in the BAI function +AIBAIZone:SetControllable( BAIPlane ) + +-- Tell the BAI not to search for potential targets in the BAIEngagementZone, but rather use the center of the BAIEngagementZone as the bombing location. +AIBAIZone:SearchOff() + +-- Tell the group BAIPlane to start the mission in 1 second. +AIBAIZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group BAIPlane to engage the targets located in the engagement zone called BAIEngagement Zone. +AIBAIZone:__Engage( 10 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() ~= 0 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The bridge is destroyed." ) + AIBAIZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AIBAIZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the bombers back to base." ) + Check:Stop( CheckScheduleID ) + AIBAIZone:__RTB( 1 ) +end diff --git a/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz b/AI/AI_BAI/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz rename to AI/AI_BAI/BAI-100 - BAI of a Bridge/BAI-100 - BAI of a Bridge.miz diff --git a/BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/Moose.lua b/AI/AI_BAI/BAI-100 - BAI of a Bridge/Moose.lua similarity index 100% rename from BAI - Battlefield Air Interdiction/BAI-100 - BAI of a Bridge/Moose.lua rename to AI/AI_BAI/BAI-100 - BAI of a Bridge/Moose.lua diff --git a/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua b/AI/AI_CAP/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua similarity index 96% rename from CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua rename to AI/AI_CAP/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua index 2ac13846ea..12abd4eb47 100644 --- a/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua +++ b/AI/AI_CAP/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.lua @@ -1,23 +1,23 @@ ---- --- Name: CAP-001 - Combat Air Patrol --- Author: FlightControl --- Date Created: 16 January 2017 --- --- # Situation: --- The Su-27 airplane will patrol in PatrolZone. --- It will not engage any enemy automatically. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- - -local CapPlane = GROUP:FindByName( "Plane" ) - -local PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -AICapZone:SetControllable( CapPlane ) - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. +--- +-- Name: CAP-001 - Combat Air Patrol +-- Author: FlightControl +-- Date Created: 16 January 2017 +-- +-- # Situation: +-- The Su-27 airplane will patrol in PatrolZone. +-- It will not engage any enemy automatically. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- + +local CapPlane = GROUP:FindByName( "Plane" ) + +local PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +AICapZone:SetControllable( CapPlane ) + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. diff --git a/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz b/AI/AI_CAP/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz similarity index 100% rename from CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz rename to AI/AI_CAP/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz diff --git a/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/Moose.lua b/AI/AI_CAP/CAP-001 - Combat Air Patrol/Moose.lua similarity index 100% rename from CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/Moose.lua rename to AI/AI_CAP/CAP-001 - Combat Air Patrol/Moose.lua diff --git a/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua b/AI/AI_CAP/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua similarity index 97% rename from CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua rename to AI/AI_CAP/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua index 57a062f7cc..87189c8c5b 100644 --- a/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua +++ b/AI/AI_CAP/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.lua @@ -1,27 +1,27 @@ ---- --- Name: CAP-010 - CAP and Engage within Range --- Author: FlightControl --- Date Created: 16 January 2017 --- --- # Situation: --- --- The Su-27 airplane will patrol in PatrolZone. --- It will engage when it detects the airplane and when the A-10C is within the engage range. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- 2. Observe that, when the A-10C is within the engage range, it will engage. --- 3. After engage, observe that the Su-27 returns to the PatrolZone. --- 4. If you want, you can wait until the Su-27 is out of fuel and will land. - -CapPlane = GROUP:FindByName( "Plane" ) - -PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -AICapZone:SetControllable( CapPlane ) -AICapZone:SetEngageRange( 20000 ) -- Set the Engage Range to 20.000 meters. The AI won't engage when the enemy is beyond 20.000 meters. - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. +--- +-- Name: CAP-010 - CAP and Engage within Range +-- Author: FlightControl +-- Date Created: 16 January 2017 +-- +-- # Situation: +-- +-- The Su-27 airplane will patrol in PatrolZone. +-- It will engage when it detects the airplane and when the A-10C is within the engage range. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- 2. Observe that, when the A-10C is within the engage range, it will engage. +-- 3. After engage, observe that the Su-27 returns to the PatrolZone. +-- 4. If you want, you can wait until the Su-27 is out of fuel and will land. + +CapPlane = GROUP:FindByName( "Plane" ) + +PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +AICapZone:SetControllable( CapPlane ) +AICapZone:SetEngageRange( 20000 ) -- Set the Engage Range to 20.000 meters. The AI won't engage when the enemy is beyond 20.000 meters. + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. diff --git a/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz b/AI/AI_CAP/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz similarity index 100% rename from CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz rename to AI/AI_CAP/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz diff --git a/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/Moose.lua b/AI/AI_CAP/CAP-010 - CAP and Engage within Range/Moose.lua similarity index 100% rename from CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/Moose.lua rename to AI/AI_CAP/CAP-010 - CAP and Engage within Range/Moose.lua diff --git a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua b/AI/AI_CAP/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua similarity index 96% rename from CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua rename to AI/AI_CAP/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua index d85726d32c..5e911a0968 100644 --- a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua +++ b/AI/AI_CAP/CAP-011 - CAP and Engage within Zone/CAP-010 - CAP and Engage within Zone.lua @@ -1,23 +1,23 @@ --- Name: CAP-001 - Combat Air Patrol --- Author: FlightControl --- Date Created: 16 January 2017 --- --- # Situation: --- --- # Test cases: --- - -local CapPlane = GROUP:FindByName( "Plane" ) - -local PatrolZone = ZONE:New( "Patrol Zone" ) - -local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -local EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) - -local CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) - -AICapZone:SetControllable( CapPlane ) -AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. +-- Name: CAP-001 - Combat Air Patrol +-- Author: FlightControl +-- Date Created: 16 January 2017 +-- +-- # Situation: +-- +-- # Test cases: +-- + +local CapPlane = GROUP:FindByName( "Plane" ) + +local PatrolZone = ZONE:New( "Patrol Zone" ) + +local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +local EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) + +local CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) + +AICapZone:SetControllable( CapPlane ) +AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. diff --git a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua b/AI/AI_CAP/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua similarity index 97% rename from CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua rename to AI/AI_CAP/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua index bdb66f93f0..9c6d374153 100644 --- a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua +++ b/AI/AI_CAP/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.lua @@ -1,32 +1,32 @@ ---- --- Name: CAP-011 - CAP and Engage within Zone --- Author: FlightControl --- Date Created: 16 January 2017 --- --- # Situation: --- --- The Su-27 airplane will patrol in PatrolZone. --- It will engage when it detects the airplane and when the A-10C is within the CapEngageZone. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- 2. Observe that, when the A-10C is within the engage zone, it will engage. --- 3. After engage, observe that the Su-27 returns to the PatrolZone. --- 4. If you want, you can wait until the Su-27 is out of fuel and will land. - - -CapPlane = GROUP:FindByName( "Plane" ) - -PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) - -CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) - -AICapZone:SetControllable( CapPlane ) -AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. +--- +-- Name: CAP-011 - CAP and Engage within Zone +-- Author: FlightControl +-- Date Created: 16 January 2017 +-- +-- # Situation: +-- +-- The Su-27 airplane will patrol in PatrolZone. +-- It will engage when it detects the airplane and when the A-10C is within the CapEngageZone. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- 2. Observe that, when the A-10C is within the engage zone, it will engage. +-- 3. After engage, observe that the Su-27 returns to the PatrolZone. +-- 4. If you want, you can wait until the Su-27 is out of fuel and will land. + + +CapPlane = GROUP:FindByName( "Plane" ) + +PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) + +CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) + +AICapZone:SetControllable( CapPlane ) +AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. diff --git a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz b/AI/AI_CAP/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz similarity index 100% rename from CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz rename to AI/AI_CAP/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz diff --git a/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/Moose.lua b/AI/AI_CAP/CAP-011 - CAP and Engage within Zone/Moose.lua similarity index 100% rename from CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/Moose.lua rename to AI/AI_CAP/CAP-011 - CAP and Engage within Zone/Moose.lua diff --git a/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua b/AI/AI_CAP/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua similarity index 97% rename from CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua rename to AI/AI_CAP/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua index dc423e74d7..3b0ad84bc6 100644 --- a/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua +++ b/AI/AI_CAP/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.lua @@ -1,43 +1,43 @@ ---- --- Name: CAP-012 - CAP - Test Abort --- Author: FlightControl --- Date Created: 14 Mar 2017 --- --- # Situation: --- --- The Su-27 airplane will patrol in PatrolZone. --- It will engage when it detects the airplane and when the A-10C is within the CapEngageZone. --- It will abort the engagement after 1 minute and return to the patrol zone. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- 2. Observe that, when the A-10C is within the engage zone, it will engage. --- 3. After engage, observe that the Su-27 returns to the PatrolZone. --- 4. When it engages, it will abort the engagement after 1 minute. - - -CapPlane = GROUP:FindByName( "Plane" ) - -PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) - -CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) - -AICapZone:SetControllable( CapPlane ) -AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - -function AICapZone:OnAfterEngage(Controllable,From,Event,To) - AICapZone:__Abort( 60 ) -end - -function AICapZone:OnAfterAbort(Controllable,From,Event,To) - BASE:E("MISSION ABORTED! Returning to Patrol Zone!") - MESSAGE:New("MISSION ABORTED! Returning to Patrol Zone!",30,"ALERT!") -end - +--- +-- Name: CAP-012 - CAP - Test Abort +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- +-- # Situation: +-- +-- The Su-27 airplane will patrol in PatrolZone. +-- It will engage when it detects the airplane and when the A-10C is within the CapEngageZone. +-- It will abort the engagement after 1 minute and return to the patrol zone. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- 2. Observe that, when the A-10C is within the engage zone, it will engage. +-- 3. After engage, observe that the Su-27 returns to the PatrolZone. +-- 4. When it engages, it will abort the engagement after 1 minute. + + +CapPlane = GROUP:FindByName( "Plane" ) + +PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +EngageZoneGroup = GROUP:FindByName( "Engage Zone" ) + +CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup ) + +AICapZone:SetControllable( CapPlane ) +AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone. + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +function AICapZone:OnAfterEngage(Controllable,From,Event,To) + AICapZone:__Abort( 60 ) +end + +function AICapZone:OnAfterAbort(Controllable,From,Event,To) + BASE:E("MISSION ABORTED! Returning to Patrol Zone!") + MESSAGE:New("MISSION ABORTED! Returning to Patrol Zone!",30,"ALERT!") +end + diff --git a/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz b/AI/AI_CAP/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz similarity index 100% rename from CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz rename to AI/AI_CAP/CAP-012 - CAP - Test Abort/CAP-012 - CAP - Test Abort.miz diff --git a/CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/Moose.lua b/AI/AI_CAP/CAP-012 - CAP - Test Abort/Moose.lua similarity index 100% rename from CAP - Combat Air Patrol/CAP-012 - CAP - Test Abort/Moose.lua rename to AI/AI_CAP/CAP-012 - CAP - Test Abort/Moose.lua diff --git a/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua b/AI/AI_CAP/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua similarity index 96% rename from CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua rename to AI/AI_CAP/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua index 8f59293722..16f456f049 100644 --- a/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua +++ b/AI/AI_CAP/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.lua @@ -1,27 +1,27 @@ ---- --- Name: CAP-020 - Combat Air Patrol RTB Test --- Author: FlightControl --- Date Created: 14 February 2017 --- --- # Situation: --- The Su-27 airplane will patrol in PatrolZone. --- It will return to base when out of fuel. --- --- # Test cases: --- --- 1. Observe the Su-27 patrolling. --- 2. It should return to base when out of fuel. --- - -CapSpawn = SPAWN:New( "Plane" ):InitLimit(1,2):InitRepeatOnLanding() - -CapGroup = CapSpawn:Spawn() - -PatrolZone = ZONE:New( "Patrol Zone" ) - -AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) - -AICapZone:SetControllable( CapGroup ) - -AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - +--- +-- Name: CAP-020 - Combat Air Patrol RTB Test +-- Author: FlightControl +-- Date Created: 14 February 2017 +-- +-- # Situation: +-- The Su-27 airplane will patrol in PatrolZone. +-- It will return to base when out of fuel. +-- +-- # Test cases: +-- +-- 1. Observe the Su-27 patrolling. +-- 2. It should return to base when out of fuel. +-- + +CapSpawn = SPAWN:New( "Plane" ):InitLimit(1,2):InitRepeatOnLanding() + +CapGroup = CapSpawn:Spawn() + +PatrolZone = ZONE:New( "Patrol Zone" ) + +AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 ) + +AICapZone:SetControllable( CapGroup ) + +AICapZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + diff --git a/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz b/AI/AI_CAP/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz similarity index 100% rename from CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz rename to AI/AI_CAP/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz diff --git a/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/Moose.lua b/AI/AI_CAP/CAP-020 - Combat Air Patrol RTB Test/Moose.lua similarity index 100% rename from CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/Moose.lua rename to AI/AI_CAP/CAP-020 - Combat Air Patrol RTB Test/Moose.lua diff --git a/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua b/AI/AI_CAS/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua similarity index 97% rename from CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua rename to AI/AI_CAS/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua index 2dc0d39eeb..0250414842 100644 --- a/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua +++ b/AI/AI_CAS/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.lua @@ -1,74 +1,74 @@ ---- --- Name: CAS-001 - CAS in a Zone by Airplane Group --- Author: FlightControl --- Date Created: 13 January 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 10 minutes. --- After 10 minutes, the command center orders the Su-25T to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Su-25T eliminating the targets. --- 6. Observe the Su-25T defenses. --- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. --- 8. The Su-25T will return to base. - ---test - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 600 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-001 - CAS in a Zone by Airplane Group +-- Author: FlightControl +-- Date Created: 13 January 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 10 minutes. +-- After 10 minutes, the command center orders the Su-25T to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Su-25T eliminating the targets. +-- 6. Observe the Su-25T defenses. +-- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. +-- 8. The Su-25T will return to base. + +--test + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 600 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to the patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz b/AI/AI_CAS/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz similarity index 100% rename from CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz rename to AI/AI_CAS/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz diff --git a/CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/Moose.lua b/AI/AI_CAS/CAS-001 - CAS in a Zone by Airplane Group/Moose.lua similarity index 100% rename from CAP - Combat Air Patrol/CAP-100 - AI_A2A_CAP - Normal CAP/Moose.lua rename to AI/AI_CAS/CAS-001 - CAS in a Zone by Airplane Group/Moose.lua diff --git a/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua b/AI/AI_CAS/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua similarity index 97% rename from CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua rename to AI/AI_CAS/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua index f9bd0aee24..fad0bea38c 100644 --- a/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua +++ b/AI/AI_CAS/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.lua @@ -1,75 +1,75 @@ ---- --- Name: CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed --- Author: FlightControl --- Date Created: 06 February 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone. --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Su-25T eliminating the targets. --- 6. Observe the Su-25T defenses. --- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. --- 8. The Su-25T will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 60, 400 ) -- Engage after one minute with a speed of 400 km/h. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed +-- Author: FlightControl +-- Date Created: 06 February 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone. +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Su-25T eliminating the targets. +-- 6. Observe the Su-25T defenses. +-- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. +-- 8. The Su-25T will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 60, 400 ) -- Engage after one minute with a speed of 400 km/h. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz b/AI/AI_CAS/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz similarity index 100% rename from CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz rename to AI/AI_CAS/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed.miz diff --git a/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/Moose.lua b/AI/AI_CAS/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/Moose.lua rename to AI/AI_CAS/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/Moose.lua diff --git a/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua b/AI/AI_CAS/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua similarity index 97% rename from CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua rename to AI/AI_CAS/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua index 60c91bbaf7..8af2ca77e8 100644 --- a/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua +++ b/AI/AI_CAS/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.lua @@ -1,76 +1,76 @@ ---- --- Name: CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude --- Author: FlightControl --- Date Created: 6 February 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 3.2. The altitude to the engage zone and CAS execution is set to 500 meters. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Su-25T eliminating the targets. --- 6. Observe the Su-25T defenses. --- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. --- 8. The Su-25T will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude +-- Author: FlightControl +-- Date Created: 6 February 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 3.2. The altitude to the engage zone and CAS execution is set to 500 meters. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Su-25T eliminating the targets. +-- 6. Observe the Su-25T defenses. +-- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. +-- 8. The Su-25T will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz b/AI/AI_CAS/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz similarity index 100% rename from CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz rename to AI/AI_CAS/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude.miz diff --git a/CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/Moose.lua b/AI/AI_CAS/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-002 - CAS in a Zone by Airplane Group - Engage with Speed/Moose.lua rename to AI/AI_CAS/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/Moose.lua diff --git a/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua b/AI/AI_CAS/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua similarity index 97% rename from CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua rename to AI/AI_CAS/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua index dba517912a..295b7d11d8 100644 --- a/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua +++ b/AI/AI_CAS/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.lua @@ -1,81 +1,81 @@ ---- --- Name: CAS-004 - CAS in a Zone by Airplane Group - Test Abort --- Author: FlightControl --- Date Created: 14 Mar 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. --- After 10 minutes, the command center orders the Su-25T to engage the zone and execute a CAS. --- After 12 minutes, the mission is aborted. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 350 km/h. --- 3.2. The altitude to the engage zone and CAS execution is set to 4000 meters. --- 4. Observe the mission being aborted. A message will be sent. --- 5. The Su-25T will go back patrolling. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. - --- After 12 minutes, tell the group CASPlane to abort the engagement. -AICasZone:__Abort( 720 ) -- Abort the engagement. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - -function AICasZone:OnAfterAbort(Controllable,From,Event,To) - BASE:E( "MISSION ABORT! Back to patrol zone." ) - MESSAGE:New("Mission ABORTED! Back to the Patrol Zone!",30,"ALERT!"):ToAll() -end - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-004 - CAS in a Zone by Airplane Group - Test Abort +-- Author: FlightControl +-- Date Created: 14 Mar 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. +-- After 10 minutes, the command center orders the Su-25T to engage the zone and execute a CAS. +-- After 12 minutes, the mission is aborted. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 350 km/h. +-- 3.2. The altitude to the engage zone and CAS execution is set to 4000 meters. +-- 4. Observe the mission being aborted. A message will be sent. +-- 5. The Su-25T will go back patrolling. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 600, 350, 4000 ) -- Engage after 10 minutes with a speed of 350 km/h and an altitude of 4000 meters. + +-- After 12 minutes, tell the group CASPlane to abort the engagement. +AICasZone:__Abort( 720 ) -- Abort the engagement. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + +function AICasZone:OnAfterAbort(Controllable,From,Event,To) + BASE:E( "MISSION ABORT! Back to patrol zone." ) + MESSAGE:New("Mission ABORTED! Back to the Patrol Zone!",30,"ALERT!"):ToAll() +end + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz b/AI/AI_CAS/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz similarity index 100% rename from CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz rename to AI/AI_CAS/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/CAS-004 - CAS in a Zone by Airplane Group - Test Abort.miz diff --git a/CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/Moose.lua b/AI/AI_CAS/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-003 - CAS in a Zone by Airplane Group - Engage with Speed and Altitude/Moose.lua rename to AI/AI_CAS/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/Moose.lua diff --git a/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua b/AI/AI_CAS/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua similarity index 97% rename from CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua rename to AI/AI_CAS/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua index 727e88c871..203eed00a8 100644 --- a/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua +++ b/AI/AI_CAS/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.lua @@ -1,78 +1,78 @@ ---- --- Name: CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend --- Author: FlightControl --- Date Created: 18 Mar 2017 --- --- # Situation: --- --- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. --- The planes should expend 4 weapons per run. --- --- # Test cases: --- --- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. --- 2. The Su-25T are not detecting any target during the patrol. --- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone --- 3.1. The approach speed to the engage zone is set to 400 km/h. --- 3.2. The altitude to the engage zone and CAS execution is set to 500 meters. --- 3.3. The planes should expend 4 weapons per run. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Su-25T eliminating the targets. --- 6. Observe the Su-25T defenses. --- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. --- 8. The Su-25T will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Plane" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 1 minute, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 60, 600, 8000, AI.Task.WeaponExpend.FOUR ) -- Engage with a speed of 600 km/h and an altitude of 8000 meters, weapn expend 4. - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend +-- Author: FlightControl +-- Date Created: 18 Mar 2017 +-- +-- # Situation: +-- +-- A group of 4 Su-25T at patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Su-25T to engage the zone and execute a CAS. +-- The planes should expend 4 weapons per run. +-- +-- # Test cases: +-- +-- 1. Observe that the Su-25T is patrolling in the patrol zone, until the engage command is given. +-- 2. The Su-25T are not detecting any target during the patrol. +-- 3. When the Su-25T is commanded to engage, the group will fly to the engage zone +-- 3.1. The approach speed to the engage zone is set to 400 km/h. +-- 3.2. The altitude to the engage zone and CAS execution is set to 500 meters. +-- 3.3. The planes should expend 4 weapons per run. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Su-25T eliminating the targets. +-- 6. Observe the Su-25T defenses. +-- 7. When all targets within the engage zone are destroyed, the Su-25T CAS task is set to Accomplished. +-- 8. The Su-25T will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Plane" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 1 minute, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 60, 600, 8000, AI.Task.WeaponExpend.FOUR ) -- Engage with a speed of 600 km/h and an altitude of 8000 meters, weapn expend 4. + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz b/AI/AI_CAS/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz similarity index 100% rename from CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz rename to AI/AI_CAS/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend.miz diff --git a/CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/Moose.lua b/AI/AI_CAS/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-004 - CAS in a Zone by Airplane Group - Test Abort/Moose.lua rename to AI/AI_CAS/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua diff --git a/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua b/AI/AI_CAS/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua similarity index 97% rename from CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua rename to AI/AI_CAS/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua index f046c2e9ee..42f76f38f6 100644 --- a/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua +++ b/AI/AI_CAS/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.lua @@ -1,76 +1,76 @@ ---- --- Name: CAS-010 - CAS in a Zone by Helicopter --- Author: FlightControl --- Date Created: 6 February 2017 --- --- # Situation: --- --- A group of 1 Ka-50 patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Ka-50 to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Ka-50 is patrolling in the patrol zone, until the engage command is given. --- 2. The Ka-50 are not detecting any target during the patrol. --- 3. When the Ka-50 is commanded to engage, the group will fly to the engage zone. --- 3.1. Engage Speed is set to 100 km/h. --- 3.2. Engage Altitude is set to 150 meters. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Ka-50 eliminating the targets. --- 6. Observe the Ka-50 defenses. --- 7. When all targets within the engage zone are destroyed, the Ka-50 CAS task is set to Accomplished. --- 8. The Ka-50 will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Helicopter" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 60, 100, 150 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-010 - CAS in a Zone by Helicopter +-- Author: FlightControl +-- Date Created: 6 February 2017 +-- +-- # Situation: +-- +-- A group of 1 Ka-50 patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Ka-50 to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Ka-50 is patrolling in the patrol zone, until the engage command is given. +-- 2. The Ka-50 are not detecting any target during the patrol. +-- 3. When the Ka-50 is commanded to engage, the group will fly to the engage zone. +-- 3.1. Engage Speed is set to 100 km/h. +-- 3.2. Engage Altitude is set to 150 meters. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Ka-50 eliminating the targets. +-- 6. Observe the Ka-50 defenses. +-- 7. When all targets within the engage zone are destroyed, the Ka-50 CAS task is set to Accomplished. +-- 8. The Ka-50 will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Helicopter" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 60, 100, 150 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz b/AI/AI_CAS/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz similarity index 100% rename from CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz rename to AI/AI_CAS/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz diff --git a/CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua b/AI/AI_CAS/CAS-010 - CAS in a Zone by Helicopter/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-005 - CAS in a Zone by Airplane Group - Engage with WeaponExpend/Moose.lua rename to AI/AI_CAS/CAS-010 - CAS in a Zone by Helicopter/Moose.lua diff --git a/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua b/AI/AI_CAS/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua similarity index 97% rename from CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua rename to AI/AI_CAS/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua index edce960d68..dbf2bcb055 100644 --- a/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua +++ b/AI/AI_CAS/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.lua @@ -1,75 +1,75 @@ ---- --- Name: CAS-011 - CAS in a Zone by Helicopter Group --- Author: FlightControl --- Date Created: 6 February 2017 --- --- # Situation: --- --- A group of 4 Ka-50 patrolling north of an engage zone for 1 minute. --- After 1 minute, the command center orders the Ka-50 to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the Ka-50 is patrolling in the patrol zone, until the engage command is given. --- 2. The Ka-50 are not detecting any target during the patrol. --- 3. When the Ka-50 is commanded to engage, the group will fly to the engage zone. --- 3.1. Engage Speed is set to 100 km/h. --- 3.2. Engage Altitude is set to 150 meters. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the Ka-50 eliminating the targets. --- 6. Observe the Ka-50 defenses. --- 7. When all targets within the engage zone are destroyed, the Ka-50 CAS task is set to Accomplished. --- 8. The Ka-50 will return to base. - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variable (in this case called CASPlane) and --- using the GROUP function find the aircraft group called "Plane" and assign to this variable -CASPlane = GROUP:FindByName( "Helicopter" ) - --- Create a local Variable (in this cased called PatrolZone and --- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable -PatrolZone = ZONE:New( "Patrol Zone" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZone:SetControllable( CASPlane ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) -AICasZone:__Engage( 60, 100, 150 ) - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - Check:Stop( CheckScheduleID ) - AICasZone:__RTB( 1 ) -end +--- +-- Name: CAS-011 - CAS in a Zone by Helicopter Group +-- Author: FlightControl +-- Date Created: 6 February 2017 +-- +-- # Situation: +-- +-- A group of 4 Ka-50 patrolling north of an engage zone for 1 minute. +-- After 1 minute, the command center orders the Ka-50 to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the Ka-50 is patrolling in the patrol zone, until the engage command is given. +-- 2. The Ka-50 are not detecting any target during the patrol. +-- 3. When the Ka-50 is commanded to engage, the group will fly to the engage zone. +-- 3.1. Engage Speed is set to 100 km/h. +-- 3.2. Engage Altitude is set to 150 meters. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the Ka-50 eliminating the targets. +-- 6. Observe the Ka-50 defenses. +-- 7. When all targets within the engage zone are destroyed, the Ka-50 CAS task is set to Accomplished. +-- 8. The Ka-50 will return to base. + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variable (in this case called CASPlane) and +-- using the GROUP function find the aircraft group called "Plane" and assign to this variable +CASPlane = GROUP:FindByName( "Helicopter" ) + +-- Create a local Variable (in this cased called PatrolZone and +-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable +PatrolZone = ZONE:New( "Patrol Zone" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZone:SetControllable( CASPlane ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZone:__Start( 1 ) -- They should statup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlane to engage the targets located in the engagement zone called CASEngagement Zone. (600 is 600 seconds) +AICasZone:__Engage( 60, 100, 150 ) + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Plane will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + AICasZone:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + Check:Stop( CheckScheduleID ) + AICasZone:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz b/AI/AI_CAS/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz similarity index 100% rename from CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz rename to AI/AI_CAS/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz diff --git a/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/Moose.lua b/AI/AI_CAS/CAS-011 - CAS in a Zone by Helicopter Group/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/Moose.lua rename to AI/AI_CAS/CAS-011 - CAS in a Zone by Helicopter Group/Moose.lua diff --git a/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua b/AI/AI_CAS/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua similarity index 98% rename from CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua rename to AI/AI_CAS/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua index 87e53937b8..05d2beba9d 100644 --- a/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua +++ b/AI/AI_CAS/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.lua @@ -1,91 +1,91 @@ ---- --- Name: CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups --- Author: FlightControl --- Date Created: 6 February 2017 --- --- # Situation: --- --- A group of 4 Ka-50 and 5 Su-25T are patrolling north in two engage zone for 5 minutes. --- After 5 minutes, the command center orders the groups to engage the zone and execute a CAS. --- --- # Test cases: --- --- 1. Observe that the groups is patrolling in the patrol zone, until the engage command is given. --- 2. The groups are not detecting any target during the patrol. --- 3. When the groups is commanded to engage, the group will fly to the engage zone. --- 3.1. Engage Speed for the Su-25T is set to 350 km/h. --- 3.2. Engage Altitude for the Su-25T is set to 1500 meters. --- 3.3. Engage Speed for the Ka-50 is set to 100 km/h. --- 3.4. Engage Altitude for the Ka-50 is set to 150 meters. --- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. --- 5. Observe the groups eliminating the targets. --- 6. Observe the groups defenses. --- 7. When all targets within the engage zone are destroyed, the groups CAS task is set to Accomplished. --- 8. The groups will return to base. - - - --- Create a local variable (in this case called CASEngagementZone) and --- using the ZONE function find the pre-defined zone called "Engagement Zone" --- currently on the map and assign it to this variable -CASEngagementZone = ZONE:New( "Engagement Zone" ) - --- Create a local variables (in this case called CASPlane and CASHelicopters) and --- using the GROUP function find the aircraft group called "Plane" and "Helicopter" and assign to these variables -CASPlane = GROUP:FindByName( "Plane" ) -CASHelicopter = GROUP:FindByName( "Helicopter" ) - --- Create two patrol zones, one for the Planes and one for the Helicopters. -PatrolZonePlanes = ZONE:New( "Patrol Zone Planes" ) -PatrolZoneHelicopters = ZONE:New( "Patrol Zone Helicopters" ) - --- Create and object (in this case called AICasZone) and --- using the functions AI_CAS_ZONE assign the parameters that define this object --- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) -AICasZonePlanes = AI_CAS_ZONE:New( PatrolZonePlanes, 400, 500, 500, 2500, CASEngagementZone ) -AICasZoneHelicopters = AI_CAS_ZONE:New( PatrolZoneHelicopters, 100, 250, 300, 1000, CASEngagementZone ) - --- Create an object (in this case called Targets) and --- using the GROUP function find the group labeled "Targets" and assign it to this object -Targets = GROUP:FindByName("Targets") - - --- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function -AICasZonePlanes:SetControllable( CASPlane ) -AICasZoneHelicopters:SetControllable( CASHelicopter ) - --- Tell the group CASPlane to start the mission in 1 second. -AICasZonePlanes:__Start( 1 ) -- They should startup, and start patrolling in the PatrolZone. -AICasZoneHelicopters:__Start( 1 ) -- They should startup, and start patrolling in the PatrolZone. - --- After 10 minutes, tell the group CASPlanes and CASHelicopters to engage the targets located in the engagement zone called CASEngagement Zone. -AICasZonePlanes:__Engage( 300, 350, 1500 ) -- Engage with a speed of 350 km/h and 1500 meter altitude. -AICasZoneHelicopters:__Engage( 300, 100, 150 ) -- Engage with a speed of 100 km/h and 150 meter altitude. - - --- Check every 60 seconds whether the Targets have been eliminated. --- When the trigger completed has been fired, the Planes and Helicopters will go back to the Patrol Zone. -Check, CheckScheduleID = SCHEDULER:New(nil, - function() - if Targets:IsAlive() and Targets:GetSize() > 5 then - BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") - else - BASE:E( "Test Mission: The required targets are destroyed." ) - Check:Stop( CheckScheduleID ) - AICasZonePlanes:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - AICasZoneHelicopters:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. - end - end, {}, 20, 60, 0.2 ) - - --- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... -function AICasZonePlanes:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Su-25T back to base." ) - AICasZonePlanes:__RTB( 1 ) -end - --- When the targets in the zone are destroyed, (see scheduled function), the helicpters will return home ... -function AICasZoneHelicopters:OnAfterAccomplish( Controllable, From, Event, To ) - BASE:E( "Test Mission: Sending the Ka-50 back to base." ) - AICasZoneHelicopters:__RTB( 1 ) -end +--- +-- Name: CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups +-- Author: FlightControl +-- Date Created: 6 February 2017 +-- +-- # Situation: +-- +-- A group of 4 Ka-50 and 5 Su-25T are patrolling north in two engage zone for 5 minutes. +-- After 5 minutes, the command center orders the groups to engage the zone and execute a CAS. +-- +-- # Test cases: +-- +-- 1. Observe that the groups is patrolling in the patrol zone, until the engage command is given. +-- 2. The groups are not detecting any target during the patrol. +-- 3. When the groups is commanded to engage, the group will fly to the engage zone. +-- 3.1. Engage Speed for the Su-25T is set to 350 km/h. +-- 3.2. Engage Altitude for the Su-25T is set to 1500 meters. +-- 3.3. Engage Speed for the Ka-50 is set to 100 km/h. +-- 3.4. Engage Altitude for the Ka-50 is set to 150 meters. +-- 4. Detection is activated and detected targets within the engage zone are assigned for CAS. +-- 5. Observe the groups eliminating the targets. +-- 6. Observe the groups defenses. +-- 7. When all targets within the engage zone are destroyed, the groups CAS task is set to Accomplished. +-- 8. The groups will return to base. + + + +-- Create a local variable (in this case called CASEngagementZone) and +-- using the ZONE function find the pre-defined zone called "Engagement Zone" +-- currently on the map and assign it to this variable +CASEngagementZone = ZONE:New( "Engagement Zone" ) + +-- Create a local variables (in this case called CASPlane and CASHelicopters) and +-- using the GROUP function find the aircraft group called "Plane" and "Helicopter" and assign to these variables +CASPlane = GROUP:FindByName( "Plane" ) +CASHelicopter = GROUP:FindByName( "Helicopter" ) + +-- Create two patrol zones, one for the Planes and one for the Helicopters. +PatrolZonePlanes = ZONE:New( "Patrol Zone Planes" ) +PatrolZoneHelicopters = ZONE:New( "Patrol Zone Helicopters" ) + +-- Create and object (in this case called AICasZone) and +-- using the functions AI_CAS_ZONE assign the parameters that define this object +-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone) +AICasZonePlanes = AI_CAS_ZONE:New( PatrolZonePlanes, 400, 500, 500, 2500, CASEngagementZone ) +AICasZoneHelicopters = AI_CAS_ZONE:New( PatrolZoneHelicopters, 100, 250, 300, 1000, CASEngagementZone ) + +-- Create an object (in this case called Targets) and +-- using the GROUP function find the group labeled "Targets" and assign it to this object +Targets = GROUP:FindByName("Targets") + + +-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function +AICasZonePlanes:SetControllable( CASPlane ) +AICasZoneHelicopters:SetControllable( CASHelicopter ) + +-- Tell the group CASPlane to start the mission in 1 second. +AICasZonePlanes:__Start( 1 ) -- They should startup, and start patrolling in the PatrolZone. +AICasZoneHelicopters:__Start( 1 ) -- They should startup, and start patrolling in the PatrolZone. + +-- After 10 minutes, tell the group CASPlanes and CASHelicopters to engage the targets located in the engagement zone called CASEngagement Zone. +AICasZonePlanes:__Engage( 300, 350, 1500 ) -- Engage with a speed of 350 km/h and 1500 meter altitude. +AICasZoneHelicopters:__Engage( 300, 100, 150 ) -- Engage with a speed of 100 km/h and 150 meter altitude. + + +-- Check every 60 seconds whether the Targets have been eliminated. +-- When the trigger completed has been fired, the Planes and Helicopters will go back to the Patrol Zone. +Check, CheckScheduleID = SCHEDULER:New(nil, + function() + if Targets:IsAlive() and Targets:GetSize() > 5 then + BASE:E( "Test Mission: " .. Targets:GetSize() .. " targets left to be destroyed.") + else + BASE:E( "Test Mission: The required targets are destroyed." ) + Check:Stop( CheckScheduleID ) + AICasZonePlanes:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + AICasZoneHelicopters:__Accomplish( 1 ) -- Now they should fly back to teh patrolzone and patrol. + end + end, {}, 20, 60, 0.2 ) + + +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... +function AICasZonePlanes:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Su-25T back to base." ) + AICasZonePlanes:__RTB( 1 ) +end + +-- When the targets in the zone are destroyed, (see scheduled function), the helicpters will return home ... +function AICasZoneHelicopters:OnAfterAccomplish( Controllable, From, Event, To ) + BASE:E( "Test Mission: Sending the Ka-50 back to base." ) + AICasZoneHelicopters:__RTB( 1 ) +end diff --git a/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz b/AI/AI_CAS/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz similarity index 100% rename from CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz rename to AI/AI_CAS/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups.miz diff --git a/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/Moose.lua b/AI/AI_CAS/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/Moose.lua rename to AI/AI_CAS/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/Moose.lua diff --git a/CAS - Close Air Support/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.lua b/AI/AI_CAS/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.lua similarity index 97% rename from CAS - Close Air Support/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.lua rename to AI/AI_CAS/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.lua index 340315c440..4e095cf010 100644 --- a/CAS - Close Air Support/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.lua +++ b/AI/AI_CAS/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.lua @@ -1,298 +1,298 @@ ----- Mission 'Demo' CAS -- more like a hack together :) --- Details: Provides for 1 flight of on call close air support aircraft that will attack detected targets detected within search zones. --- Will patrol on station until out of fuel and then another will take it's place. Flight will attempt to attack detected targets --- for 20 minutes after engaging. Then will RTB and be replaced by another patrol. --- Engage zone will be dynamically located to detected targets. --- --- Makes use of the Moose DETECTION_AREAS and AI_CAS_ZONE functionality. --- --- Functionality is executed as a scheduled task that runs at 30 seconds and every 60 seconds after. --- - --- ***************************** --- BLUE CAS SECTION --- |||||||||||||||||||||||||||| --- vvvvvvvvvvvvvvvvvvvvvvvvvvvv - -BlueCASGroupStatusTable = {} -BlueCASGroupTable = {} - -MaxBlueCAS = math.random(4,8) ---********************** - --Setup Blue Detection (Stykers in this case) can have 1 to many + predators whatever - --- Just ensure group name in editor start with "Blue Recon" - --********************* -ReconSetGroup = SET_GROUP:New():FilterPrefixes( "Blue Recon" ):FilterStart() -ReconDetection = DETECTION_AREAS:New( ReconSetGroup, 3000 ):FilterCategories( Unit.Category.GROUND_UNIT ) -- Group all detections within 3000 meters to one line in report - --- Define Search zones (Editor Trigger Zone (Radius)) -BlueSearch1 = ZONE:New( "Blue Search 1" ) -BlueSearch2 = ZONE:New( "Blue Search 2" ) - --- make them the active search zones and start detecting -ReconDetection:SetAcceptZones( {BlueSearch2, BlueSearch1} ) -ReconDetection:Start() -- start detecting - --- Now setup for spawning CAS Groups -- (which are destroyed on landing) -BlueCASGroup = SPAWN:New("Blue CAS Group") -BlueCASGroup:InitGrouping(2) -BlueCASGroup:OnSpawnGroup( - function(groupname) - local SpawnedCASGroup = GROUP:FindByName(groupname.GroupName) - local tempgroupname = groupname.GroupName - - --setup event handler - SpawnedCASGroup:HandleEvent( EVENTS.Land ) - --- @param self - -- @param Core.Event#EVENTDATA EventData - function SpawnedCASGroup:OnEventLand(EventData) - - --EventData.IniGroup:MessageToAll("Landed",15,"Land Event") - --local CASGroup = BlueCASGroup:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), SPAWN.Takeoff.Cold, 2000 ) - --local CASGroupName = CASGroup:GetName() - for x=1, MaxBlueCAS do - if BlueCASGroupTable[x] == EventData.IniGroupName then - BlueCASGroupTable[x] = "Group Name" - BlueCASGroupStatusTable[x] = "Avail" - --CASEngageFlag[EventData.IniGroupName] = "" - --CASEngagedTimer[EventData.IniGroupName] = 0 - break - end - end - CASGroups[EventData.IniGroup] = nil - EventData.IniGroup:Destroy() - end - end - ) - --- Do some setup to track state with CAS Flights and spawning --- instantiate avail flag at mission start -for x=1, MaxBlueCAS do - BlueCASGroupTable[x] = "Group Name" - BlueCASGroupStatusTable[x] = "Avail" -end - --- Instantiate Group Pointers for BlueCASManager -CASGroup1 = nil - --- Blue CAS Manager Function --- Detects and triggers state changes in CASAir1 FSM --- Basically check state every 60 seconds and take an action -function BlueCASManager() - local detection = false - - -- Determine if flight avail or already assigned - if ActiveCASGroupName == "" then - CASGroup1 = SpawnNewCASGroup() - end - --MessageToAll("CASGroup 1 = " .. CASGroup1:GetName(), 15) - - -- Display detection report if detected targets - if ReconDetection.DetectedItemCount > 0 then - detection = true - bluedetectiontimer = timer.getTime() + 300 -- send RTB after 5 minutes of 0 contacts - DetectionReport = ReconDetection:DetectedReportDetailed() - MessageToAll(DetectionReport, 15) - else - detection = false - end - -- Drive through CAS Groups - for Group, Fsm in pairs(CASGroups) do - local mystate = Fsm:GetState() - local CASAir1 = Fsm - - - local tempgroup = GROUP:FindByName( Group ) - local tempgroupname = tempgroup:GetName() - local tempcoalition = tempgroup:GetCoalition() - --MessageToAll( "GroupName = " .. tempgroupname .. " " .. mystate, 15) - - -- if patrolling engage if detected targets - if mystate == "Patrolling" then - if engaged == false then - if ReconDetection.DetectedItemCount > 0 then - Fsm:__Engage( 2, 350, 2500) - -- start engage Timer so we can stop after 20 minutes - CASEngagedTimer[tempgroupname] = timer.getTime() + 1500 - CASEngageFlag[tempgroupname] = true - engaged = true - end - end - end - -- if engaging then check timers to see when to stop - if mystate == "Engaging" then - if timer.getTime() > CASEngagedTimer[tempgroupname] then - Fsm:__RTB(2) - engaged = false - CASEngagedTimer[tempgroupname] = 0 - CASEngageFlag[tempgroupname] = false - - else - --MessageToAll( "Detection Timer: " .. bluedetectiontimer .. " " .. timer.getTime(), 15) - -- if no targets keep looking for 5 minutes and rtb - if ReconDetection.DetectedItemCount == 0 then - if timer.getTime() > bluedetectiontimer then - Fsm:__RTB(2) - engaged = false - bluedetectiontimer = 0 - CASEngagedTimer[tempgroupname] = 0 - CASEngageFlag[tempgroupname] = false - - end - end - end -- end timer.getTime() - end - - -- here we launch a replacement as soon as flight hits returning state. - -- possible via adding additional transition called 'Stage' to AI_CAS_ZONE FSM (defined in spawn manager below) - if mystate == "Returning" then - Fsm:__Stage(30) - end - -- if crashed then mark in status table dead and set ActiveCASGroupName to nil, which will spawn a new flight - -- cleanup all other flags for active flight - if mystate == "Crashed" then - ActiveCASGroupName = "" - for x=1, MaxBlueCAS do - local mytempgroup = BlueCASGroupTable[tempgroupname] - if mytempgroup == tempgroupname then - BlueCASGroupStatusTable[x] = "Dead" - break - end - end - -- Cleanup current flags - engaged = false - detectiontimer = 0 - detection = false - CASEngagedTimer[tempgroupname] = 0 - CASEngageFlag[tempgroupname] = false - CASGroups[tempgroupname] = nil - end - - if mystate == "Stopped" then - CASEngageFlag[tempgroupname] = false - CASEngagedTimer[tempgroupname] = 0 - engaged = false - CASGroups[tempgroupname] = nil - end - -- continuing flags management - if mystate == "Staged" then - ActiveCASGroupName = "" - Fsm:Stop() - end - end - -end - - --- Setup for SpawnNewCASGroup Function -CASAirPointer = "CASAir1" -BlueCASGroupCounter = 0 -ActiveCASGroupName = "" -CASGroups = {} -CASEngagedTimer = {} -CASEngageFlag = {} -engaged = false -BlueCASPatrolZone = ZONE:New( "Blue CAS Patrol Zone" ) -BlueCASEngageZone = ZONE:New( "Blue CAS Engage Zone" ) - --- Function SPAWN New CAS --- Check that there are avail flights to use and if so Spawn one. --- Assign spawned aircraft AI_CAS_ZONE --- Set some flags for maintaining logic -function SpawnNewCASGroup() - MessageToAll("Assigning CAS", 15) - -- get AI_CAS_ZONE Ready for some planes - local CASAir1 = AI_CAS_ZONE:New( BlueCASPatrolZone, 5000, 5500, 250, 270, BlueCASEngageZone ) - - -- look for 'avail' flight - for x=1, MaxBlueCAS do - local CASFlightStatus = BlueCASGroupStatusTable[x] - if CASFlightStatus == "Avail" then - MessageToAll("CAS Status = AVAIL", 15) - --Spawn a CAS Flight - CASGroup = BlueCASGroup:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Kobuleti ), SPAWN.Takeoff.Runway, 2000 ) - local CASGroupName = CASGroup:GetName() - BlueCASGroupStatusTable[x] = "Inflight" - ActiveCASGroupName = "Inflight" - CASAir1:SetControllable( CASGroup ) - CASAir1:__Start(30) - CASGroups[CASGroupName] = CASAir1 - CASEngagedTimer[CASGroupName] = 0 - CASEngageFlag[CASGroupName] = false - BlueCASGroupTable[x] = CASGroupName - break - else - -- Will flip back to avail if CAS flight lands - BlueCASGroupStatusTable[x] = "Dead" - end - end - - CASAir1:AddTransition( "Returning", "Stage", "Staged" ) - --- OnLeave Transition Handler for State Staged. - -- @function [parent=#AI_PATROL_ZONE] OnLeaveStaged - -- @param #AI_PATROL_ZONE self - -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - -- @return #boolean Return false to cancel Transition. - - --- OnEnter Transition Handler for State Staged. - -- @function [parent=#AI_PATROL_ZONE] OnEnterStaged - -- @param #AI_PATROL_ZONE self - -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - - --- OnBefore Transition Handler for Event Stage. - -- @function [parent=#AI_PATROL_ZONE] OnBeforeStage - -- @param #AI_PATROL_ZONE self - -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - -- @return #boolean Return false to cancel Transition. - - --- OnAfter Transition Handler for Event Stage. - -- @function [parent=#AI_PATROL_ZONE] OnAfterStage - -- @param #AI_PATROL_ZONE self - -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. - -- @param #string From The From State string. - -- @param #string Event The Event string. - -- @param #string To The To State string. - - --- Synchronous Event Trigger for Event Stage. - -- @function [parent=#AI_PATROL_ZONE] Stage - -- @param #AI_PATROL_ZONE self - - --- Asynchronous Event Trigger for Event Stage. - -- @function [parent=#AI_PATROL_ZONE] __Stage - -- @param #AI_PATROL_ZONE self - -- @param #number Delay The delay in seconds. - - CASAir1:AddTransition("Stopped", "Stage", "Staged") - CASAir1:AddTransition("Staged", "Route", "Patrolling") - CASAir1:AddTransition("Staged", "Stop", "Stopped") - - return CASGroup -end - --- Triggered when detection happens --- Also smokes red detected targets -function ReconDetection:OnAfterDetected( From, Event, To, DetectedUnits ) - for DetectedUnitID, DetectedUnit in pairs( DetectedUnits ) do - local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT - local detectedunitvec2 = DetectedUnit:GetVec2() - --- --Move Engagement Zone to Contact from Red Recon - BlueCASEngageZone:SetVec2(detectedunitvec2) - DetectedUnit:SmokeRed() - end -end - --- ************************************** --- End of Blue CAS --- ************************************* - - SchedulerObject, SchedulerID = SCHEDULER:New( nil, BlueCASManager, {}, 30, 60 ) +---- Mission 'Demo' CAS -- more like a hack together :) +-- Details: Provides for 1 flight of on call close air support aircraft that will attack detected targets detected within search zones. +-- Will patrol on station until out of fuel and then another will take it's place. Flight will attempt to attack detected targets +-- for 20 minutes after engaging. Then will RTB and be replaced by another patrol. +-- Engage zone will be dynamically located to detected targets. +-- +-- Makes use of the Moose DETECTION_AREAS and AI_CAS_ZONE functionality. +-- +-- Functionality is executed as a scheduled task that runs at 30 seconds and every 60 seconds after. +-- + +-- ***************************** +-- BLUE CAS SECTION +-- |||||||||||||||||||||||||||| +-- vvvvvvvvvvvvvvvvvvvvvvvvvvvv + +BlueCASGroupStatusTable = {} +BlueCASGroupTable = {} + +MaxBlueCAS = math.random(4,8) +--********************** + --Setup Blue Detection (Stykers in this case) can have 1 to many + predators whatever + --- Just ensure group name in editor start with "Blue Recon" + --********************* +ReconSetGroup = SET_GROUP:New():FilterPrefixes( "Blue Recon" ):FilterStart() +ReconDetection = DETECTION_AREAS:New( ReconSetGroup, 3000 ):FilterCategories( Unit.Category.GROUND_UNIT ) -- Group all detections within 3000 meters to one line in report + +-- Define Search zones (Editor Trigger Zone (Radius)) +BlueSearch1 = ZONE:New( "Blue Search 1" ) +BlueSearch2 = ZONE:New( "Blue Search 2" ) + +-- make them the active search zones and start detecting +ReconDetection:SetAcceptZones( {BlueSearch2, BlueSearch1} ) +ReconDetection:Start() -- start detecting + +-- Now setup for spawning CAS Groups -- (which are destroyed on landing) +BlueCASGroup = SPAWN:New("Blue CAS Group") +BlueCASGroup:InitGrouping(2) +BlueCASGroup:OnSpawnGroup( + function(groupname) + local SpawnedCASGroup = GROUP:FindByName(groupname.GroupName) + local tempgroupname = groupname.GroupName + + --setup event handler + SpawnedCASGroup:HandleEvent( EVENTS.Land ) + --- @param self + -- @param Core.Event#EVENTDATA EventData + function SpawnedCASGroup:OnEventLand(EventData) + + --EventData.IniGroup:MessageToAll("Landed",15,"Land Event") + --local CASGroup = BlueCASGroup:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), SPAWN.Takeoff.Cold, 2000 ) + --local CASGroupName = CASGroup:GetName() + for x=1, MaxBlueCAS do + if BlueCASGroupTable[x] == EventData.IniGroupName then + BlueCASGroupTable[x] = "Group Name" + BlueCASGroupStatusTable[x] = "Avail" + --CASEngageFlag[EventData.IniGroupName] = "" + --CASEngagedTimer[EventData.IniGroupName] = 0 + break + end + end + CASGroups[EventData.IniGroup] = nil + EventData.IniGroup:Destroy() + end + end + ) + +-- Do some setup to track state with CAS Flights and spawning +-- instantiate avail flag at mission start +for x=1, MaxBlueCAS do + BlueCASGroupTable[x] = "Group Name" + BlueCASGroupStatusTable[x] = "Avail" +end + +-- Instantiate Group Pointers for BlueCASManager +CASGroup1 = nil + +-- Blue CAS Manager Function +-- Detects and triggers state changes in CASAir1 FSM +-- Basically check state every 60 seconds and take an action +function BlueCASManager() + local detection = false + + -- Determine if flight avail or already assigned + if ActiveCASGroupName == "" then + CASGroup1 = SpawnNewCASGroup() + end + --MessageToAll("CASGroup 1 = " .. CASGroup1:GetName(), 15) + + -- Display detection report if detected targets + if ReconDetection.DetectedItemCount > 0 then + detection = true + bluedetectiontimer = timer.getTime() + 300 -- send RTB after 5 minutes of 0 contacts + DetectionReport = ReconDetection:DetectedReportDetailed() + MessageToAll(DetectionReport, 15) + else + detection = false + end + -- Drive through CAS Groups + for Group, Fsm in pairs(CASGroups) do + local mystate = Fsm:GetState() + local CASAir1 = Fsm + + + local tempgroup = GROUP:FindByName( Group ) + local tempgroupname = tempgroup:GetName() + local tempcoalition = tempgroup:GetCoalition() + --MessageToAll( "GroupName = " .. tempgroupname .. " " .. mystate, 15) + + -- if patrolling engage if detected targets + if mystate == "Patrolling" then + if engaged == false then + if ReconDetection.DetectedItemCount > 0 then + Fsm:__Engage( 2, 350, 2500) + -- start engage Timer so we can stop after 20 minutes + CASEngagedTimer[tempgroupname] = timer.getTime() + 1500 + CASEngageFlag[tempgroupname] = true + engaged = true + end + end + end + -- if engaging then check timers to see when to stop + if mystate == "Engaging" then + if timer.getTime() > CASEngagedTimer[tempgroupname] then + Fsm:__RTB(2) + engaged = false + CASEngagedTimer[tempgroupname] = 0 + CASEngageFlag[tempgroupname] = false + + else + --MessageToAll( "Detection Timer: " .. bluedetectiontimer .. " " .. timer.getTime(), 15) + -- if no targets keep looking for 5 minutes and rtb + if ReconDetection.DetectedItemCount == 0 then + if timer.getTime() > bluedetectiontimer then + Fsm:__RTB(2) + engaged = false + bluedetectiontimer = 0 + CASEngagedTimer[tempgroupname] = 0 + CASEngageFlag[tempgroupname] = false + + end + end + end -- end timer.getTime() + end + + -- here we launch a replacement as soon as flight hits returning state. + -- possible via adding additional transition called 'Stage' to AI_CAS_ZONE FSM (defined in spawn manager below) + if mystate == "Returning" then + Fsm:__Stage(30) + end + -- if crashed then mark in status table dead and set ActiveCASGroupName to nil, which will spawn a new flight + -- cleanup all other flags for active flight + if mystate == "Crashed" then + ActiveCASGroupName = "" + for x=1, MaxBlueCAS do + local mytempgroup = BlueCASGroupTable[tempgroupname] + if mytempgroup == tempgroupname then + BlueCASGroupStatusTable[x] = "Dead" + break + end + end + -- Cleanup current flags + engaged = false + detectiontimer = 0 + detection = false + CASEngagedTimer[tempgroupname] = 0 + CASEngageFlag[tempgroupname] = false + CASGroups[tempgroupname] = nil + end + + if mystate == "Stopped" then + CASEngageFlag[tempgroupname] = false + CASEngagedTimer[tempgroupname] = 0 + engaged = false + CASGroups[tempgroupname] = nil + end + -- continuing flags management + if mystate == "Staged" then + ActiveCASGroupName = "" + Fsm:Stop() + end + end + +end + + +-- Setup for SpawnNewCASGroup Function +CASAirPointer = "CASAir1" +BlueCASGroupCounter = 0 +ActiveCASGroupName = "" +CASGroups = {} +CASEngagedTimer = {} +CASEngageFlag = {} +engaged = false +BlueCASPatrolZone = ZONE:New( "Blue CAS Patrol Zone" ) +BlueCASEngageZone = ZONE:New( "Blue CAS Engage Zone" ) + +-- Function SPAWN New CAS +-- Check that there are avail flights to use and if so Spawn one. +-- Assign spawned aircraft AI_CAS_ZONE +-- Set some flags for maintaining logic +function SpawnNewCASGroup() + MessageToAll("Assigning CAS", 15) + -- get AI_CAS_ZONE Ready for some planes + local CASAir1 = AI_CAS_ZONE:New( BlueCASPatrolZone, 5000, 5500, 250, 270, BlueCASEngageZone ) + + -- look for 'avail' flight + for x=1, MaxBlueCAS do + local CASFlightStatus = BlueCASGroupStatusTable[x] + if CASFlightStatus == "Avail" then + MessageToAll("CAS Status = AVAIL", 15) + --Spawn a CAS Flight + CASGroup = BlueCASGroup:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Kobuleti ), SPAWN.Takeoff.Runway, 2000 ) + local CASGroupName = CASGroup:GetName() + BlueCASGroupStatusTable[x] = "Inflight" + ActiveCASGroupName = "Inflight" + CASAir1:SetControllable( CASGroup ) + CASAir1:__Start(30) + CASGroups[CASGroupName] = CASAir1 + CASEngagedTimer[CASGroupName] = 0 + CASEngageFlag[CASGroupName] = false + BlueCASGroupTable[x] = CASGroupName + break + else + -- Will flip back to avail if CAS flight lands + BlueCASGroupStatusTable[x] = "Dead" + end + end + + CASAir1:AddTransition( "Returning", "Stage", "Staged" ) + --- OnLeave Transition Handler for State Staged. + -- @function [parent=#AI_PATROL_ZONE] OnLeaveStaged + -- @param #AI_PATROL_ZONE self + -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + -- @return #boolean Return false to cancel Transition. + + --- OnEnter Transition Handler for State Staged. + -- @function [parent=#AI_PATROL_ZONE] OnEnterStaged + -- @param #AI_PATROL_ZONE self + -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + + --- OnBefore Transition Handler for Event Stage. + -- @function [parent=#AI_PATROL_ZONE] OnBeforeStage + -- @param #AI_PATROL_ZONE self + -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + -- @return #boolean Return false to cancel Transition. + + --- OnAfter Transition Handler for Event Stage. + -- @function [parent=#AI_PATROL_ZONE] OnAfterStage + -- @param #AI_PATROL_ZONE self + -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. + -- @param #string From The From State string. + -- @param #string Event The Event string. + -- @param #string To The To State string. + + --- Synchronous Event Trigger for Event Stage. + -- @function [parent=#AI_PATROL_ZONE] Stage + -- @param #AI_PATROL_ZONE self + + --- Asynchronous Event Trigger for Event Stage. + -- @function [parent=#AI_PATROL_ZONE] __Stage + -- @param #AI_PATROL_ZONE self + -- @param #number Delay The delay in seconds. + + CASAir1:AddTransition("Stopped", "Stage", "Staged") + CASAir1:AddTransition("Staged", "Route", "Patrolling") + CASAir1:AddTransition("Staged", "Stop", "Stopped") + + return CASGroup +end + +-- Triggered when detection happens +-- Also smokes red detected targets +function ReconDetection:OnAfterDetected( From, Event, To, DetectedUnits ) + for DetectedUnitID, DetectedUnit in pairs( DetectedUnits ) do + local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT + local detectedunitvec2 = DetectedUnit:GetVec2() + +-- --Move Engagement Zone to Contact from Red Recon + BlueCASEngageZone:SetVec2(detectedunitvec2) + DetectedUnit:SmokeRed() + end +end + +-- ************************************** +-- End of Blue CAS +-- ************************************* + + SchedulerObject, SchedulerID = SCHEDULER:New( nil, BlueCASManager, {}, 30, 60 ) diff --git a/CAS - Close Air Support/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.miz b/AI/AI_CAS/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.miz similarity index 100% rename from CAS - Close Air Support/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.miz rename to AI/AI_CAS/CAS-112 - Moose Detection and AI_CAS_ZONE/CAS-112 - Moose Detection and AI_CAS_ZONE.miz diff --git a/CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/Moose.lua b/AI/AI_CAS/CAS-112 - Moose Detection and AI_CAS_ZONE/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-111 - Multiple CAS in 1 Radius Zone by Helicopter and AirPlane Groups/Moose.lua rename to AI/AI_CAS/CAS-112 - Moose Detection and AI_CAS_ZONE/Moose.lua diff --git a/AMT - AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.lua b/Functional/AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.lua similarity index 97% rename from AMT - AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.lua rename to Functional/AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.lua index 2ebd2ba318..843aa71e62 100644 --- a/AMT - AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.lua +++ b/Functional/AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.lua @@ -1,57 +1,57 @@ -------------------------------------------------------------------------- --- AmmoTruck 100 - NTTR - Basic -------------------------------------------------------------------------- --- Documentation --- --- AMMOTRUCK: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.AmmoTruck.html --- -------------------------------------------------------------------------- --- Join the game master slot. The howitzers are firing at the red --- bunkers. When close to out of ammunition, trucks will drive towards --- the artillery pieces and reload them. -------------------------------------------------------------------------- --- Date: November 2022 -------------------------------------------------------------------------- - - -BASE:TraceOn() -BASE:TraceClass("AMMOTRUCK") - -local truckset = SET_GROUP:New():FilterCoalitions("blue"):FilterActive(true):FilterCategoryGround():FilterPrefixes("Truck"):FilterStart() -local ariset = SET_GROUP:New():FilterCoalitions("blue"):FilterActive(true):FilterCategoryGround():FilterPrefixes("Artillery"):FilterStart() - -local ammotruck = AMMOTRUCK:New(truckset,ariset,coalition.side.BLUE,"Logistics",ZONE:FindByName("HomeZone")) -ammotruck.waitingtime = 60*15 -ammotruck.unloadtime = 60*10 -ammotruck.monitor = -30 -ammotruck.ammothreshold = 5 -ammotruck.usearmygroup = true - ---Truck has been sent off: - function ammotruck:OnAfterRouteTruck(From, Event, To, Truckdata, Aridata) - local m = MESSAGE:New("Truck "..Truckdata.name.." on the way!",15,"AmmoTruck"):ToBlue() - end - - ---Truck has arrived: - function ammotruck:OnAfterTruckArrived(From, Event, To, Truckdata) - local m = MESSAGE:New("Truck "..Truckdata.name.." arrived!",15,"AmmoTruck"):ToBlue() - end - - ---Truck is returning home: - function ammotruck:OnAfterTruckReturning(From, Event, To, Truckdata) - local m = MESSAGE:New("Truck "..Truckdata.name.." returning!",15,"AmmoTruck"):ToBlue() - end - - ---Truck is arrived at home: - function ammotruck:OnAfterTruckHome(From, Event, To, Truckdata) - local m = MESSAGE:New("Truck "..Truckdata.name.." arrived home!",15,"AmmoTruck"):ToBlue() - end - - -local trucks = SPAWN:New("Truck") - :InitLimit(5,0) - :InitRandomizePosition(true,100,10) - :SpawnScheduled(15,0) +------------------------------------------------------------------------- +-- AmmoTruck 100 - NTTR - Basic +------------------------------------------------------------------------- +-- Documentation +-- +-- AMMOTRUCK: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.AmmoTruck.html +-- +------------------------------------------------------------------------- +-- Join the game master slot. The howitzers are firing at the red +-- bunkers. When close to out of ammunition, trucks will drive towards +-- the artillery pieces and reload them. +------------------------------------------------------------------------- +-- Date: November 2022 +------------------------------------------------------------------------- + + +BASE:TraceOn() +BASE:TraceClass("AMMOTRUCK") + +local truckset = SET_GROUP:New():FilterCoalitions("blue"):FilterActive(true):FilterCategoryGround():FilterPrefixes("Truck"):FilterStart() +local ariset = SET_GROUP:New():FilterCoalitions("blue"):FilterActive(true):FilterCategoryGround():FilterPrefixes("Artillery"):FilterStart() + +local ammotruck = AMMOTRUCK:New(truckset,ariset,coalition.side.BLUE,"Logistics",ZONE:FindByName("HomeZone")) +ammotruck.waitingtime = 60*15 +ammotruck.unloadtime = 60*10 +ammotruck.monitor = -30 +ammotruck.ammothreshold = 5 +ammotruck.usearmygroup = true + +--Truck has been sent off: + function ammotruck:OnAfterRouteTruck(From, Event, To, Truckdata, Aridata) + local m = MESSAGE:New("Truck "..Truckdata.name.." on the way!",15,"AmmoTruck"):ToBlue() + end + + +--Truck has arrived: + function ammotruck:OnAfterTruckArrived(From, Event, To, Truckdata) + local m = MESSAGE:New("Truck "..Truckdata.name.." arrived!",15,"AmmoTruck"):ToBlue() + end + + +--Truck is returning home: + function ammotruck:OnAfterTruckReturning(From, Event, To, Truckdata) + local m = MESSAGE:New("Truck "..Truckdata.name.." returning!",15,"AmmoTruck"):ToBlue() + end + + +--Truck is arrived at home: + function ammotruck:OnAfterTruckHome(From, Event, To, Truckdata) + local m = MESSAGE:New("Truck "..Truckdata.name.." arrived home!",15,"AmmoTruck"):ToBlue() + end + + +local trucks = SPAWN:New("Truck") + :InitLimit(5,0) + :InitRandomizePosition(true,100,10) + :SpawnScheduled(15,0) diff --git a/AMT - AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.miz b/Functional/AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.miz similarity index 100% rename from AMT - AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.miz rename to Functional/AmmoTruck/AmmoTruck 100 - NTTR - Basic/AmmoTruck 100 - NTTR - Basic.miz diff --git a/CAS - Close Air Support/CAS-112 - Moose Detection and AI_CAS_ZONE/Moose.lua b/Functional/AmmoTruck/AmmoTruck 100 - NTTR - Basic/Moose.lua similarity index 100% rename from CAS - Close Air Support/CAS-112 - Moose Detection and AI_CAS_ZONE/Moose.lua rename to Functional/AmmoTruck/AmmoTruck 100 - NTTR - Basic/Moose.lua