Updated Moose.lua

This commit is contained in:
funkyfranky 2024-01-01 18:39:00 +00:00
parent 6f570db72f
commit 5aa1e1a63a
439 changed files with 1210 additions and 1210 deletions

View File

@ -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 } )

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More