mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'refs/remotes/origin/master' into FlightControl
# Conflicts: # Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua # Moose Mission Setup/Moose.lua # Moose Test Missions/CAP - Combat Air Patrol/CAP-001 - Combat Air Patrol/CAP-001 - Combat Air Patrol.miz # Moose Test Missions/CAP - Combat Air Patrol/CAP-010 - CAP and Engage within Range/CAP-010 - CAP and Engage within Range.miz # Moose Test Missions/CAP - Combat Air Patrol/CAP-011 - CAP and Engage within Zone/CAP-011 - CAP and Engage within Zone.miz # Moose Test Missions/CAP - Combat Air Patrol/CAP-020 - Combat Air Patrol RTB Test/CAP-020 - Combat Air Patrol RTB Test.miz # Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a ZONE-ME Test.miz # Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a Zone by Airplane Group/CAS-001 - CAS in a Zone by Airplane Group.miz # Moose Test Missions/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 # Moose Test Missions/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 # Moose Test Missions/CAS - Close Air Support/CAS-010 - CAS in a Zone by Helicopter/CAS-010 - CAS in a Zone by Helicopter.miz # Moose Test Missions/CAS - Close Air Support/CAS-011 - CAS in a Zone by Helicopter Group/CAS-011 - CAS in a Zone by Helicopter Group.miz # Moose Test Missions/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 # Moose Test Missions/SPA - Spawning/SPA-010 - Spawn Demo/SPA-010 - Spawn Demo.miz # Moose Test Missions/SPA - Spawning/SPA-011 - Ground Ops - Simple Spawning/SPA-011 - Ground Ops - Simple Spawning.miz # Moose Test Missions/SPA - Spawning/SPA-012 - Ground Ops - Multiple Spawns/SPA-012 - Ground Ops - Multiple Spawns.miz # Moose Test Missions/SPA - Spawning/SPA-013 - Ground Ops - Scheduled Spawns/SPA-013 - Ground Ops - Scheduled Spawns.miz # Moose Test Missions/SPA - Spawning/SPA-014 - Ground Ops - Scheduled Spawns Limited/SPA-014 - Ground Ops - Scheduled Spawns Limited.miz # Moose Test Missions/SPA - Spawning/SPA-015 - Ground Ops - Randomize Route/SPA-015 - Ground Ops - Randomize Route.miz # Moose Test Missions/SPA - Spawning/SPA-016 - Ground Ops - Randomize Zones/SPA-016 - Ground Ops - Randomize Zones.miz # Moose Test Missions/SPA - Spawning/SPA-017 - Ground Ops - Set AI inactive while spawning/SPA-017 - Ground Ops - Set AI inactive while spawning.miz # Moose Test Missions/SPA - Spawning/SPA-018 - Ground Ops - Randomize Templates/SPA-018 - Ground Ops - Randomize Templates.miz # Moose Test Missions/SPA - Spawning/SPA-019 - Ground Ops - Randomize Templates without Waypoints/SPA-019 - Ground Ops - Randomize Templates without Waypoints.miz # Moose Test Missions/SPA - Spawning/SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints/SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints.miz # Moose Test Missions/SPA - Spawning/SPA-100 - CleanUp Inactive Units/SPA-100 - CleanUp Inactive Units.miz # Moose Test Missions/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz # Moose Test Missions/SPA - Spawning/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit/SPA-120 - Air Ops - Scheduled Spawn with Repeat on Landing with Limit.miz # Moose Test Missions/SPA - Spawning/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit/SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit.miz # Moose Test Missions/SPA - Spawning/SPA-130 - Uncontrolled Spawning/SPA-130 - Uncontrolled Spawning.miz # Moose Test Missions/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz # Moose Test Missions/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz # Moose Test Missions/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz # Moose Test Missions/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz # Moose Test Missions/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz # Moose Test Missions/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz # docs/Documentation/AI_Cas.html
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
---
|
||||
-- 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.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
Binary file not shown.
@@ -0,0 +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
|
||||
local 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
|
||||
local 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
|
||||
local 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)
|
||||
local 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
|
||||
local 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
|
||||
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
---
|
||||
-- Name: SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||
-- 3. There should not be more than 5 groups spawned.
|
||||
-- 4. Observe the unit names, they should have the name as defined within the ME.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN
|
||||
:New( "Spawn Vehicle 1" )
|
||||
:InitKeepUnitNames()
|
||||
:InitLimit( 5, 10 )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,73 @@
|
||||
---
|
||||
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points.
|
||||
-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
||||
--
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
Binary file not shown.
Reference in New Issue
Block a user