CAS first prototype

This commit is contained in:
FlightControl
2017-01-13 14:05:09 +01:00
parent f5f59c4137
commit 60bb6de4a5
12 changed files with 1933 additions and 485 deletions

View File

@@ -0,0 +1,37 @@
-- Name: CAS in a ZONE
-- Author: FlightControl
-- Date Created: 13 January 2017
--
-- # Situation:
--
-- # Test cases:
--
local CASEngagementZone = ZONE:New( "Engagement Zone" )
local CASPlane = GROUP:FindByName( "Plane" )
local PatrolZone = ZONE:New( "Patrol Zone" )
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 350, 600, CASEngagementZone )
local Targets = GROUP:FindByName("Targets")
AICasZone:SetControllable(CASPlane)
AICasZone:__Start(1)
AICasZone:__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 = SCHEDULER:New(nil,
function()
BASE:E( { "In Scheduler: ", Targets:GetSize() } )
if Targets:IsAlive() and Targets:GetSize() ~= 0 then
BASE:E("Still alive")
else
BASE:E("Destroyed")
AICasZone:__Completed(1)
end
end, {}, 20, 60, 0.2 )