@jtff/miztemplate-lib 3.10.14 → 4.0.0
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 +11423 -11415
- package/lua/lib/Moose_.lua +26495 -35921
- package/lua/src/010-root_menus.lua +4 -3
- package/lua/src/020-mission_functions.lua +807 -217
- package/lua/src/110-set_clients.lua +53 -43
- package/lua/src/115-airbases.lua +191 -0
- package/lua/src/120-tankers.lua +577 -461
- package/lua/src/130-airboss.lua +1982 -440
- package/lua/src/150-awacs.lua +541 -445
- package/lua/src/160-atis.lua +136 -73
- package/lua/src/170-cap_zone_training.lua +176 -73
- package/lua/src/172-cap_zone_war.lua +383 -226
- package/lua/src/173-fox_zone_training.lua +142 -67
- package/lua/src/174-qra-scenario.lua +417 -362
- package/lua/src/176-random_air_traffic.lua +101 -12
- package/lua/src/178-training-intercept.lua +312 -261
- package/lua/src/180-logistics.lua +2 -2
- package/lua/src/190-ranges.lua +104 -37
- package/lua/src/191-sams.lua +4 -4
- package/lua/src/193-training_ranges.lua +2 -2
- package/lua/src/195-reaper-ondemand.lua +29 -29
- package/lua/src/196-fac_ranges.lua +2 -2
- package/lua/src/197-elint-ondemand.lua +53 -53
- package/lua/src/199-skynet.lua +55 -55
- package/package.json +1 -1
- package/scripts/inject-scripts.js +3 -31
- package/lua/src/135-pedro.lua +0 -21
- package/lua/src/140-beacons.lua +0 -19
package/lua/src/199-skynet.lua
CHANGED
|
@@ -21,15 +21,15 @@ function attachSAMSiteToSkynet(site, samGroupName, IADSObjectIndex, connectionNo
|
|
|
21
21
|
local skynetSam = IADSArray[IADSObjectIndex].IADSObject:getSAMSiteByGroupName(samGroupName)
|
|
22
22
|
skynetSam:addConnectionNode(StaticObject.getByName(connectionNode))
|
|
23
23
|
if (type(site.actAsEW) == "boolean") then
|
|
24
|
-
|
|
24
|
+
Jtff_log.info(string.format("actAsEW %s", tostring(site.actAsEW)),"IADS")
|
|
25
25
|
skynetSam:setActAsEW(site.actAsEW)
|
|
26
26
|
end
|
|
27
27
|
if (type(site.harmDetectionChance) == "number") then
|
|
28
|
-
|
|
28
|
+
Jtff_log.info(string.format("HARM detection chance : %i", site.harmDetectionChance),"IADS")
|
|
29
29
|
skynetSam:setHARMDetectionChance(site.harmDetectionChance)
|
|
30
30
|
end
|
|
31
31
|
if (type(site.goLiveRangePercent) == "number") then
|
|
32
|
-
|
|
32
|
+
Jtff_log.info(string.format("Go Live Range : %i perc", site.goLiveRangePercent),"IADS")
|
|
33
33
|
skynetSam
|
|
34
34
|
:setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE)
|
|
35
35
|
:setGoLiveRangeInPercent(site.goLiveRangePercent)
|
|
@@ -47,15 +47,15 @@ function attachPdSiteToSkynet(site, pdGroupName, samGroupName, IADSObjectIndex,
|
|
|
47
47
|
local skynetPdSam = IADSArray[IADSObjectIndex].IADSObject:getSAMSiteByGroupName(pdGroupName)
|
|
48
48
|
skynetPdSam:addConnectionNode(StaticObject.getByName(connectionNode))
|
|
49
49
|
if (type(site.pdactAsEw) == "boolean") then
|
|
50
|
-
|
|
50
|
+
Jtff_log.info(string.format("actAsEW %s", tostring(site.pdactAsEw)),"IADS")
|
|
51
51
|
skynetPdSam:setActAsEW(site.pdactAsEw)
|
|
52
52
|
end
|
|
53
53
|
if (type(site.pdharmDetectionChance) == "number") then
|
|
54
|
-
|
|
54
|
+
Jtff_log.info(string.format("HARM detection chance : %i", site.pdharmDetectionChance),"IADS")
|
|
55
55
|
skynetPdSam:setHARMDetectionChance(site.pdharmDetectionChance)
|
|
56
56
|
end
|
|
57
57
|
if (type(site.pdgoLiveRangePercent) == "number") then
|
|
58
|
-
|
|
58
|
+
Jtff_log.info(string.format("Go Live Range : %i perc", site.pdgoLiveRangePercent),"IADS")
|
|
59
59
|
skynetPdSam
|
|
60
60
|
:setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE)
|
|
61
61
|
:setGoLiveRangeInPercent(site.pdgoLiveRangePercent)
|
|
@@ -63,22 +63,22 @@ function attachPdSiteToSkynet(site, pdGroupName, samGroupName, IADSObjectIndex,
|
|
|
63
63
|
skynetPdSam
|
|
64
64
|
:setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE)
|
|
65
65
|
end
|
|
66
|
-
|
|
66
|
+
Jtff_log.info(string.format("Point Defense Sam Group %s Defending SAM %s", pdGroupName, samGroupName),"IADS")
|
|
67
67
|
skynetSam:addPointDefence(skynetPdSam)
|
|
68
68
|
elseif (type(site.pointDefenses) == "table") then
|
|
69
69
|
IADSArray[IADSObjectIndex].IADSObject:addSAMSite(pdGroupName)
|
|
70
70
|
local skynetPdSam = IADSArray[IADSObjectIndex].IADSObject:getSAMSiteByGroupName(pdGroupName)
|
|
71
71
|
skynetPdSam:addConnectionNode(StaticObject.getByName(connectionNode))
|
|
72
72
|
if (type(site.pdactAsEw) == "boolean") then
|
|
73
|
-
|
|
73
|
+
Jtff_log.info(string.format("actAsEW %s", tostring(site.pdactAsEw)),"IADS")
|
|
74
74
|
skynetPdSam:setActAsEW(site.pdactAsEw)
|
|
75
75
|
end
|
|
76
76
|
if (type(site.pdharmDetectionChance) == "number") then
|
|
77
|
-
|
|
77
|
+
Jtff_log.info(string.format("HARM detection chance : %i", site.pdharmDetectionChance),"IADS")
|
|
78
78
|
skynetPdSam:setHARMDetectionChance(site.pdharmDetectionChance)
|
|
79
79
|
end
|
|
80
80
|
if (type(site.pdgoLiveRangePercent) == "number") then
|
|
81
|
-
|
|
81
|
+
Jtff_log.info(string.format("Go Live Range : %i perc", site.pdgoLiveRangePercent),"IADS")
|
|
82
82
|
skynetPdSam
|
|
83
83
|
:setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE)
|
|
84
84
|
:setGoLiveRangeInPercent(site.pdgoLiveRangePercent)
|
|
@@ -86,7 +86,7 @@ function attachPdSiteToSkynet(site, pdGroupName, samGroupName, IADSObjectIndex,
|
|
|
86
86
|
skynetPdSam
|
|
87
87
|
:setEngagementZone(SkynetIADSAbstractRadarElement.GO_LIVE_WHEN_IN_SEARCH_RANGE)
|
|
88
88
|
end
|
|
89
|
-
|
|
89
|
+
Jtff_log.info(string.format("Point Defense Sam Group %s Defending SAM %s", pdGroupName, samGroupName),"IADS")
|
|
90
90
|
skynetSam:addPointDefence(skynetPdSam)
|
|
91
91
|
end
|
|
92
92
|
end
|
|
@@ -123,10 +123,10 @@ function SpawnIADSUnits(param)
|
|
|
123
123
|
country.id.UN_PEACEKEEPERS)
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
|
-
|
|
126
|
+
Jtff_log.info(string.format("Static type to spawn %s at %i,%i -> %s", connection.type, connection.x, connection.y, connection.name),"IADS")
|
|
127
127
|
spawnStatic:SpawnFromPointVec2(POINT_VEC2:New(connection.x, connection.y), connection.heading, connection.name)
|
|
128
128
|
else
|
|
129
|
-
|
|
129
|
+
Jtff_log.error(string.format("Static to spawn has no type, category, name or position!"),"IADS")
|
|
130
130
|
end
|
|
131
131
|
end
|
|
132
132
|
local ewrList = nodeConfig.ewrs
|
|
@@ -136,10 +136,10 @@ function SpawnIADSUnits(param)
|
|
|
136
136
|
local groupNameToSpawn = string.format("%s", ewrGroup)
|
|
137
137
|
if (GROUP:FindByName(groupNameToSpawn) ~= nil) then
|
|
138
138
|
local spawnGroup = SPAWN:New(groupNameToSpawn)
|
|
139
|
-
|
|
139
|
+
Jtff_log.info(string.format("SPAWN EWR : %s", groupNameToSpawn),"IADS")
|
|
140
140
|
local groupSpawning = spawnGroup:Spawn():OptionAlarmStateRed()
|
|
141
141
|
else
|
|
142
|
-
|
|
142
|
+
Jtff_log.error(string.format("EWR GROUP to spawn %s not found in mission", groupNameToSpawn),"IADS")
|
|
143
143
|
end
|
|
144
144
|
end
|
|
145
145
|
end
|
|
@@ -149,16 +149,16 @@ function SpawnIADSUnits(param)
|
|
|
149
149
|
local groupNameToSpawn = string.format("%s", site)
|
|
150
150
|
if (GROUP:FindByName(groupNameToSpawn) ~= nil) then
|
|
151
151
|
local spawnGroup = SPAWN:New(groupNameToSpawn)
|
|
152
|
-
|
|
152
|
+
Jtff_log.info(string.format("SPAWN SAM : %s", groupNameToSpawn),"IADS")
|
|
153
153
|
samGroupsSpawned[siteIndex] = spawnGroup:Spawn():OptionAlarmStateRed()
|
|
154
154
|
--if (IADSArray[IADSObjectIndex].IADSNetworkRunning) then
|
|
155
155
|
-- attachSAMSiteToSkynet(site, samGroupsSpawned[siteIndex]:GetName(), IADSObjectIndex, nodeConfig.connection)
|
|
156
156
|
--end
|
|
157
157
|
else
|
|
158
|
-
|
|
158
|
+
Jtff_log.error(string.format("SAM GROUP to spawn %s not found in mission", groupNameToSpawn),"IADS")
|
|
159
159
|
end
|
|
160
160
|
elseif (type(site) == "table") then
|
|
161
|
-
|
|
161
|
+
Jtff_log.debug(string.format("SAM in config file is table"),"IADS")
|
|
162
162
|
if (site.staticsToSpawn ~= nil) then
|
|
163
163
|
for index, staticToSpawn in ipairs(site.staticsToSpawn) do
|
|
164
164
|
local spawnStatic = nil
|
|
@@ -179,7 +179,7 @@ function SpawnIADSUnits(param)
|
|
|
179
179
|
local heading = staticToSpawn.heading
|
|
180
180
|
local name = string.format("%s_%s_%i", site.sam, staticNameToSpawn,index)
|
|
181
181
|
local static = spawnStatic:SpawnFromPointVec2( POINT_VEC2:New( x, y ), heading, name )
|
|
182
|
-
|
|
182
|
+
Jtff_log.info(string.format("Static %s to spawn at %i,%i -> %s", static:GetDCSObject():getTypeName(), x, y, static:GetDCSObject():getName()),"IADS")
|
|
183
183
|
elseif (staticToSpawn.type ~= nil and staticToSpawn.category ~= nil) then
|
|
184
184
|
local staticTypeToSpawn = string.format("%s", staticToSpawn.type)
|
|
185
185
|
local staticCategoryToSpawn = string.format("%s", staticToSpawn.category)
|
|
@@ -198,9 +198,9 @@ function SpawnIADSUnits(param)
|
|
|
198
198
|
local heading = staticToSpawn.heading
|
|
199
199
|
local name = string.format("%s_%s_%i", site.sam, staticTypeToSpawn, index)
|
|
200
200
|
local static = spawnStatic:SpawnFromPointVec2( POINT_VEC2:New( x, y ), heading, name )
|
|
201
|
-
|
|
201
|
+
Jtff_log.info(string.format("Static %s to spawn at %i,%i -> %s", static:GetDCSObject():getTypeName(), x, y, static:GetDCSObject():getName()),"IADS")
|
|
202
202
|
else
|
|
203
|
-
|
|
203
|
+
Jtff_log.error(string.format("Static to spawn has no name or type!"),"IADS")
|
|
204
204
|
end
|
|
205
205
|
end
|
|
206
206
|
end
|
|
@@ -208,25 +208,25 @@ function SpawnIADSUnits(param)
|
|
|
208
208
|
local groupNameToSpawn = string.format("%s", site.sam)
|
|
209
209
|
if (GROUP:FindByName(groupNameToSpawn) ~= nil) then
|
|
210
210
|
local spawnGroup = SPAWN:New(groupNameToSpawn)
|
|
211
|
-
|
|
211
|
+
Jtff_log.info(string.format("SPAWN SAM : %s", groupNameToSpawn),"IADS")
|
|
212
212
|
samGroupsSpawned[siteIndex] = spawnGroup:Spawn():OptionAlarmStateRed()
|
|
213
213
|
--if (IADSArray[IADSObjectIndex].IADSNetworkRunning) then
|
|
214
214
|
-- attachSAMSiteToSkynet(site, samGroupsSpawned[siteIndex]:GetName(), IADSObjectIndex, nodeConfig.connection)
|
|
215
215
|
--end
|
|
216
216
|
else
|
|
217
|
-
|
|
217
|
+
Jtff_log.error(string.format("SAM GROUP to spawn %s not found in mission", groupNameToSpawn),"IADS")
|
|
218
218
|
end
|
|
219
219
|
if (type(site.pointDefenses) == "string") then
|
|
220
220
|
local pdGroupNameToSpawn = string.format("%s", site.pointDefenses)
|
|
221
221
|
if (GROUP:FindByName(pdGroupNameToSpawn) ~= nil) then
|
|
222
222
|
local spawnGroup = SPAWN:New(pdGroupNameToSpawn)
|
|
223
|
-
|
|
223
|
+
Jtff_log.info(string.format("SPAWN SAM-PointDefense : %s", pdGroupNameToSpawn),"IADS")
|
|
224
224
|
local pdSamGroupsSpawned = spawnGroup:Spawn():OptionAlarmStateRed()
|
|
225
225
|
--if (IADSArray[IADSObjectIndex].IADSNetworkRunning) then
|
|
226
226
|
-- attachPdSiteToSkynet(site, pdSamGroupsSpawned:GetName(), samGroupsSpawned[siteIndex]:GetName(), IADSObjectIndex, nodeConfig.connection)
|
|
227
227
|
--end
|
|
228
228
|
else
|
|
229
|
-
|
|
229
|
+
Jtff_log.error(string.format("SAM-PointDefense GROUP to spawn %s not found in mission", pdGroupNameToSpawn),"IADS")
|
|
230
230
|
end
|
|
231
231
|
elseif (type(site.pointDefenses) == "table") then
|
|
232
232
|
local pdSamGroupsSpawned = {}
|
|
@@ -234,13 +234,13 @@ function SpawnIADSUnits(param)
|
|
|
234
234
|
local pdGroupNameToSpawn = string.format("%s", pdSamGroup)
|
|
235
235
|
if (GROUP:FindByName(pdGroupNameToSpawn) ~= nil) then
|
|
236
236
|
local spawnGroup = SPAWN:New(pdGroupNameToSpawn)
|
|
237
|
-
|
|
237
|
+
Jtff_log.info(string.format("SPAWN SAM-PointDefense : %s", pdGroupNameToSpawn),"IADS")
|
|
238
238
|
pdSamGroupsSpawned[pdindex] = spawnGroup:Spawn():OptionAlarmStateRed()
|
|
239
239
|
--if (IADSArray[IADSObjectIndex].IADSNetworkRunning) then
|
|
240
240
|
-- attachPdSiteToSkynet(site, pdSamGroupsSpawned[pdindex]:GetName(), samGroupsSpawned[siteIndex]:GetName(), IADSObjectIndex, nodeConfig.connection)
|
|
241
241
|
--end
|
|
242
242
|
else
|
|
243
|
-
|
|
243
|
+
Jtff_log.error(string.format("SAM-PointDefense GROUP to spawn %s not found in mission", pdGroupNameToSpawn),"IADS")
|
|
244
244
|
end
|
|
245
245
|
end
|
|
246
246
|
end
|
|
@@ -260,7 +260,7 @@ function SpawnIADSUnits(param)
|
|
|
260
260
|
skynetUpdateDisplay({ IADSObjectIndex,'contacts',showContactsOption })
|
|
261
261
|
skynetUpdateDisplay({ IADSObjectIndex,'IADSStatus',showStatusOption })
|
|
262
262
|
end
|
|
263
|
-
|
|
263
|
+
Jtff_log.info(string.format("Spawn IADS : %s-[%s] DONE", iadsName, difficulty),"IADS")
|
|
264
264
|
manageIADSNetworkMenu(parentMenu,iadsConfig,IADSObjectIndex)
|
|
265
265
|
MESSAGE:NewType(string.format("IADS - IADS Units %s-[%s] in place", iadsName, difficulty), MESSAGE.Type.Information):ToCoalition(iadsConfig.benefit_coalition)
|
|
266
266
|
end
|
|
@@ -319,7 +319,7 @@ function deactivateGCI(param)
|
|
|
319
319
|
local iadsConfig = param[1]
|
|
320
320
|
local IADSObjectIndex = param[2]
|
|
321
321
|
local parentMenu = param[3]
|
|
322
|
-
|
|
322
|
+
Jtff_log.info(string.format("GCI De-activation for %s", iadsConfig.name),"IADS")
|
|
323
323
|
IADSArray[IADSObjectIndex].GCIDispatcherObject:Stop()
|
|
324
324
|
IADSArray[IADSObjectIndex].GCIRunning = false
|
|
325
325
|
manageIADSNetworkMenu(parentMenu, iadsConfig, IADSObjectIndex)
|
|
@@ -329,7 +329,7 @@ function activateGCI(param)
|
|
|
329
329
|
local iadsConfig = param[1]
|
|
330
330
|
local IADSObjectIndex = param[2]
|
|
331
331
|
local parentMenu = param[3]
|
|
332
|
-
|
|
332
|
+
Jtff_log.info(string.format("GCI activation for %s", iadsConfig.name),"IADS")
|
|
333
333
|
if (IADSArray[IADSObjectIndex].GCIDispatcherObject ~= nil) then
|
|
334
334
|
IADSArray[IADSObjectIndex].GCIDispatcherObject:Start()
|
|
335
335
|
else
|
|
@@ -351,7 +351,7 @@ function activateGCI(param)
|
|
|
351
351
|
|
|
352
352
|
for index, gci_group in ipairs(iadsConfig.gci) do
|
|
353
353
|
gci_group_name = string.format("GCI_%s", gci_group.airport)
|
|
354
|
-
|
|
354
|
+
Jtff_log.info(string.format("GCI - Group %s", gci_group_name),"IADS")
|
|
355
355
|
IADSArray[IADSObjectIndex].GCIDispatcherObject:SetSquadron( gci_group_name, gci_group.airport, gci_group.templatePrefixes, gci_group.numberOfAircraftAvailable )
|
|
356
356
|
IADSArray[IADSObjectIndex].GCIDispatcherObject:SetSquadronGci( gci_group_name, 1000, 3000 )
|
|
357
357
|
end
|
|
@@ -366,14 +366,14 @@ function activateSkynet(param)
|
|
|
366
366
|
local IADSObjectIndex = param[2]
|
|
367
367
|
local parentMenu = param[3]
|
|
368
368
|
local difficultyArray = {"easy","medium","hard","extreme"}
|
|
369
|
-
|
|
369
|
+
Jtff_log.info(string.format("Skynet activation for %s", iadsConfig.name),"IADS")
|
|
370
370
|
-- create an instance of the IADS
|
|
371
371
|
IADSArray[IADSObjectIndex].IADSObject = SkynetIADS:create(iadsConfig.name)
|
|
372
372
|
|
|
373
373
|
---debug settings remove from here on if you do not wan't any output on what the IADS is doing by default
|
|
374
374
|
local iadsDebug = IADSArray[IADSObjectIndex].IADSObject:getDebugSettings()
|
|
375
375
|
local DEBUG_IADS
|
|
376
|
-
if
|
|
376
|
+
if Log_levels[JTFF_LOGLEVEL] <= Log_levels['debug'] then
|
|
377
377
|
DEBUG_IADS=true
|
|
378
378
|
else
|
|
379
379
|
DEBUG_IADS=false
|
|
@@ -407,15 +407,15 @@ function activateSkynet(param)
|
|
|
407
407
|
else
|
|
408
408
|
connectionName = node.connection.name
|
|
409
409
|
end
|
|
410
|
-
|
|
410
|
+
Jtff_log.info(string.format("Connection Node %s", connectionName),"IADS")
|
|
411
411
|
local connectionNode = StaticObject.getByName(connectionName)
|
|
412
412
|
for index, ewr in ipairs(node.ewrs) do
|
|
413
413
|
if (ewr ~= nil and connectionNode ~= nil) then
|
|
414
|
-
|
|
414
|
+
Jtff_log.info(string.format("EWR Unit name in config file : %s", ewr),"IADS")
|
|
415
415
|
local set_ewr_units = SET_UNIT:New():FilterPrefixes(ewr):FilterOnce()
|
|
416
416
|
set_ewr_units:ForEachUnit(function(ewr_alive)
|
|
417
417
|
if ewr_alive:IsAlive() then
|
|
418
|
-
|
|
418
|
+
Jtff_log.info(string.format("Alive EWR Unit name found %s", ewr_alive:Name()),"IADS")
|
|
419
419
|
IADSArray[IADSObjectIndex].IADSObject:addEarlyWarningRadar(ewr_alive:Name())
|
|
420
420
|
IADSArray[IADSObjectIndex].IADSObject:getEarlyWarningRadarByUnitName(ewr_alive:Name()):addConnectionNode(connectionNode)
|
|
421
421
|
end
|
|
@@ -427,30 +427,30 @@ function activateSkynet(param)
|
|
|
427
427
|
for siteIndex, site in ipairs(node.sites[difficulty]) do
|
|
428
428
|
if (site ~= nil and connectionNode ~= nil) then
|
|
429
429
|
if (type(site) == "string") then
|
|
430
|
-
|
|
430
|
+
Jtff_log.info(string.format("Sam Group name in config file : %s", site),"IADS")
|
|
431
431
|
local set_group_alive = SET_GROUP:New():FilterPrefixes(site):FilterOnce()
|
|
432
432
|
set_group_alive:ForEachGroupAlive(function(group_alive)
|
|
433
|
-
|
|
433
|
+
Jtff_log.info(string.format("Alive Sam Group found %s", group_alive:GetName()),"IADS")
|
|
434
434
|
attachSAMSiteToSkynet(site, group_alive:GetName(), IADSObjectIndex, connectionName)
|
|
435
435
|
end)
|
|
436
436
|
elseif (type(site) == "table") then
|
|
437
|
-
|
|
437
|
+
Jtff_log.info(string.format("Sam Group name in config file : %s", site.sam),"IADS")
|
|
438
438
|
local set_group_alive = SET_GROUP:New():FilterPrefixes(site.sam):FilterOnce()
|
|
439
439
|
set_group_alive:ForEachGroupAlive(function(samGroupAlive)
|
|
440
|
-
|
|
440
|
+
Jtff_log.info(string.format("Alive Sam Group found %s", samGroupAlive:GetName()),"IADS")
|
|
441
441
|
attachSAMSiteToSkynet(site, samGroupAlive:GetName(), IADSObjectIndex, connectionName)
|
|
442
442
|
if (type(site.pointDefenses) == "string") then
|
|
443
443
|
local set_pdgroup_alive = SET_GROUP:New():FilterPrefixes(site.pointDefenses):FilterOnce()
|
|
444
444
|
set_pdgroup_alive:ForEachGroupAlive(function(pdGroupAlive)
|
|
445
|
-
|
|
445
|
+
Jtff_log.info(string.format("Alive Point Defense Sam Group found %s", pdGroupAlive:GetName()),"IADS")
|
|
446
446
|
attachPdSiteToSkynet(site,pdGroupAlive:GetName(), samGroupAlive:GetName(), IADSObjectIndex, connectionName)
|
|
447
447
|
end)
|
|
448
448
|
elseif (type(site.pointDefenses) == "table") then
|
|
449
449
|
for pdIndex, pdSamGroupName in ipairs(site.pointDefenses) do
|
|
450
|
-
|
|
450
|
+
Jtff_log.info(string.format("Point Defense Sam Group name in config file : %s", pdSamGroupName),"IADS")
|
|
451
451
|
local set_pdgroup_alive = SET_GROUP:New():FilterPrefixes(pdSamGroupName):FilterOnce()
|
|
452
452
|
set_pdgroup_alive:ForEachGroupAlive(function(pdGroupAlive)
|
|
453
|
-
|
|
453
|
+
Jtff_log.info(string.format("Alive Point Defense Sam Group found %s", pdGroupAlive:GetName()),"IADS")
|
|
454
454
|
attachPdSiteToSkynet(site,pdGroupAlive:GetName(), samGroupAlive:GetName(), IADSObjectIndex, connectionName)
|
|
455
455
|
end)
|
|
456
456
|
end
|
|
@@ -465,7 +465,7 @@ function activateSkynet(param)
|
|
|
465
465
|
|
|
466
466
|
-- activate the radio menu to toggle IADS Status output
|
|
467
467
|
--if (iadsConfig.radioMenu) then
|
|
468
|
-
--
|
|
468
|
+
-- Jtff_log.trace(string.format("Add radio menu %s", iadsConfig.name),"IADS")
|
|
469
469
|
-- IADSArray[IADSObjectIndex].IADSObject:addRadioMenu()
|
|
470
470
|
--end
|
|
471
471
|
|
|
@@ -494,33 +494,33 @@ function deleteIADSUnits(param)
|
|
|
494
494
|
|
|
495
495
|
for index, nodeConfig in ipairs(nodesConfig) do
|
|
496
496
|
local connection = nodeConfig.connection
|
|
497
|
-
|
|
497
|
+
DestroyStatic(connection)
|
|
498
498
|
local ewrList = nodeConfig.ewrs
|
|
499
499
|
if (difficultiesAlreadySpawned <= 1) then
|
|
500
500
|
for index, ewrGroup in ipairs(ewrList) do
|
|
501
501
|
local groupNameToDelete = string.format("%s", ewrGroup)
|
|
502
|
-
|
|
502
|
+
DestroyGroup(groupNameToDelete)
|
|
503
503
|
end
|
|
504
504
|
end
|
|
505
505
|
local sitesList = nodeConfig.sites[difficulty]
|
|
506
506
|
for siteindex, site in ipairs(sitesList) do
|
|
507
507
|
if (type(site) == "string") then
|
|
508
508
|
local groupNameToDelete = string.format("%s", site)
|
|
509
|
-
|
|
509
|
+
DestroyGroup(groupNameToDelete)
|
|
510
510
|
elseif (type(site) == "table") then
|
|
511
511
|
local groupNameToDelete = string.format("%s", site.sam)
|
|
512
|
-
|
|
512
|
+
DestroyGroup(groupNameToDelete)
|
|
513
513
|
end
|
|
514
514
|
if (type( site.staticsToSpawn) == "table") then
|
|
515
|
-
|
|
515
|
+
DestroyStatics(site.staticsToSpawn, site.sam)
|
|
516
516
|
end
|
|
517
517
|
if (type(site.pointDefenses) == "string") then
|
|
518
518
|
local groupNameToDelete = string.format("%s", site.pointDefenses)
|
|
519
|
-
|
|
519
|
+
DestroyGroup(groupNameToDelete)
|
|
520
520
|
elseif (type(site.pointDefenses) == "table") then
|
|
521
521
|
for pdIndex, pdSamGroupName in ipairs(site.pointDefenses) do
|
|
522
522
|
local groupNameToDelete = string.format("%s", pdSamGroupName)
|
|
523
|
-
|
|
523
|
+
DestroyGroup(groupNameToDelete)
|
|
524
524
|
end
|
|
525
525
|
end
|
|
526
526
|
end
|
|
@@ -625,7 +625,7 @@ function manageIADSNetworkMenu(networkRootMenu, iadsconfig, IADSObjectIndex)
|
|
|
625
625
|
local isThereSomethingToSpawn = false
|
|
626
626
|
for indexnodes, nodeconfig in ipairs(iadsconfig.nodes) do
|
|
627
627
|
local tbl_json_txt = net.lua2json(nodeconfig.sites[difficulty])
|
|
628
|
-
--
|
|
628
|
+
--Jtff_log.debug(string.format('network=%s node=%s difficulty=%s sites config=%s', iadsconfig.name, nodeconfig.connection, difficulty, tbl_json_txt),"IADS")
|
|
629
629
|
local difficultySiteNumberToSpawn = 0
|
|
630
630
|
for indexsite, siteconfig in ipairs(nodeconfig.sites[difficulty]) do
|
|
631
631
|
difficultySiteNumberToSpawn = indexsite
|
|
@@ -634,10 +634,10 @@ function manageIADSNetworkMenu(networkRootMenu, iadsconfig, IADSObjectIndex)
|
|
|
634
634
|
end
|
|
635
635
|
end
|
|
636
636
|
if (type(nodeconfig.connection) == "string") then
|
|
637
|
-
|
|
637
|
+
Jtff_log.info(string.format('network=%s node=%s difficulty=%s sites number=%d', iadsconfig.name,
|
|
638
638
|
nodeconfig.connection, difficulty, difficultySiteNumberToSpawn),"IADS")
|
|
639
639
|
else
|
|
640
|
-
|
|
640
|
+
Jtff_log.info(string.format('network=%s node=%s difficulty=%s sites number=%d', iadsconfig.name,
|
|
641
641
|
nodeconfig.connection.name, difficulty, difficultySiteNumberToSpawn),"IADS")
|
|
642
642
|
end
|
|
643
643
|
end
|
|
@@ -646,7 +646,7 @@ function manageIADSNetworkMenu(networkRootMenu, iadsconfig, IADSObjectIndex)
|
|
|
646
646
|
"[" .. difficulty .. "] Spawn",
|
|
647
647
|
networkRootMenu,
|
|
648
648
|
SpawnIADSDelayed,
|
|
649
|
-
{ networkRootMenu, iadsconfig, IADSObjectIndex,
|
|
649
|
+
{ networkRootMenu, iadsconfig, IADSObjectIndex, SpawnStandardDelay, difficulty}
|
|
650
650
|
)
|
|
651
651
|
end
|
|
652
652
|
end
|
package/package.json
CHANGED
|
@@ -91,12 +91,6 @@ function injectScripts(jtffci, env_mission) {
|
|
|
91
91
|
warning: 'inject_airboss must be yes/y/o/oui or no/n/non',
|
|
92
92
|
default: 'n'
|
|
93
93
|
},
|
|
94
|
-
{
|
|
95
|
-
name: 'inject_beacons',
|
|
96
|
-
validator: /^y\b|n\b|o\b|yes\b|no\b|non\b|oui\b/i,
|
|
97
|
-
warning: 'inject_beacons must be yes/y/o/oui or no/n/non',
|
|
98
|
-
default: 'n'
|
|
99
|
-
},
|
|
100
94
|
{
|
|
101
95
|
name: 'inject_awacs',
|
|
102
96
|
validator: /^y\b|n\b|o\b|yes\b|no\b|non\b|oui\b/i,
|
|
@@ -150,7 +144,6 @@ function injectScripts(jtffci, env_mission) {
|
|
|
150
144
|
console.log('Command-line input received:');
|
|
151
145
|
console.log(' inject_tankers scripts: ' + (/^y\b|o\b|yes\b|oui\b/i).test(prompt_result.inject_tankers));
|
|
152
146
|
console.log(' inject_airboss scripts: ' + (/^y\b|o\b|yes\b|oui\b/i).test(prompt_result.inject_airboss));
|
|
153
|
-
console.log(' inject_beacons scripts: ' + (/^y\b|o\b|yes\b|oui\b/i).test(prompt_result.inject_beacons));
|
|
154
147
|
console.log(' inject_awacs scripts: ' + (/^y\b|o\b|yes\b|oui\b/i).test(prompt_result.inject_awacs));
|
|
155
148
|
console.log(' inject_atis scripts: ' + (/^y\b|o\b|yes\b|oui\b/i).test(prompt_result.inject_atis));
|
|
156
149
|
console.log(' inject_A2A scripts: ' + (/^y\b|o\b|yes\b|oui\b/i).test(prompt_result.inject_A2A));
|
|
@@ -301,38 +294,17 @@ async function doInject(ciObject, sourceMizFileName, workspacePath,destinationMi
|
|
|
301
294
|
{
|
|
302
295
|
file: "settings-airboss.lua",
|
|
303
296
|
objectName: "AirBossConfig"
|
|
304
|
-
}
|
|
305
|
-
{
|
|
306
|
-
file: "settings-pedros.lua",
|
|
307
|
-
objectName: "PedrosConfig"
|
|
308
|
-
},
|
|
297
|
+
}
|
|
309
298
|
);
|
|
310
299
|
scriptsArray.push({
|
|
311
300
|
folder: 'src',
|
|
312
301
|
scriptTitle: 'Airboss',
|
|
313
|
-
scripts: ['130-airboss.lua'
|
|
302
|
+
scripts: ['130-airboss.lua'],
|
|
314
303
|
timing: 23,
|
|
315
304
|
color: '0xff0000ff',
|
|
316
305
|
fromLibrary: true
|
|
317
306
|
});
|
|
318
|
-
}
|
|
319
|
-
// injection des Beacons dans la file d'attente
|
|
320
|
-
if ((/^y\b|o\b|yes\b|oui\b/i).test(promptResult.inject_beacons)) {
|
|
321
|
-
settingsArray.push(
|
|
322
|
-
{
|
|
323
|
-
file: "settings-beacons.lua",
|
|
324
|
-
objectName: "BeaconsConfig"
|
|
325
|
-
},
|
|
326
|
-
);
|
|
327
|
-
scriptsArray.push({
|
|
328
|
-
folder: 'src',
|
|
329
|
-
scriptTitle: 'Beacons',
|
|
330
|
-
scripts: ['140-beacons.lua'],
|
|
331
|
-
timing: 24,
|
|
332
|
-
color: '0xff0000ff',
|
|
333
|
-
fromLibrary: true
|
|
334
|
-
});
|
|
335
|
-
}
|
|
307
|
+
}
|
|
336
308
|
// injection des AWACS et OnDemandAwacs dans la file d'attente
|
|
337
309
|
if ((/^y\b|o\b|yes\b|oui\b/i).test(promptResult.inject_awacs)) {
|
|
338
310
|
settingsArray.push(
|
package/lua/src/135-pedro.lua
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
-- *****************************************************************************
|
|
2
|
-
-- ** Rescue Hello **
|
|
3
|
-
-- *********************************************************
|
|
4
|
-
PedroArray = {}
|
|
5
|
-
compteur = 0
|
|
6
|
-
for index,pedro in ipairs(PedrosConfig) do
|
|
7
|
-
if pedro.enable == true then
|
|
8
|
-
compteur = compteur +1
|
|
9
|
-
local rescuehelo = RESCUEHELO:New(UNIT:FindByName(pedro.patternUnit),pedro.groupName)
|
|
10
|
-
:SetHomeBase(AIRBASE:FindByName(pedro.baseUnit))
|
|
11
|
-
:SetTakeoffCold()
|
|
12
|
-
:SetRespawnOnOff(pedro.autorespawn)
|
|
13
|
-
:SetRescueDuration(1)
|
|
14
|
-
:SetModex(pedro.modex)
|
|
15
|
-
function rescuehelo:OnAfterStart(from, event, to)
|
|
16
|
-
self.helo:CommandSetFrequency(pedro.freq, radio.modulation.AM)
|
|
17
|
-
end
|
|
18
|
-
PedroArray[compteur] = rescuehelo
|
|
19
|
-
PedroArray[compteur]:Start()
|
|
20
|
-
end
|
|
21
|
-
end
|
package/lua/src/140-beacons.lua
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
-- *****************************************************************************
|
|
2
|
-
-- ** BEACONS **
|
|
3
|
-
-- *********************************************************
|
|
4
|
-
BeaconArray = {}
|
|
5
|
-
compteur = 0
|
|
6
|
-
for index, beaconconfig in ipairs(BeaconsConfig) do
|
|
7
|
-
if beaconconfig.enable == true then
|
|
8
|
-
compteur = compteur + 1
|
|
9
|
-
env.info('creation Beacon Zone : '.. beaconconfig.name..'...')
|
|
10
|
-
local myunit = UNIT:FindByName(beaconconfig.unitName)
|
|
11
|
-
local mybeacon = myunit:GetBeacon()
|
|
12
|
-
mybeacon.customconfig = beaconconfig
|
|
13
|
-
BeaconArray[compteur] = mybeacon
|
|
14
|
-
BeaconArray[compteur]:ActivateTACAN(beaconconfig.tacan.channel,
|
|
15
|
-
beaconconfig.tacan.band,
|
|
16
|
-
beaconconfig.tacan.morse,
|
|
17
|
-
true)
|
|
18
|
-
end
|
|
19
|
-
end
|