diff --git a/Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a ZONE/CAS-001 - CAS in a ZONE.lua b/Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a ZONE/CAS-001 - CAS in a ZONE.lua index 65b0901f8..f5f267f69 100644 --- a/Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a ZONE/CAS-001 - CAS in a ZONE.lua +++ b/Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a ZONE/CAS-001 - CAS in a ZONE.lua @@ -6,21 +6,36 @@ -- -- # Test cases: -- - +-- 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") -AICasZone:SetControllable(CASPlane) +-- 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 5 minutes, engage +-- 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. @@ -38,11 +53,7 @@ Check, CheckScheduleID = SCHEDULER:New(nil, end, {}, 20, 60, 0.2 ) --- When the targets in the zone are destroyed, (see scheduled function), the planes will return homs... +-- When the targets in the zone are destroyed, (see scheduled function), the planes will return home ... function AICasZone:OnAfterAccomplish( Controllable, From, Event, To ) - AICasZone:__RTB( 1 ) end - - - diff --git a/Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a ZONE/CAS-001 - CAS in a ZONE.miz b/Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a ZONE/CAS-001 - CAS in a ZONE.miz index daf610748..92409f3f6 100644 Binary files a/Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a ZONE/CAS-001 - CAS in a ZONE.miz and b/Moose Test Missions/CAS - Close Air Support/CAS-001 - CAS in a ZONE/CAS-001 - CAS in a ZONE.miz differ