Made user exits for Mission Completion evaluation...

Man, this is going to rock!
This commit is contained in:
FlightControl
2017-03-15 10:08:03 +01:00
parent 450892bfd9
commit 9fc3f7a601
11 changed files with 71186 additions and 41 deletions

View File

@@ -32,3 +32,14 @@ local FACAreas = DETECTION_UNITS:New( FACSet )
local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart()
local TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, HQ, 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...
function Mission:OnBeforeComplete( From, Event, To )
local Group004 = GROUP:FindByName( "Target #004" )
if Group004:IsAlive() == false then
Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" )
return true
end
return false
end