Merge remote-tracking branch 'refs/remotes/origin/master' into Detection

# Conflicts:
#	Moose Test
Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz
This commit is contained in:
FlightControl
2016-07-06 22:26:23 +02:00
15 changed files with 800 additions and 50138 deletions

View File

@@ -1,63 +0,0 @@
local FACGroup = GROUP:FindByName( "FAC Group Lase" )
local FACDetection = DETECTION_BASE:New( FACGroup, 1000, 250 )
local LaseScheduler = SCHEDULER:New(nil,
--- @param Group#GROUP FACGroup
-- @param Detection#DETECTION_BASE FACDetection
function( FACGroup, FACDetection )
if FACDetection:GetDetectionUnitSetCount() > 0 then
local DetectedUnitSet = FACDetection:GetDetectionUnitSet(1)
if DetectedUnitSet then
FACDetection:E( { "I have a unit set ", DetectedUnitSet } )
local FACUnit = FACGroup:GetUnit(1)
if FACUnit then
FACDetection:E( FACUnit )
local FACDCSUnit = FACUnit:GetDCSUnit()
local FACUnitController = FACDCSUnit:getController()
DetectedUnitSet:ForEachUnit(
--- @param Unit#UNIT DetectedUnit
function( DetectedUnit, FACDCSUnit )
FACDetection:E( DetectedUnit:GetDCSUnit() )
FACDetection:E( FACDCSUnit )
local JTAC = Spot.createInfraRed( FACDCSUnit, {x = 0, y = 2.0, z = 0}, DetectedUnit:GetPointVec3(), 1337)
end, FACDCSUnit
)
end
end
end
end, { FACGroup, FACDetection },
30
)
local LaseScheduler2 = SCHEDULER:New(nil,
--- @param Group#GROUP FACGroup
-- @param Detection#DETECTION_BASE FACDetection
function( FACGroup, FACDetection )
if FACDetection:GetDetectionUnitSetCount() > 0 then
local DetectedUnitSet = FACDetection:GetDetectionUnitSet(1)
if DetectedUnitSet then
FACDetection:E( { "I have a unit set ", DetectedUnitSet } )
local FACUnit = FACGroup:GetUnit(1)
if FACUnit then
FACDetection:E( FACUnit )
local FACDCSUnit = FACUnit:GetDCSUnit()
local FACUnitController = FACDCSUnit:getController()
DetectedUnitSet:ForEachUnit(
--- @param Unit#UNIT DetectedUnit
function( DetectedUnit, FACDCSUnit )
FACDetection:E( DetectedUnit:GetDCSUnit() )
FACDetection:E( FACDCSUnit )
local TargetIsDetected, TargetIsVisible, TargetLastTime, TargetKnowType, TargetKnowDistance, TargetLastPos, TargetLastVelocity
= FACUnitController:isTargetDetected( DetectedUnit:GetDCSUnit(), Controller.Detection.IRST )
FACDetection:E( { TargetIsDetected, TargetIsVisible, TargetLastTime, TargetKnowType, TargetKnowDistance, TargetLastPos, TargetLastVelocity } )
end, FACDCSUnit
)
end
end
end
end, { FACGroup, FACDetection },
40
)

View File

@@ -9,29 +9,7 @@ local TargetSet = SET_UNIT:New():FilterPrefixes( "US Hawk SR" ):FilterStart()
local TargetZone = ZONE:New( "Target Zone" )
local Task_Menu = TASK2_MENU_CLIENT:New( Mission, Client, "SEAD" )
local Task_Route = TASK2_ROUTE_CLIENT:New( Mission, Client, TargetZone ) -- The target location is dynamically defined in state machine
local Task_Client_Sead = TASK2_SEAD_CLIENT:New( Mission, Client, TargetSet )
Task_Client_Sead:AddScore( "Destroy", "Destroyed RADAR", 25 )
Task_Client_Sead:AddScore( "Success", "Destroyed all radars!!!", 100 )
local Task_Sead = STATEMACHINE:New( {
initial = 'None',
events = {
{ name = 'Start', from = 'None', to = 'Unassigned' },
{ name = 'Next', from = 'Unassigned', to = 'Assigned' },
{ name = 'Next', from = 'Assigned', to = 'Success' },
{ name = 'Fail', from = 'Assigned', to = 'Failed' },
{ name = 'Fail', from = 'Arrived', to = 'Failed' }
},
subs = {
Menu = { onstateparent = 'Unassigned', oneventparent = 'Start', fsm = Task_Menu.Fsm, event = 'Menu', returnevents = { 'Next' } },
Route = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = Task_Route.Fsm, event = 'Route' },
Sead = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = Task_Client_Sead.Fsm, event = 'Await', returnevents = { 'Next' } }
}
} )
Task_Sead:Start()
local Task_SEAD = TASK_SEAD:New( TargetSet, TargetZone )