@jtff/miztemplate-lib 3.1.9 → 3.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lua/lib/HoundElint.lua +7101 -0
- package/lua/src/020-mission_functions.lua +75 -69
- package/lua/src/110-set_clients.lua +6 -6
- package/lua/src/120-tankers.lua +26 -26
- package/lua/src/130-airboss.lua +12 -12
- package/lua/src/150-awacs.lua +22 -22
- package/lua/src/173-fox_zone_training.lua +4 -4
- package/lua/src/176-random_air_traffic.lua +3 -3
- package/lua/src/178-training-intercept.lua +12 -12
- package/lua/src/195-reaper-ondemand.lua +17 -16
- package/lua/src/199-skynet.lua +134 -101
- package/package.json +1 -1
- package/scripts/inject-scripts.js +2 -2
package/lua/src/130-airboss.lua
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
function detectShitHotBreak(objAirboss)
|
|
5
5
|
local clientData={}
|
|
6
6
|
local player_name=""
|
|
7
|
-
|
|
7
|
+
jtff_log.debug('detectShitHotBreak : '.. objAirboss.customconfig.alias .. ' has ' .. objAirboss.CVNClients:Count()..' clients in Set ...',"AIRBOSS")
|
|
8
8
|
objAirboss.CVNClients:ForEachClientInZone( objAirboss.CVN_UNITZone,
|
|
9
9
|
function( MooseClient )
|
|
10
10
|
|
|
@@ -55,12 +55,12 @@ function switchCarrierDefCon2(params)
|
|
|
55
55
|
local cvUnit = UNIT:FindByName(carrierName)
|
|
56
56
|
local cvGroup = cvUnit:GetGroup()
|
|
57
57
|
cvGroup:OptionROE(ENUMS.ROE.WeaponFree):OptionAlarmStateRed()
|
|
58
|
-
|
|
58
|
+
jtff_log.info(string.format("CSG : %s DEFCON 2 -> ROE = %d", carrierName, ENUMS.ROE.WeaponFree),"AIRBOSS")
|
|
59
59
|
SCHEDULER:New(
|
|
60
60
|
nil,
|
|
61
61
|
function(carrierName)
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
jtff_log.info(carrierName .. " switchback to DEFCON 4","AIRBOSS")
|
|
63
|
+
jtff_log.info(string.format("CSG : %s DEFCON 4 -> ROE = %d", carrierName, ENUMS.ROE.ReturnFire),"AIRBOSS")
|
|
64
64
|
UNIT:FindByName(carrierName):GetGroup():OptionROE(ENUMS.ROE.ReturnFire):OptionAlarmStateRed()
|
|
65
65
|
end,
|
|
66
66
|
{ carrierName },
|
|
@@ -79,20 +79,20 @@ function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop)
|
|
|
79
79
|
if (CVNCoordinates) then
|
|
80
80
|
if ((timer.getAbsTime() >= (CVNCoordinates:GetSunset(true) - 30*60)) or (timer.getAbsTime() <= (CVNCoordinates:GetSunrise(true) + 30*60))) then
|
|
81
81
|
--Navy Night conditions
|
|
82
|
-
|
|
82
|
+
jtff_log.info("CASE III weather : Navy Night", "AIRBOSS")
|
|
83
83
|
return 3
|
|
84
84
|
end
|
|
85
85
|
if (recovery_stop) then
|
|
86
86
|
if (recovery_stop > (CVNCoordinates:GetSunset(true) - 30*60)) then
|
|
87
87
|
--recovery_stop after Navy SunSet
|
|
88
|
-
|
|
88
|
+
jtff_log.info("CASE III weather : Recovery ending after Navy SunSet", "AIRBOSS")
|
|
89
89
|
return 3
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
92
|
if (recovery_start) then
|
|
93
93
|
if (recovery_start < (CVNCoordinates:GetSunrise(true) + 30*60)) then
|
|
94
94
|
--recover_start before Navy SunRise
|
|
95
|
-
|
|
95
|
+
jtff_log.info("CASE III weather : Recovery starting before Navy SunRise","AIRBOSS")
|
|
96
96
|
return 3
|
|
97
97
|
end
|
|
98
98
|
end
|
|
@@ -111,7 +111,7 @@ function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop)
|
|
|
111
111
|
fog = weather.fog
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
--
|
|
114
|
+
-- jtff_log.trace(string.format("visibility : %i | cloud : base %i density %i | fog %i,%i | dust %i", visibility, clouds.base, clouds.density, fog.thickness, fog.visibility, dust),"AIRBOSS")
|
|
115
115
|
local minVisibility = visibility
|
|
116
116
|
if (weather.enable_fog and fog.thickness > 0) then
|
|
117
117
|
minVisibility = math.min(minVisibility,fog.visibility)
|
|
@@ -122,17 +122,17 @@ function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop)
|
|
|
122
122
|
|
|
123
123
|
if (minVisibility > UTILS.NMToMeters(5)) then
|
|
124
124
|
if (clouds.base > UTILS.FeetToMeters(3000)) then
|
|
125
|
-
|
|
125
|
+
jtff_log.debug("CASE I weather","AIRBOSS")
|
|
126
126
|
return 1
|
|
127
127
|
elseif (clouds.base > UTILS.FeetToMeters(1000)) then
|
|
128
|
-
|
|
128
|
+
jtff_log.debug("CASE II weather","AIRBOSS")
|
|
129
129
|
return 2
|
|
130
130
|
else
|
|
131
|
-
|
|
131
|
+
jtff_log.debug("CASE III weather","AIRBOSS")
|
|
132
132
|
return 3
|
|
133
133
|
end
|
|
134
134
|
else
|
|
135
|
-
|
|
135
|
+
jtff_log.debug("CASE III weather","AIRBOSS")
|
|
136
136
|
return 3
|
|
137
137
|
end
|
|
138
138
|
end
|
package/lua/src/150-awacs.lua
CHANGED
|
@@ -8,7 +8,7 @@ MenuCoalitionAwacsRed = MENU_COALITION:New(coalition.side.RED, "Awacs", MenuCoal
|
|
|
8
8
|
for index, awacsconfig in ipairs(AwacsConfig) do
|
|
9
9
|
if awacsconfig.enable == true then
|
|
10
10
|
compteur = compteur + 1
|
|
11
|
-
|
|
11
|
+
jtff_log.info('creation AWACS : '.. awacsconfig.groupName..'...',"AWACS")
|
|
12
12
|
local objAwacs = RECOVERYTANKER:New(UNIT:FindByName(awacsconfig.patternUnit), awacsconfig.groupName)
|
|
13
13
|
:SetAWACS(true, true)
|
|
14
14
|
:SetRespawnOnOff(awacsconfig.autorespawn)
|
|
@@ -32,7 +32,7 @@ for index, awacsconfig in ipairs(AwacsConfig) do
|
|
|
32
32
|
end
|
|
33
33
|
objAwacs.customconfig = awacsconfig
|
|
34
34
|
function objAwacs:OnAfterStart(from, event, to)
|
|
35
|
-
|
|
35
|
+
jtff_log.info('popup AWACS : '..self.tanker.GroupName, "AWACS")
|
|
36
36
|
if self.customconfig.escortgroupname then
|
|
37
37
|
self.escortSpawnObject = SPAWN:NewWithAlias(self.customconfig.escortgroupname,'escort-'.. self.customconfig.groupName)
|
|
38
38
|
:InitRepeatOnEngineShutDown()
|
|
@@ -83,9 +83,9 @@ for index, awacsconfig in ipairs(AwacsConfig) do
|
|
|
83
83
|
end
|
|
84
84
|
function objAwacs:OnAfterRTB(from, event, to, airbase)
|
|
85
85
|
if self.customconfig.escortgroupname then
|
|
86
|
-
|
|
86
|
+
jtff_log.info('RTB: '..self.tanker.GroupName..'...',"AWACS")
|
|
87
87
|
if self.escortGroupObject:IsAirborne(false) == true then
|
|
88
|
-
|
|
88
|
+
jtff_log.info('escort RTB : '.. self.escortGroupObject.GroupName..' Tanker : '..self.tanker.GroupName..'...',"AWACS")
|
|
89
89
|
self.escortGroupObject:RouteRTB(airbase)
|
|
90
90
|
else
|
|
91
91
|
--self.escortGroupObject:Destroy(nil, 5)
|
|
@@ -94,14 +94,14 @@ for index, awacsconfig in ipairs(AwacsConfig) do
|
|
|
94
94
|
end
|
|
95
95
|
function objAwacs:OnEventKill(event)
|
|
96
96
|
if self.customconfig.escortgroupname then
|
|
97
|
-
|
|
97
|
+
jtff_log.info(event.target' Killed !! Sending escort Home',"AWACS")
|
|
98
98
|
self.escortGroupObject:RouteRTB(AIRBASE:FindByName(self.customconfig.baseUnit))
|
|
99
99
|
end
|
|
100
100
|
end
|
|
101
101
|
function objAwacs:OnAfterStatus(from, event, to)
|
|
102
102
|
if ((self.customconfig.escortgroupname) and (self.escortGroupObject)) then
|
|
103
103
|
if not(GROUP:FindByName(self.escortGroupObject.GroupName)) then
|
|
104
|
-
|
|
104
|
+
jtff_log.info('Respawning escort Group '..self.escortGroupObject.GroupName,"AWACS")
|
|
105
105
|
self.escortGroupObject = self.escortSpawnObject
|
|
106
106
|
:SpawnAtAirbase(AIRBASE:FindByName(self.customconfig.baseUnit),SPAWN.Takeoff.Cold, self.customconfig.altitude)
|
|
107
107
|
end
|
|
@@ -125,7 +125,7 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
125
125
|
if (OnDemandAwacsConfig) then
|
|
126
126
|
for index, OnDemandAwacs in ipairs(OnDemandAwacsConfig) do
|
|
127
127
|
if ((OnDemandAwacs.type == type) and (OnDemandAwacs.enable)) then
|
|
128
|
-
|
|
128
|
+
jtff_log.debug(string.format('Found type %s Awacs : %s Group!', type, OnDemandAwacs.groupName),"AWACS")
|
|
129
129
|
if (askedSpeed and askedSpeed > 0) then
|
|
130
130
|
OnDemandAwacs.speed = askedSpeed
|
|
131
131
|
end
|
|
@@ -189,7 +189,7 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
189
189
|
local aliveAwacsGroupList = set_group_awacs:GetSetObjects()
|
|
190
190
|
|
|
191
191
|
local is_awacs_spawned = false
|
|
192
|
-
|
|
192
|
+
jtff_log.debug(string.format('Looking for a Group corresponding to template %s', string.format("%s-%s", OnDemandAwacs.groupName, OnDemandAwacs.type)),"AWACS")
|
|
193
193
|
for index, current_group in ipairs(aliveAwacsGroupList) do
|
|
194
194
|
if (
|
|
195
195
|
(not(is_awacs_spawned)) and
|
|
@@ -200,7 +200,7 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
200
200
|
true
|
|
201
201
|
) ~= nil)
|
|
202
202
|
) then
|
|
203
|
-
|
|
203
|
+
jtff_log.info(string.format('Found %s corresponding to template %s', current_group.GroupName, string.format("%s-%s", OnDemandAwacs.groupName, OnDemandAwacs.type)),"AWACS")
|
|
204
204
|
is_awacs_spawned = true
|
|
205
205
|
AwacsGroup = current_group
|
|
206
206
|
end
|
|
@@ -214,7 +214,7 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
214
214
|
RTBAirbase = askedAnchorCoord:GetClosestAirbase2(Airbase.Category.AIRDROME, OnDemandAwacs.benefit_coalition)
|
|
215
215
|
end
|
|
216
216
|
if (is_awacs_spawned) then
|
|
217
|
-
|
|
217
|
+
jtff_log.info(string.format('OnDemandAwacs already in air : rerouting %s', OnDemandAwacs.groupName),"AWACS")
|
|
218
218
|
AwacsGroup:ClearTasks()
|
|
219
219
|
table.insert(
|
|
220
220
|
AwacsRoute,
|
|
@@ -278,7 +278,7 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
278
278
|
)
|
|
279
279
|
)
|
|
280
280
|
else
|
|
281
|
-
|
|
281
|
+
jtff_log.info(string.format('OnDemandAwacs Spawning %s', OnDemandAwacs.groupName),"AWACS")
|
|
282
282
|
local SpawnAwacs = SPAWN:NewWithAlias(
|
|
283
283
|
OnDemandAwacs.groupName,
|
|
284
284
|
string.format("%s-%s", OnDemandAwacs.groupName, OnDemandAwacs.type)
|
|
@@ -390,9 +390,9 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
390
390
|
end
|
|
391
391
|
if OnDemandAwacs.escortgroupname then
|
|
392
392
|
AwacsGroup.escortSpawnObject = SPAWN:NewWithAlias(OnDemandAwacs.escortgroupname,'escort-'.. OnDemandAwacs.groupName)
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
:InitRepeatOnEngineShutDown()
|
|
394
|
+
:InitSkill("Excellent")
|
|
395
|
+
:OnSpawnGroup(function(SpawnGroup)
|
|
396
396
|
taskGroupEscort({AwacsGroup, SpawnGroup})
|
|
397
397
|
end)
|
|
398
398
|
AwacsGroup.escortGroupObject = spawnRecoveryTankerEscort(AwacsGroup.escortSpawnObject,OnDemandAwacs)
|
|
@@ -451,9 +451,9 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
451
451
|
function AwacsGroup:OnEventLand(EventData)
|
|
452
452
|
COORDINATE:RemoveMark(map_marker[self:GetName()])
|
|
453
453
|
if self.custommconfig.escortgroupname then
|
|
454
|
-
|
|
454
|
+
jtff_log.info('RTB: '..self.GroupName..'...',"AWACS")
|
|
455
455
|
if self.escortGroupObject:IsAirborne(false) == true then
|
|
456
|
-
|
|
456
|
+
jtff_log.info('escort RTB : '.. self.escortGroupObject.GroupName..' AWACS : '..self.GroupName..'...',"AWACS")
|
|
457
457
|
self.escortGroupObject:RouteRTB()
|
|
458
458
|
else
|
|
459
459
|
--self.escortGroupObject:Destroy(nil, 5)
|
|
@@ -463,9 +463,9 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
463
463
|
function AwacsGroup:OnEventCrash(EventData)
|
|
464
464
|
COORDINATE:RemoveMark(map_marker[self:GetName()])
|
|
465
465
|
if self.custommconfig.escortgroupname then
|
|
466
|
-
|
|
466
|
+
jtff_log.info('RTB: '..self.GroupName..'...',"AWACS")
|
|
467
467
|
if self.escortGroupObject:IsAirborne(false) == true then
|
|
468
|
-
|
|
468
|
+
jtff_log.info('escort RTB : '.. self.escortGroupObject.GroupName..' AWACS : '..self.GroupName..'...',"AWACS")
|
|
469
469
|
self.escortGroupObject:RouteRTB()
|
|
470
470
|
else
|
|
471
471
|
--self.escortGroupObject:Destroy(nil, 5)
|
|
@@ -475,9 +475,9 @@ function triggerOnDemandAwacs(type, askedDuration, askedFL, askedSpeed, askedAnc
|
|
|
475
475
|
function AwacsGroup:OnEventDead(EventData)
|
|
476
476
|
COORDINATE:RemoveMark(map_marker[self:GetName()])
|
|
477
477
|
if self.custommconfig.escortgroupname then
|
|
478
|
-
|
|
478
|
+
jtff_log.info('RTB: '..self.GroupName..'...',"AWACS")
|
|
479
479
|
if self.escortGroupObject:IsAirborne(false) == true then
|
|
480
|
-
|
|
480
|
+
jtff_log.info('escort RTB : '.. self.escortGroupObject.GroupName..' AWACS : '..self.GroupName..'...',"AWACS")
|
|
481
481
|
self.escortGroupObject:RouteRTB()
|
|
482
482
|
else
|
|
483
483
|
--self.escortGroupObject:Destroy(nil, 5)
|
|
@@ -566,7 +566,7 @@ function AwacsMarkHandler:onEvent(event)
|
|
|
566
566
|
else
|
|
567
567
|
cmd = full
|
|
568
568
|
end
|
|
569
|
-
if
|
|
569
|
+
if log_levels[JTFF_LOGLEVEL] <= log_levels['debug'] then
|
|
570
570
|
trigger.action.outText("Full Text = " .. full, 10)
|
|
571
571
|
trigger.action.outText("Command = " .. cmd, 10)
|
|
572
572
|
if param1 ~= nil then trigger.action.outText("type = " .. param1, 10) end
|
|
@@ -578,7 +578,7 @@ function AwacsMarkHandler:onEvent(event)
|
|
|
578
578
|
end
|
|
579
579
|
|
|
580
580
|
if string.find(cmd, "awacs") then
|
|
581
|
-
if
|
|
581
|
+
if log_levels[JTFF_LOGLEVEL] <= log_levels['debug'] then
|
|
582
582
|
trigger.action.outText("DEBUG: On Demand Awacs Started!", 10)
|
|
583
583
|
end
|
|
584
584
|
awacsOnDemandArray[#awacsOnDemandArray+1] = triggerOnDemandAwacs(
|
|
@@ -6,7 +6,7 @@ compteur = 0
|
|
|
6
6
|
for index, foxzoneconfig in ipairs(FoxRangesConfig) do
|
|
7
7
|
if foxzoneconfig.enable == true then
|
|
8
8
|
compteur = compteur + 1
|
|
9
|
-
|
|
9
|
+
jtff_log.info('creation Fox Zone : '.. foxzoneconfig.name..'...',"FOX_ZONE")
|
|
10
10
|
local objFoxZone = FOX:New()
|
|
11
11
|
objFoxZone:SetExplosionPower(0.01)
|
|
12
12
|
:SetExplosionDistance(foxzoneconfig.distance_small_missile or 100)
|
|
@@ -19,7 +19,7 @@ for index, foxzoneconfig in ipairs(FoxRangesConfig) do
|
|
|
19
19
|
'FOX_LAUNCH_ZONE_'..foxzoneconfig.name,
|
|
20
20
|
GROUP:FindByName(foxzoneconfig.launchZoneGroupName))
|
|
21
21
|
objFoxZone:AddLaunchZone(objFoxZone.objLaunchZone)
|
|
22
|
-
|
|
22
|
+
jtff_log.info('Launch zone Polygon created : '.. objFoxZone.objLaunchZone:GetName() ..'...',"FOX_ZONE")
|
|
23
23
|
else
|
|
24
24
|
if foxzoneconfig.launchZoneName then
|
|
25
25
|
objFoxZone.objLaunchZone = ZONE:New(foxzoneconfig.launchZoneName)
|
|
@@ -31,7 +31,7 @@ for index, foxzoneconfig in ipairs(FoxRangesConfig) do
|
|
|
31
31
|
'FOX_SAFE_ZONE_'..foxzoneconfig.name,
|
|
32
32
|
GROUP:FindByName(foxzoneconfig.safeZoneGroupName))
|
|
33
33
|
objFoxZone:AddSafeZone(objFoxZone.objSafeZone)
|
|
34
|
-
|
|
34
|
+
jtff_log.info('Safe zone Polygon created : '.. objFoxZone.objSafeZone:GetName() ..'...',"FOX_ZONE")
|
|
35
35
|
else
|
|
36
36
|
if foxzoneconfig.safeZoneName then
|
|
37
37
|
objFoxZone.objSafeZone = ZONE:New(foxzoneconfig.safeZoneName)
|
|
@@ -72,7 +72,7 @@ for index, foxzoneconfig in ipairs(FoxRangesConfig) do
|
|
|
72
72
|
else
|
|
73
73
|
message = playerNameTargeted .. ' HAS BEEN SHOT DOWN BY ' .. unitShooter:GetName()
|
|
74
74
|
end
|
|
75
|
-
|
|
75
|
+
jtff_log.info(message,"FOX_ZONE")
|
|
76
76
|
Set_CLIENT:ForEachClientInZone(objFoxZone.objSafeZone, function(clientInZone)
|
|
77
77
|
if clientInZone:IsAlive() then
|
|
78
78
|
MESSAGE:NewType(message, MESSAGE.Type.Update):ToClient(clientInZone)
|
|
@@ -5,7 +5,7 @@ RATManagerArray = {}
|
|
|
5
5
|
compteur = 0
|
|
6
6
|
for index, ratconfig in ipairs(RATConfig) do
|
|
7
7
|
if ratconfig.enable == true then
|
|
8
|
-
|
|
8
|
+
jtff_log.info(string.format("RAT Enable"),"RAT")
|
|
9
9
|
compteur = compteur +1
|
|
10
10
|
if not (ratconfig.maximum_aircrafts) then
|
|
11
11
|
ratconfig.maximum_aircrafts = 10
|
|
@@ -17,7 +17,7 @@ for index, ratconfig in ipairs(RATConfig) do
|
|
|
17
17
|
end
|
|
18
18
|
if (type(planegroupconfig.templatename) == "table") then
|
|
19
19
|
for index, templatename in ipairs(planegroupconfig.templatename) do
|
|
20
|
-
|
|
20
|
+
jtff_log.debug(string.format("RAT %s", templatename),"RAT")
|
|
21
21
|
local RATGroup = RAT:New(templatename)
|
|
22
22
|
if (type(planegroupconfig.airbases_names) == "table" ) then
|
|
23
23
|
RATGroup:SetTakeoff("cold")
|
|
@@ -64,7 +64,7 @@ for index, ratconfig in ipairs(RATConfig) do
|
|
|
64
64
|
RATmanager:Add(RATGroup, planegroupconfig.minimun_spawns)
|
|
65
65
|
end
|
|
66
66
|
else
|
|
67
|
-
|
|
67
|
+
jtff_log.error(string.format("RAT error in template name type : %s", planegroupconfig.templatename),"RAT")
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
RATManagerArray[compteur] = RATmanager
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
function clearIntercept(param)
|
|
5
5
|
local objInterceptIndex = param[1]
|
|
6
6
|
local objIntercept = InterceptArray[objInterceptIndex]
|
|
7
|
-
|
|
7
|
+
jtff_log.debug(string.format("objIntercept.objSpawn is %s", net.lua2json(objIntercept.objSpawn)),"INTERCEPT")
|
|
8
8
|
local GroupPlane, Index = objIntercept.objSpawn:GetFirstAliveGroup()
|
|
9
9
|
while GroupPlane ~= nil do
|
|
10
10
|
GroupPlane:ScheduleStop()
|
|
@@ -57,18 +57,18 @@ end
|
|
|
57
57
|
|
|
58
58
|
function interceptDetection(param)
|
|
59
59
|
local objIntercept = param[1]
|
|
60
|
-
|
|
61
|
-
--
|
|
60
|
+
jtff_log.debug(string.format("objIntercept.interceptDetectionZone is %s", net.lua2json(objIntercept.interceptDetectionZone)),"INTERCEPT")
|
|
61
|
+
--jtff_log.debug(string.format("interceptorUnitName is %s", net.lua2json(interceptorUnitName)),"INTERCEPT")
|
|
62
62
|
if ( objIntercept.bubbleInvaded == false ) then
|
|
63
|
-
|
|
64
|
-
--
|
|
63
|
+
jtff_log.trace(string.format("%s has not yet been intercepted", objIntercept.interceptTarget:GetName()),"INTERCEPT")
|
|
64
|
+
--jtff_log.debug(string.format("interceptDetectionZone is %s", net.lua2json(interceptDetectionZone)),"INTERCEPT")
|
|
65
65
|
if (SET_CLIENT:New():FilterZones({objIntercept.interceptDetectionZone}):FilterOnce():CountAlive() > 0) then
|
|
66
66
|
objIntercept.bubbleInvaded = true
|
|
67
|
-
|
|
67
|
+
jtff_log.info(string.format("%s has been intercepted", objIntercept.interceptTarget:GetName()),"INTERCEPT")
|
|
68
68
|
if (objIntercept.knowIsIntercepted == false) then
|
|
69
69
|
if (math.random(1,100) >= 75) then
|
|
70
70
|
local delay = math.random(15,120)
|
|
71
|
-
|
|
71
|
+
jtff_log.info(string.format("%s has detected it has been intercepted : he will react accordingly in %i seconds !", objIntercept.interceptTarget:GetName(), delay),"INTERCEPT")
|
|
72
72
|
objIntercept.knowIsIntercepted = true
|
|
73
73
|
if objIntercept.customconfig.type == 'fastbomber' then
|
|
74
74
|
SCHEDULER:New(
|
|
@@ -86,7 +86,7 @@ function interceptDetection(param)
|
|
|
86
86
|
)
|
|
87
87
|
end
|
|
88
88
|
else
|
|
89
|
-
|
|
89
|
+
jtff_log.info(string.format("%s has not detected soon enough it has been intercepted", objIntercept.interceptTarget:GetName()),"INTERCEPT")
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
92
|
end
|
|
@@ -118,8 +118,8 @@ function StartInterceptTraining(param)
|
|
|
118
118
|
targetRange = 90
|
|
119
119
|
deltaAltMax = 15000
|
|
120
120
|
end
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
jtff_log.info(string.format("Launching exercise TargetAngle %i degrees", targetAngle),"INTERCEPT")
|
|
122
|
+
jtff_log.debug(string.format("Index is : %i", objInterceptIndex),"INTERCEPT")
|
|
123
123
|
local targetSpawnObj = InterceptArray[objInterceptIndex].objSpawn
|
|
124
124
|
local targetCoord = POINT_VEC3:NewFromVec3(
|
|
125
125
|
{
|
|
@@ -137,7 +137,7 @@ function StartInterceptTraining(param)
|
|
|
137
137
|
z = fighterCoord.z + math.floor(UTILS.NMToMeters(targetRange) * math.sin(math.rad(fighterHeading))),
|
|
138
138
|
}
|
|
139
139
|
)
|
|
140
|
-
|
|
140
|
+
jtff_log.info(string.format("Spawning target based on %s with TargetAngle of %i degrees", targetSpawnObj.SpawnTemplatePrefix, targetAngle),"INTERCEPT")
|
|
141
141
|
targetGroup = targetSpawnObj:InitHeading(math.mod(fighterHeading + 180 + targetAngle,360)):SpawnFromVec3(targetCoord)
|
|
142
142
|
targetGroup:OptionROE(ENUMS.ROE.WeaponHold)
|
|
143
143
|
targetGroup:OptionROT(ENUMS.ROT.NoReaction)
|
|
@@ -202,7 +202,7 @@ MenuCoalitionInterceptBlue = MENU_COALITION:New(coalition.side.BLUE, "Intercept
|
|
|
202
202
|
MenuCoalitionInterceptRed = MENU_COALITION:New(coalition.side.RED, "Intercept Training", MenuCoalitionRed)
|
|
203
203
|
for index, intconfig in ipairs(InterceptConfig) do
|
|
204
204
|
if intconfig.enable == true then
|
|
205
|
-
|
|
205
|
+
jtff_log.info(string.format("Enable %s with %s behavior", intconfig.name, intconfig.type),"INTERCEPT")
|
|
206
206
|
compteur = compteur +1
|
|
207
207
|
local objIntercept = {
|
|
208
208
|
customconfig = {},
|
|
@@ -6,7 +6,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
6
6
|
if (OnDemandReapersConfig) then
|
|
7
7
|
for index, OnDemandReaper in ipairs(OnDemandReapersConfig) do
|
|
8
8
|
if ((OnDemandReaper.type == type) and (OnDemandReaper.enable)) then
|
|
9
|
-
|
|
9
|
+
jtff_log.info(string.format('Found type %s UAV : %s Group!', type, OnDemandReaper.groupName),"UAV")
|
|
10
10
|
if (askedSpeed and askedSpeed > 0) then
|
|
11
11
|
OnDemandReaper.speed = askedSpeed
|
|
12
12
|
end
|
|
@@ -27,7 +27,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
27
27
|
local aliveReapersGroupList = set_group_reaper:GetSetObjects()
|
|
28
28
|
|
|
29
29
|
local is_reaper_spawned = false
|
|
30
|
-
|
|
30
|
+
jtff_log.debug(string.format('Looking for a Group corresponding to template %s', string.format("%s-%s", OnDemandReaper.groupName, OnDemandReaper.type)),"UAV")
|
|
31
31
|
for index, current_group in ipairs(aliveReapersGroupList) do
|
|
32
32
|
if (
|
|
33
33
|
(not(is_reaper_spawned)) and
|
|
@@ -38,7 +38,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
38
38
|
true
|
|
39
39
|
) ~= nil)
|
|
40
40
|
) then
|
|
41
|
-
|
|
41
|
+
jtff_log.info(string.format('Found %s corresponding to template %s', current_group.GroupName, string.format("%s-%s", OnDemandReaper.groupName, OnDemandReaper.type)),"UAV")
|
|
42
42
|
is_reaper_spawned = true
|
|
43
43
|
ReaperGroup = current_group
|
|
44
44
|
end
|
|
@@ -52,7 +52,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
52
52
|
RTBAirbase = askedAnchorCoord:GetClosestAirbase2(Airbase.Category.AIRDROME, OnDemandReaper.benefit_coalition)
|
|
53
53
|
end
|
|
54
54
|
if (is_reaper_spawned) then
|
|
55
|
-
|
|
55
|
+
jtff_log.debug(string.format('OnDemandUAV already in air : rerouting %s', OnDemandReaper.groupName), "UAV")
|
|
56
56
|
ReaperGroup:ClearTasks()
|
|
57
57
|
table.insert(
|
|
58
58
|
ReaperRoute,
|
|
@@ -98,7 +98,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
98
98
|
)
|
|
99
99
|
)
|
|
100
100
|
else
|
|
101
|
-
|
|
101
|
+
jtff_log.info(string.format('OnDemandUAV Spawning %s', OnDemandReaper.groupName),"UAV")
|
|
102
102
|
local SpawnReaper = SPAWN:NewWithAlias(
|
|
103
103
|
OnDemandReaper.groupName,
|
|
104
104
|
string.format("%s-%s", OnDemandReaper.groupName, OnDemandReaper.type)
|
|
@@ -249,7 +249,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
249
249
|
local reaperInfraIndex = 0
|
|
250
250
|
for infra_index, reaper_object in ipairs(ReapersInfraArray) do
|
|
251
251
|
if (reaper_object.customconfig.type == OnDemandReaper.type) then
|
|
252
|
-
|
|
252
|
+
jtff_log.info(string.format("Found infra %s for UAV %s", reaper_object.customconfig.type, ReaperGroup:GetName()),"UAV")
|
|
253
253
|
reaperInfraIndex = infra_index
|
|
254
254
|
end
|
|
255
255
|
end
|
|
@@ -260,9 +260,9 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
260
260
|
:FilterPrefixes(ReaperGroup:GetName())
|
|
261
261
|
:FilterOnce()
|
|
262
262
|
local detectionReaper = DETECTION_AREAS:New(setGroupReaper, UTILS.NMToMeters(5))
|
|
263
|
-
|
|
263
|
+
jtff_log.info(string.format("Detection Areas created for SET_GROUP %s with %d members", ReapersInfraArray[reaperInfraIndex].customconfig.groupName, setGroupReaper:Count()),"UAV")
|
|
264
264
|
local reaperCommandCenter = COMMANDCENTER:New( ReapersInfraArray[reaperInfraIndex].HQGroup, OnDemandReaper.hq_template_name )
|
|
265
|
-
|
|
265
|
+
jtff_log.info(string.format("Command Center %s created and operating", reaperCommandCenter:GetName()),"UAV")
|
|
266
266
|
reaperCommandCenter.FlashStatus=DEBUG_DETECT_MSG and false
|
|
267
267
|
if (OnDemandReaper.benefit_coalition == coalition.side.BLUE) then
|
|
268
268
|
currentDesignateObject = DESIGNATE:New( reaperCommandCenter, detectionReaper, SET_GROUP:New():FilterCoalitions("blue"):FilterStart())
|
|
@@ -277,11 +277,11 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
277
277
|
currentDesignateObject:SetFlashStatusMenu( DEBUG_DETECT_MSG and false)
|
|
278
278
|
function currentDesignateObject:OnAfterDetect(From, Event, To)
|
|
279
279
|
local DetectedItems = self.Detection:GetDetectedItems()
|
|
280
|
-
|
|
280
|
+
jtff_log.trace(string.format("OnAfterDetect"),"UAV")
|
|
281
281
|
if self.Detection:GetDetectedItemsCount() > 0 then
|
|
282
282
|
local DetectedItem = DetectedItems[1]
|
|
283
283
|
if self.RecceSet:GetFirst():GetUnit(1):IsLasing() then
|
|
284
|
-
|
|
284
|
+
jtff_log.trace(string.format("%s Spoting %s Unit", self.RecceSet:GetFirst():GetName(), self.RecceSet:GetFirst():GetUnit(1):GetSpot().TargetName),"UAV")
|
|
285
285
|
--Spot.createInfraRed(self.RecceSet:GetFirst():GetUnit(1):GetDCSObject(), {x = 0, y = 1, z = 0}, UNIT:FindByName(self.RecceSet:GetFirst():GetUnit(1):GetSpot().TargetName):GetPointVec3():AddY(1):GetVec3())
|
|
286
286
|
end
|
|
287
287
|
end
|
|
@@ -406,7 +406,8 @@ function ReaperMarkHandler:onEvent(event)
|
|
|
406
406
|
else
|
|
407
407
|
cmd = full
|
|
408
408
|
end
|
|
409
|
-
|
|
409
|
+
|
|
410
|
+
if log_levels[JTFF_LOGLEVEL] <= log_levels['debug'] then
|
|
410
411
|
trigger.action.outText("Full Text = " .. full, 10)
|
|
411
412
|
trigger.action.outText("Command = " .. cmd, 10)
|
|
412
413
|
if param1 ~= nil then trigger.action.outText("type = " .. param1, 10) end
|
|
@@ -417,7 +418,7 @@ function ReaperMarkHandler:onEvent(event)
|
|
|
417
418
|
end
|
|
418
419
|
|
|
419
420
|
if string.find(cmd, "uav") then
|
|
420
|
-
if
|
|
421
|
+
if log_levels[JTFF_LOGLEVEL] <= log_levels['debug'] then
|
|
421
422
|
trigger.action.outText("DEBUG: On UAV Started!", 10)
|
|
422
423
|
end
|
|
423
424
|
reapersOnDemandArray[#reapersOnDemandArray+1] = triggerOnDemandReaper(
|
|
@@ -474,13 +475,13 @@ function SpawnReaperHQ(param)
|
|
|
474
475
|
local reaperName = reaperObject.customconfig.type
|
|
475
476
|
local reaperHQName = reaperObject.customconfig.hq_template_name
|
|
476
477
|
|
|
477
|
-
|
|
478
|
+
jtff_log.info(string.format("Reaper %s - HQ %s", reaperName, reaperHQName),"UAV")
|
|
478
479
|
if (GROUP:FindByName(reaperHQName) ~= nil) then
|
|
479
480
|
reaperObject.HQSpawn = SPAWN:New(reaperHQName)
|
|
480
|
-
|
|
481
|
+
jtff_log.info(string.format("SPAWN %s", reaperHQName),"UAV")
|
|
481
482
|
reaperObject.HQGroup = reaperObject.HQSpawn:Spawn()
|
|
482
483
|
else
|
|
483
|
-
|
|
484
|
+
jtff_log.error(string.format("GROUP to spawn %s not found in mission", reaperHQName),"UAV")
|
|
484
485
|
end
|
|
485
486
|
MESSAGE:NewType(string.format("HQ group %s for %s UAV in place", reaperHQName, reaperName), MESSAGE.Type.Information)
|
|
486
487
|
:ToCoalition(reaperObject.customconfig.benefit_coalition)
|
|
@@ -499,7 +500,7 @@ local compteur = 0
|
|
|
499
500
|
for index, reapersconfig in ipairs(OnDemandReapersConfig) do
|
|
500
501
|
if reapersconfig.enable == true then
|
|
501
502
|
compteur = compteur + 1
|
|
502
|
-
|
|
503
|
+
jtff_log.info(string.format("%s creation HQ : %s", reapersconfig.type, reapersconfig.hq_template_name),"UAV")
|
|
503
504
|
ReapersInfraArray[compteur] = {
|
|
504
505
|
customconfig = reapersconfig,
|
|
505
506
|
ReaperRootMenu = {},
|