Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Blue_CC = COMMANDCENTER:New( GROUP:FindByName( "Blue HQ"), "HQ" )
- local Red_CC = COMMANDCENTER:New( GROUP:FindByName( "Red HQ"), "HQ" )
- RedDetectionSetGroup = SET_GROUP:New():FilterPrefixes({ "Red EWR" }):FilterCoalitions(coalition.side.BLUE):FilterStart()
- BlueDetectionSetGroup = SET_GROUP:New():FilterPrefixes({ "Blue EWR" }):FilterCoalitions(coalition.side.RED):FilterStart()
- Red_DetectionSetZones = SET_ZONE:New():FilterPrefixes("Red Zone"):FilterStart()
- Blue_DetectionZones = DETECTION_ZONES:New( Red_DetectionSetZones, coalition.side.RED ):FilterCategories( Unit.Category.GROUND_UNIT )
- Blue_DetectionZones:Start()
- Red_DetectionArea = DETECTION_AREAS:New( RedDetectionSetGroup, 30000)
- Red_DetectionArea:Start()
- Blue_DetectionArea = DETECTION_AREAS:New(BlueDetectionSetGroup, 30000)
- Blue_DetectionArea:Start()
- --SCHEDULER:New(nil, checkDetectedCount, {Blue_DetectionZones, "ground", blueClientA2GGroupSet}, 1, 10)
- local zone = ZONE:New("Patrol Zone 2")
- local AICAPZone = true
- BlueA2ADispatcher = AI_A2A_CAP_ZONE:New(Blue_DetectionArea, AICAPZone)
- BlueA2ADispatcher:SetSquadron("F-5E-01", AIRBASE.Caucasus.Senaki_Kolkhi, { "F-5E CAP"}, 2)
- BlueA2ADispatcher:SetSquadronFuelThreshold("F-5E-01", 0.25)
- BlueA2ADispatcher:SetSquadronCap( "F-5E-01", zone, 4000, 10000, 500, 600, 800, 900 )
- BlueA2ADispatcher:SetSquadronCapInterval( "F-5E-01", 2, 30, 60, 1 )
- BlueA2ADispatcher:SetTacticalDisplay(true)
- BlueA2ADispatcher:SetDisengageRadius(100000)
- BlueA2ADispatcher:SetDefaultDamageThreshold(0.75)
- BlueA2ADispatcher:SetDefaultGrouping(2)
- A2ADispatcher = AI_A2A_CAP_ZONE:New(Red_DetectionArea, AICAPZone)
- local RedSquadrons = {
- "MiG-19 CAP",
- "MiG-21 CAP"
- }
- local RandomAirframe = RedSquadrons[math.random(1, #RedSquadrons)]
- A2ADispatcher:SetSquadron("MiG-19-01", AIRBASE.Caucasus.Kobuleti, { RandomAirframe }, 10)
- A2ADispatcher:SetSquadronFuelThreshold("MiG-19-01", 0.25)
- A2ADispatcher:SetSquadronCap( "MiG-19-01", zone, 35000, 70000, 800, 900, 800, 900 )
- A2ADispatcher:SetSquadronCapInterval( "MiG-19-01", 1, 30, 60, 1 )
- A2ADispatcher:SetTacticalDisplay(true)
- A2ADispatcher:SetDisengageRadius(10000000)
- A2ADispatcher:SetDefaultDamageThreshold(0.75)
- A2ADispatcher:SetDefaultGrouping(2)
- local MiG19GroupSet = SET_GROUP:New():FilterPrefixes("MiG-19 CAP"):FilterStart()
- local PatrolZoneSet = SET_ZONE:New():FilterPrefixes("Patrol Zone"):FilterStart()
- function UpdatePatrol(MiG19GroupSet, PatrolZoneSet)
- local MiG19GroupSet = MiG19GroupSet
- local PatrolZoneSet = PatrolZoneSet
- local RandomPatrolZone = PatrolZoneSet:GetRandomZone()
- BASE:E("MiG19 Count " .. MiG19GroupSet:Count())
- MiG19GroupSet:ForEachGroup(
- function(Group)
- if Group ~= nil then
- BASE:E("MiG19 Group " .. Group:GetName())
- if Group:GetName() ~= "MiG-19 CAP" then
- local A2AFsm = A2ADispatcher:GetDefenderTaskFsm(Group)
- A2AFsm:UpdatePatrol(RandomPatrolZone)
- end
- end
- end
- )
- end
- --SCHEDULER:New(nil, UpdatePatrol, {MiG19GroupSet, PatrolZoneSet}, 1, 300)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement