@jtff/miztemplate-lib 3.1.8 → 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/lib/Moose_.lua +721 -494
- package/lua/lib/skynet-iads-compiled.lua +106 -60
- 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 +45 -46
- 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/resources/sounds/AIRBOSS/Airboss Soundfiles/GetYourButtsUptoVipersOffice.ogg +0 -0
- package/resources/sounds/AIRBOSS/Airboss Soundfiles/GreatBallsOfFire.ogg +0 -0
- package/resources/sounds/AIRBOSS/Airboss Soundfiles/ffyrtp.ogg +0 -0
- package/resources/sounds/AIRBOSS/Airboss Soundfiles/sureshot.ogg +0 -0
- package/scripts/inject-scripts.js +4 -4
- /package/resources/sounds/{CTLD → CTLD CSAR}/beacon.ogg +0 -0
- /package/resources/sounds/{CTLD → CTLD CSAR}/beaconsilent.ogg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
env.info("--- SKYNET VERSION: 3.
|
|
1
|
+
env.info("--- SKYNET VERSION: 3.3.0 | BUILD TIME: 29.12.2023 2311Z ---")
|
|
2
2
|
do
|
|
3
3
|
--this file contains the required units per sam type
|
|
4
|
-
samTypesDB = {
|
|
4
|
+
samTypesDB = {
|
|
5
5
|
['S-200'] = {
|
|
6
6
|
['type'] = 'complex',
|
|
7
7
|
['searchRadar'] = {
|
|
@@ -47,9 +47,16 @@ samTypesDB = {
|
|
|
47
47
|
['NATO'] = 'Big Bird',
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
|
+
['S-300PS 40B6MD sr_19J6'] = {
|
|
51
|
+
['name'] = {
|
|
52
|
+
['NATO'] = 'Tin Shield',
|
|
53
|
+
},
|
|
54
|
+
}
|
|
50
55
|
},
|
|
51
56
|
['trackingRadar'] = {
|
|
52
57
|
['S-300PS 40B6M tr'] = {
|
|
58
|
+
},
|
|
59
|
+
['S-300PS 5H63C 30H6_tr'] = {
|
|
53
60
|
},
|
|
54
61
|
},
|
|
55
62
|
['launchers'] = {
|
|
@@ -212,16 +219,18 @@ samTypesDB = {
|
|
|
212
219
|
|
|
213
220
|
},
|
|
214
221
|
['Roland ADS'] = {
|
|
215
|
-
['type'] = '
|
|
222
|
+
['type'] = 'complex',
|
|
216
223
|
['searchRadar'] = {
|
|
217
|
-
['Roland
|
|
224
|
+
['Roland Radar'] = {
|
|
225
|
+
['name'] = {
|
|
226
|
+
['NATO'] = 'Roland EWR',
|
|
227
|
+
},
|
|
218
228
|
},
|
|
219
229
|
},
|
|
220
230
|
['launchers'] = {
|
|
221
231
|
['Roland ADS'] = {
|
|
222
232
|
},
|
|
223
233
|
},
|
|
224
|
-
|
|
225
234
|
['name'] = {
|
|
226
235
|
['NATO'] = 'Roland ADS',
|
|
227
236
|
},
|
|
@@ -394,8 +403,23 @@ samTypesDB = {
|
|
|
394
403
|
['NATO'] = 'CSA-4',
|
|
395
404
|
},
|
|
396
405
|
['harm_detection_chance'] = 30
|
|
397
|
-
},
|
|
398
|
-
|
|
406
|
+
},
|
|
407
|
+
['Phalanx'] = {
|
|
408
|
+
['type'] = 'single',
|
|
409
|
+
['searchRadar'] = {
|
|
410
|
+
['HEMTT_C-RAM_Phalanx'] = {
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
['launchers'] = {
|
|
414
|
+
['HEMTT_C-RAM_Phalanx'] = {
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
['name'] = {
|
|
418
|
+
['NATO'] = 'Phalanx',
|
|
419
|
+
},
|
|
420
|
+
['harm_detection_chance'] = 10
|
|
421
|
+
},
|
|
422
|
+
-- Start of RED EW radars:
|
|
399
423
|
['1L13 EWR'] = {
|
|
400
424
|
['type'] = 'ewr',
|
|
401
425
|
['searchRadar'] = {
|
|
@@ -429,18 +453,29 @@ samTypesDB = {
|
|
|
429
453
|
},
|
|
430
454
|
['harm_detection_chance'] = 20
|
|
431
455
|
},
|
|
432
|
-
|
|
456
|
+
-- Start of BLUE EW radars:
|
|
457
|
+
['FPS-117 Dome'] = {
|
|
433
458
|
['type'] = 'ewr',
|
|
434
459
|
['searchRadar'] = {
|
|
435
|
-
['
|
|
460
|
+
['FPS-117 Dome'] = {
|
|
436
461
|
['name'] = {
|
|
437
|
-
['NATO'] = '
|
|
462
|
+
['NATO'] = 'FPS-117 Dome',
|
|
438
463
|
},
|
|
439
464
|
},
|
|
440
465
|
},
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
466
|
+
['harm_detection_chance'] = 80
|
|
467
|
+
},
|
|
468
|
+
['FPS-117'] = {
|
|
469
|
+
['type'] = 'ewr',
|
|
470
|
+
['searchRadar'] = {
|
|
471
|
+
['FPS-117'] = {
|
|
472
|
+
['name'] = {
|
|
473
|
+
['NATO'] = 'FPS-117',
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
['harm_detection_chance'] = 80
|
|
478
|
+
}
|
|
444
479
|
}
|
|
445
480
|
end
|
|
446
481
|
do
|
|
@@ -745,17 +780,6 @@ samTypesDB['S-300PMU2'] = {
|
|
|
745
780
|
},
|
|
746
781
|
['S-300PMU1 40B6MD sr'] = s300PMU140B6MDsr,
|
|
747
782
|
['S-300PMU1 64N6E sr'] = s300PMU164N6Esr,
|
|
748
|
-
|
|
749
|
-
['S-300PS 40B6MD sr'] = {
|
|
750
|
-
['name'] = {
|
|
751
|
-
['NATO'] = '',
|
|
752
|
-
},
|
|
753
|
-
},
|
|
754
|
-
['S-300PS 64H6E sr'] = {
|
|
755
|
-
['name'] = {
|
|
756
|
-
['NATO'] = '',
|
|
757
|
-
},
|
|
758
|
-
},
|
|
759
783
|
},
|
|
760
784
|
['trackingRadar'] = {
|
|
761
785
|
['S-300PMU2 92H6E tr'] = {
|
|
@@ -1170,9 +1194,17 @@ function SkynetIADS:create(name)
|
|
|
1170
1194
|
iads.name = ""
|
|
1171
1195
|
end
|
|
1172
1196
|
iads.contactUpdateInterval = 5
|
|
1197
|
+
world.addEventHandler(iads)
|
|
1173
1198
|
return iads
|
|
1174
1199
|
end
|
|
1175
1200
|
|
|
1201
|
+
function SkynetIADS:onEvent(event)
|
|
1202
|
+
if (event.id == world.event.S_EVENT_BIRTH ) then
|
|
1203
|
+
env.info("New Object Spawned")
|
|
1204
|
+
-- self:addSAMSite(event.initiator:getGroup():getName());
|
|
1205
|
+
end
|
|
1206
|
+
end
|
|
1207
|
+
|
|
1176
1208
|
function SkynetIADS:setUpdateInterval(interval)
|
|
1177
1209
|
self.contactUpdateInterval = interval
|
|
1178
1210
|
end
|
|
@@ -1305,7 +1337,7 @@ function SkynetIADS:addSAMSitesByPrefix(prefix)
|
|
|
1305
1337
|
if pos and pos == 1 then
|
|
1306
1338
|
--mist returns groups, units and, StaticObjects
|
|
1307
1339
|
local dcsObject = Group.getByName(groupName)
|
|
1308
|
-
if dcsObject then
|
|
1340
|
+
if dcsObject and dcsObject:getUnits()[1]:isActive() then
|
|
1309
1341
|
self:addSAMSite(groupName)
|
|
1310
1342
|
end
|
|
1311
1343
|
end
|
|
@@ -1876,7 +1908,10 @@ end
|
|
|
1876
1908
|
function SkynetIADSAbstractDCSObjectWrapper:setDCSRepresentation(representation)
|
|
1877
1909
|
self.dcsRepresentation = representation
|
|
1878
1910
|
if self.dcsRepresentation then
|
|
1879
|
-
self.dcsName = self:
|
|
1911
|
+
self.dcsName = self.dcsRepresentation:getName()
|
|
1912
|
+
if (self.dcsName == nil or string.len(self.dcsName) == 0) and self.dcsRepresentation.id_ then
|
|
1913
|
+
self.dcsName = self.dcsRepresentation.id_
|
|
1914
|
+
end
|
|
1880
1915
|
end
|
|
1881
1916
|
end
|
|
1882
1917
|
|
|
@@ -2633,6 +2668,7 @@ function SkynetIADSAbstractRadarElement:goLive()
|
|
|
2633
2668
|
then
|
|
2634
2669
|
if self:isDestroyed() == false then
|
|
2635
2670
|
local cont = self:getController()
|
|
2671
|
+
cont:setOnOff(true)
|
|
2636
2672
|
cont:setOption(AI.Option.Ground.id.ALARM_STATE, AI.Option.Ground.val.ALARM_STATE.RED)
|
|
2637
2673
|
cont:setOption(AI.Option.Air.id.ROE, AI.Option.Air.val.ROE.WEAPON_FREE)
|
|
2638
2674
|
self:getDCSRepresentation():enableEmission(true)
|
|
@@ -2665,9 +2701,15 @@ function SkynetIADSAbstractRadarElement:goDark()
|
|
|
2665
2701
|
-- point defence will only go live if the Radar Emitting site it is protecting goes dark and this is due to a it defending against a HARM
|
|
2666
2702
|
if (self.harmSilenceID ~= nil) then
|
|
2667
2703
|
self:pointDefencesGoLive()
|
|
2704
|
+
if self:isDestroyed() == false then
|
|
2705
|
+
--if site goes dark due to HARM we turn off AI, this is due to a bug in DCS multiplayer where the harm will find its way to the radar emitter if just setEmissions is set to false
|
|
2706
|
+
local controller = self:getController()
|
|
2707
|
+
controller:setOnOff(false)
|
|
2708
|
+
end
|
|
2668
2709
|
end
|
|
2669
2710
|
self.aiState = false
|
|
2670
2711
|
self:stopScanningForHARMs()
|
|
2712
|
+
self.cachedTargets = {}
|
|
2671
2713
|
if self.iads:getDebugSettings().radarWentDark then
|
|
2672
2714
|
self.iads:printOutputToLog("GOING DARK: "..self:getDescription())
|
|
2673
2715
|
end
|
|
@@ -2910,22 +2952,24 @@ function SkynetIADSAbstractRadarElement:informOfHARM(harmContact)
|
|
|
2910
2952
|
local radars = self:getRadars()
|
|
2911
2953
|
for j = 1, #radars do
|
|
2912
2954
|
local radar = radars[j]
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
self:
|
|
2928
|
-
|
|
2955
|
+
if radar:isExist() then
|
|
2956
|
+
local distanceNM = mist.utils.metersToNM(self:getDistanceInMetersToContact(radar, harmContact:getPosition().p))
|
|
2957
|
+
local harmToSAMHeading = mist.utils.toDegree(mist.utils.getHeadingPoints(harmContact:getPosition().p, radar:getPosition().p))
|
|
2958
|
+
local harmToSAMAspect = self:calculateAspectInDegrees(harmContact:getMagneticHeading(), harmToSAMHeading)
|
|
2959
|
+
local speedKT = harmContact:getGroundSpeedInKnots(0)
|
|
2960
|
+
local secondsToImpact = self:getSecondsToImpact(distanceNM, speedKT)
|
|
2961
|
+
--TODO: use tti instead of distanceNM?
|
|
2962
|
+
-- when iterating through the radars, store shortest tti and work with that value??
|
|
2963
|
+
if ( harmToSAMAspect < SkynetIADSAbstractRadarElement.HARM_TO_SAM_ASPECT and distanceNM < SkynetIADSAbstractRadarElement.HARM_LOOKAHEAD_NM ) then
|
|
2964
|
+
self:addObjectIdentifiedAsHARM(harmContact)
|
|
2965
|
+
if ( #self:getPointDefences() > 0 and self:pointDefencesGoLive() == true and self.iads:getDebugSettings().harmDefence ) then
|
|
2966
|
+
self.iads:printOutputToLog("POINT DEFENCES GOING LIVE FOR: "..self:getDCSName().." | TTI: "..secondsToImpact)
|
|
2967
|
+
end
|
|
2968
|
+
--self.iads:printOutputToLog("Ignore HARM shutdown: "..tostring(self:shallIgnoreHARMShutdown()))
|
|
2969
|
+
if ( self:getIsAPointDefence() == false and ( self:isDefendingHARM() == false or ( self:getHARMShutdownTime() < secondsToImpact ) ) and self:shallIgnoreHARMShutdown() == false) then
|
|
2970
|
+
self:goSilentToEvadeHARM(secondsToImpact)
|
|
2971
|
+
break
|
|
2972
|
+
end
|
|
2929
2973
|
end
|
|
2930
2974
|
end
|
|
2931
2975
|
end
|
|
@@ -3131,9 +3175,11 @@ function SkynetIADSContact:getTypeName()
|
|
|
3131
3175
|
if self:isIdentifiedAsHARM() then
|
|
3132
3176
|
return SkynetIADSContact.HARM
|
|
3133
3177
|
end
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3178
|
+
if self:getDCSRepresentation() ~= nil then
|
|
3179
|
+
local category = self:getDCSRepresentation():getCategory()
|
|
3180
|
+
if category == Object.Category.UNIT then
|
|
3181
|
+
return self.typeName
|
|
3182
|
+
end
|
|
3137
3183
|
end
|
|
3138
3184
|
return "UNKNOWN"
|
|
3139
3185
|
end
|
|
@@ -3797,31 +3843,31 @@ function SkynetIADSHARMDetection:cleanAgedContacts()
|
|
|
3797
3843
|
end
|
|
3798
3844
|
|
|
3799
3845
|
function SkynetIADSHARMDetection:getNewRadarsThatHaveDetectedContact(contact)
|
|
3800
|
-
local
|
|
3801
|
-
local
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3846
|
+
local radarsFromContact = contact:getAbstractRadarElementsDetected()
|
|
3847
|
+
local evaluatedRadars = self.contactRadarsEvaluated[contact]
|
|
3848
|
+
local newRadars = {}
|
|
3849
|
+
if evaluatedRadars == nil then
|
|
3850
|
+
evaluatedRadars = {}
|
|
3851
|
+
self.contactRadarsEvaluated[contact] = evaluatedRadars
|
|
3852
|
+
end
|
|
3853
|
+
for i = 1, #radarsFromContact do
|
|
3854
|
+
local contactRadar = radarsFromContact[i]
|
|
3855
|
+
if self:isElementInTable(evaluatedRadars, contactRadar) == false then
|
|
3856
|
+
table.insert(evaluatedRadars, contactRadar)
|
|
3857
|
+
table.insert(newRadars, contactRadar)
|
|
3811
3858
|
end
|
|
3812
3859
|
end
|
|
3813
|
-
self.contactRadarsEvaluated[contact] = contact:getAbstractRadarElementsDetected()
|
|
3814
3860
|
return newRadars
|
|
3815
3861
|
end
|
|
3816
3862
|
|
|
3817
3863
|
function SkynetIADSHARMDetection:isElementInTable(tbl, element)
|
|
3818
3864
|
for i = 1, #tbl do
|
|
3819
|
-
tblElement = tbl[i]
|
|
3865
|
+
local tblElement = tbl[i]
|
|
3820
3866
|
if tblElement == element then
|
|
3821
|
-
return
|
|
3867
|
+
return true
|
|
3822
3868
|
end
|
|
3823
3869
|
end
|
|
3824
|
-
return
|
|
3870
|
+
return false
|
|
3825
3871
|
end
|
|
3826
3872
|
|
|
3827
3873
|
function SkynetIADSHARMDetection:informRadarsOfHARM(contact)
|