Final commit ...

This commit is contained in:
FlightControl
2017-03-17 21:49:06 +01:00
parent ce00cbf83e
commit 4e59f1a674
137 changed files with 70413 additions and 53 deletions

View File

@@ -0,0 +1,46 @@
---
-- Name: TAD-010 - A2G Task Dispatching Destroy Test
-- Author: FlightControl
-- Date Created: 17 Mar 2017
--
-- # Situation:
--
-- This tests if an accepted task successful completion does finish the processes correctly.
--
-- # Test cases:
--
--
local HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
local CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
Scoring = SCORING:New( "Detect Demo" )
local Mission = MISSION
:New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED )
:AddScoring( Scoring )
local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart()
local FACAreas = DETECTION_UNITS:New( FACSet )
local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart()
local TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas )
-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004.
-- This is just an example, but many more examples can follow...
-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission.
-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion
-- too early!
function Mission:OnBeforeComplete( From, Event, To )
local Group004 = GROUP:FindByName( "Target #004" )
if Group004 and Group004:IsAlive() == false then
Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" )
return true
end
return false
end