@jtff/miztemplate-lib 3.10.14 → 4.0.1
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 +11378 -11415
- package/lua/lib/Moose_.lua +35746 -44020
- package/lua/src/010-root_menus.lua +4 -3
- package/lua/src/020-mission_functions.lua +905 -217
- package/lua/src/110-set_clients.lua +53 -43
- package/lua/src/115-airbases.lua +191 -0
- package/lua/src/120-tankers.lua +590 -461
- package/lua/src/130-airboss.lua +1982 -440
- package/lua/src/150-awacs.lua +551 -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/190-ranges.lua
CHANGED
|
@@ -1,55 +1,122 @@
|
|
|
1
|
+
-- region RangeConfigFunctions
|
|
2
|
+
|
|
3
|
+
-- @type RangeConfig
|
|
4
|
+
-- @field #string name Name of the range scenario.
|
|
5
|
+
-- @field #boolean enable Enable the range scenario.
|
|
6
|
+
-- @field #coalition.side benefit_coalition Benefit coalition.
|
|
7
|
+
-- @field #RangeSubConfig[] subRange Table of sub range configurations.
|
|
8
|
+
|
|
9
|
+
-- @type RangeSubConfig
|
|
10
|
+
-- @field #string name Name of the sub range.
|
|
11
|
+
-- @field #string[] groupsToSpawn Table of groups to spawn.
|
|
12
|
+
-- @field #RangeStaticConfig[] staticsToSpawn Table of statics to spawn.
|
|
13
|
+
-- @field #boolean holdFire Hold fire of the sub range.
|
|
14
|
+
-- @field #boolean AI AI of the sub range.
|
|
15
|
+
-- @field #boolean redAlert Red alert of the sub range.
|
|
16
|
+
-- @field #RangeSubSubConfig[] subsubRange Table of sub sub range configurations.
|
|
17
|
+
|
|
18
|
+
-- @type RangeSubSubConfig
|
|
19
|
+
-- @field #string name Name of the sub sub range.
|
|
20
|
+
-- @field #string[] groupsToSpawn Table of groups to spawn.
|
|
21
|
+
-- @field #RangeStaticConfig[] staticsToSpawn Table of statics to spawn.
|
|
22
|
+
-- @field #boolean holdFire Hold fire of the sub sub range.
|
|
23
|
+
-- @field #boolean AI AI of the sub sub range.
|
|
24
|
+
-- @field #boolean redAlert Red alert of the sub sub range.
|
|
25
|
+
|
|
26
|
+
-- @type RangeStaticConfig
|
|
27
|
+
-- @field #number rate Rate of the static.
|
|
28
|
+
-- @field #string type Type of the static.
|
|
29
|
+
-- @field #string category Category of the static.
|
|
30
|
+
-- @field #number x X coordinate of the static.
|
|
31
|
+
-- @field #number y Y coordinate of the static.
|
|
32
|
+
-- @field #number heading Heading of the static.
|
|
33
|
+
-- @field #coalition.side coalition Coalition of the static.
|
|
34
|
+
-- @field #boolean dead Dead of the static.
|
|
35
|
+
|
|
36
|
+
--- Parse a RANGE config Object.
|
|
37
|
+
-- @param #JsonObject config Config object to parse
|
|
38
|
+
-- @return #RangeConfig rangeConfigJson Parsed RANGE config object
|
|
39
|
+
function ParseRangeConfigJson(config)
|
|
40
|
+
local json = require('Scripts/json')
|
|
41
|
+
local parser_name = "RANGE"
|
|
42
|
+
-- **************************************************************************
|
|
43
|
+
-- enable
|
|
44
|
+
-- **************************************************************************
|
|
45
|
+
local rangeConfigJson = {}
|
|
46
|
+
if config.enable == true then
|
|
47
|
+
rangeConfigJson = config
|
|
48
|
+
else
|
|
49
|
+
rangeConfigJson = {
|
|
50
|
+
enable = false,
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
Jtff_log.debug(
|
|
54
|
+
string.format(
|
|
55
|
+
"parsed RANGE config for %s, resulting config :\n%s",
|
|
56
|
+
config.name or "",
|
|
57
|
+
json:encode(
|
|
58
|
+
rangeConfigJson,
|
|
59
|
+
{ indent = true }
|
|
60
|
+
)
|
|
61
|
+
),
|
|
62
|
+
parser_name
|
|
63
|
+
)
|
|
64
|
+
return rangeConfigJson
|
|
65
|
+
end
|
|
66
|
+
-- endregion RangeConfigFunctions
|
|
67
|
+
|
|
68
|
+
-- region RangeFunctions
|
|
69
|
+
-- endregion RangeFunctions
|
|
70
|
+
|
|
1
71
|
-- *****************************************************************************
|
|
2
72
|
-- ** RANGES **
|
|
3
73
|
-- *********************************************************
|
|
4
74
|
|
|
5
75
|
RangesArray = {}
|
|
6
|
-
compteur =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
for
|
|
76
|
+
local compteur = #RangesArray
|
|
77
|
+
|
|
78
|
+
mainRadioMenuForRanges = {}
|
|
79
|
+
for _k, _coalition in pairs(coalition.side) do
|
|
80
|
+
mainRadioMenuForRanges[UTILS.GetCoalitionName(_coalition)] = MENU_COALITION:New(_coalition, "RANGES", MenuCoalition[UTILS.GetCoalitionName(_coalition)])
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
for index, currentRangeConfigObject in ipairs(RangeConfig) do
|
|
84
|
+
local rangeconfig = ParseRangeConfigJson(currentRangeConfigObject)
|
|
10
85
|
if rangeconfig.enable == true then
|
|
11
86
|
compteur = compteur + 1
|
|
12
|
-
|
|
87
|
+
Jtff_log.info(
|
|
88
|
+
string.format(
|
|
89
|
+
'creation Range : %s...',
|
|
90
|
+
rangeconfig.name
|
|
91
|
+
),
|
|
92
|
+
"RANGE"
|
|
93
|
+
)
|
|
13
94
|
RangesArray[compteur] = {
|
|
14
95
|
customconfig = rangeconfig,
|
|
15
96
|
RangeRootMenu = {},
|
|
16
97
|
SubRangeMenus = {},
|
|
17
98
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
addSubRangeRadioMenus(radioMenuSubSubRange, rangeconfig, subsubRangeConfig)
|
|
28
|
-
end
|
|
29
|
-
else
|
|
30
|
-
addSubRangeRadioMenus(radioMenuSubRange, rangeconfig, subRangeConfig)
|
|
99
|
+
RangesArray[compteur].RangeRootMenu = MENU_COALITION:New( rangeconfig.benefit_coalition, rangeconfig.name , mainRadioMenuForRanges[UTILS.GetCoalitionName(rangeconfig.benefit_coalition)])
|
|
100
|
+
local radioMenuForRange = RangesArray[compteur].RangeRootMenu
|
|
101
|
+
for indexsubRange, subRangeConfig in ipairs(rangeconfig.subRange) do
|
|
102
|
+
RangesArray[compteur].SubRangeMenus[indexsubRange] = MENU_COALITION:New(rangeconfig.benefit_coalition, subRangeConfig.name, radioMenuForRange)
|
|
103
|
+
local radioMenuSubRange = RangesArray[compteur].SubRangeMenus[indexsubRange]
|
|
104
|
+
if (subRangeConfig.subsubRange ~= nil) then
|
|
105
|
+
for indexSubSubRange, subsubRangeConfig in ipairs(subRangeConfig.subsubRange) do
|
|
106
|
+
local radioMenuSubSubRange = MENU_COALITION:New(rangeconfig.benefit_coalition, subsubRangeConfig.name, radioMenuSubRange)
|
|
107
|
+
AddSubRangeRadioMenus(radioMenuSubSubRange, rangeconfig, subsubRangeConfig)
|
|
31
108
|
end
|
|
109
|
+
else
|
|
110
|
+
AddSubRangeRadioMenus(radioMenuSubRange, rangeconfig, subRangeConfig)
|
|
32
111
|
end
|
|
33
|
-
AddWholeRangeCoalitionCommandMenus(radioMenuForRange, rangeconfig)
|
|
34
|
-
else
|
|
35
|
-
local radioMenuForRange = MENU_COALITION:New( coalition.side.RED, rangeconfig.name , mainRadioMenuForRangesRed)
|
|
36
|
-
for index, subRangeConfig in ipairs(rangeconfig.subRange) do
|
|
37
|
-
local radioMenuSubRange = MENU_COALITION:New(rangeconfig.benefit_coalition, subRangeConfig.name, radioMenuForRange)
|
|
38
|
-
if (subRangeConfig.subsubRange ~= nil) then
|
|
39
|
-
for index, subsubRangeConfig in ipairs(subRangeConfig.subsubRange) do
|
|
40
|
-
local radioMenuSubSubRange = MENU_COALITION:New(rangeconfig.benefit_coalition, subsubRangeConfig.name, radioMenuSubRange)
|
|
41
|
-
addSubRangeRadioMenus(radioMenuSubSubRange, rangeconfig, subsubRangeConfig)
|
|
42
|
-
end
|
|
43
|
-
else
|
|
44
|
-
addSubRangeRadioMenus(radioMenuSubRange, rangeconfig, subRangeConfig)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
AddWholeRangeCoalitionCommandMenus(radioMenuForRange, rangeconfig)
|
|
48
112
|
end
|
|
113
|
+
AddWholeRangeCoalitionCommandMenus(radioMenuForRange, rangeconfig)
|
|
49
114
|
end
|
|
50
115
|
end
|
|
51
116
|
|
|
52
|
-
if
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
end
|
|
117
|
+
if #RangesArray == 0 then
|
|
118
|
+
for _k, _coalition in pairs(coalition.side) do
|
|
119
|
+
mainRadioMenuForRanges[UTILS.GetCoalitionName(_coalition)]:Remove()
|
|
120
|
+
end
|
|
121
|
+
mainRadioMenuForRanges = {}
|
|
122
|
+
end
|
package/lua/src/191-sams.lua
CHANGED
|
@@ -24,10 +24,10 @@ for index, samconfig in ipairs(SamsConfig) do
|
|
|
24
24
|
if (subRangeConfig.subsubRange ~= nil) then
|
|
25
25
|
for index, subsubRangeConfig in ipairs(subRangeConfig.subsubRange) do
|
|
26
26
|
local radioMenuSubSubRange = MENU_COALITION:New(samconfig.benefit_coalition, subsubRangeConfig.name, radioMenuSubRange)
|
|
27
|
-
|
|
27
|
+
AddSubRangeRadioMenus(radioMenuSubSubRange, samconfig, subsubRangeConfig)
|
|
28
28
|
end
|
|
29
29
|
else
|
|
30
|
-
|
|
30
|
+
AddSubRangeRadioMenus(radioMenuSubRange, samconfig, subRangeConfig)
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
AddWholeRangeCoalitionCommandMenus(radioMenuForRange, samconfig)
|
|
@@ -38,10 +38,10 @@ for index, samconfig in ipairs(SamsConfig) do
|
|
|
38
38
|
if (subRangeConfig.subsubRange ~= nil) then
|
|
39
39
|
for index, subsubRangeConfig in ipairs(subRangeConfig.subsubRange) do
|
|
40
40
|
local radioMenuSubSubRange = MENU_COALITION:New(samconfig.benefit_coalition, subsubRangeConfig.name, radioMenuSubRange)
|
|
41
|
-
|
|
41
|
+
AddSubRangeRadioMenus(radioMenuSubSubRange, samconfig, subsubRangeConfig)
|
|
42
42
|
end
|
|
43
43
|
else
|
|
44
|
-
|
|
44
|
+
AddSubRangeRadioMenus(radioMenuSubRange, samconfig, subRangeConfig)
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
AddWholeRangeCoalitionCommandMenus(radioMenuForRange, samconfig)
|
|
@@ -22,10 +22,10 @@ for index, traingingrangeconfig in ipairs(TrainingRangeConfig) do
|
|
|
22
22
|
if ( traingingrangeconfig.srs.useSRS == true) then
|
|
23
23
|
trainingRange:SetSRS(SRSConfig.path, SRSConfig.port, coalition.side.BLUE)
|
|
24
24
|
else
|
|
25
|
-
trainingRange:SetSoundfilesPath(
|
|
25
|
+
trainingRange:SetSoundfilesPath(SoundFilesPrefix .. 'RANGE/Range Soundfiles/')
|
|
26
26
|
end
|
|
27
27
|
else
|
|
28
|
-
trainingRange:SetSoundfilesPath(
|
|
28
|
+
trainingRange:SetSoundfilesPath(SoundFilesPrefix .. 'RANGE/Range Soundfiles/')
|
|
29
29
|
end
|
|
30
30
|
if (traingingrangeconfig.instructionradio) then
|
|
31
31
|
if ( type(traingingrangeconfig.srs) ~= nil ) then
|
|
@@ -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)
|
|
@@ -196,9 +196,9 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
196
196
|
:InitRepeatOnEngineShutDown()
|
|
197
197
|
:InitSkill("Excellent")
|
|
198
198
|
:OnSpawnGroup(function(SpawnGroup)
|
|
199
|
-
|
|
199
|
+
TaskGroupEscort({ ReaperGroup, SpawnGroup})
|
|
200
200
|
end)
|
|
201
|
-
ReaperGroup.escortGroupObject =
|
|
201
|
+
ReaperGroup.escortGroupObject = SpawnRecoveryTankerEscort(ReaperGroup.escortSpawnObject, OnDemandReaper)
|
|
202
202
|
if OnDemandReaper.missionmaxduration then
|
|
203
203
|
ReaperGroup.escortGroupObject:ScheduleOnce(OnDemandReaper.missionmaxduration*60,
|
|
204
204
|
function(SpawnGroup, airBaseName)
|
|
@@ -211,11 +211,11 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
211
211
|
--trigger.action.outText('UAV-escort configured to RTB in : '..(OnDemandReaper.missionmaxduration)..' minutes max...', 45)
|
|
212
212
|
end
|
|
213
213
|
end
|
|
214
|
-
if (
|
|
215
|
-
COORDINATE:RemoveMark(
|
|
214
|
+
if (Jtff_map_marker[ReaperGroup:GetName()]) then
|
|
215
|
+
COORDINATE:RemoveMark(Jtff_map_marker[ReaperGroup:GetName()])
|
|
216
216
|
end
|
|
217
217
|
if(OnDemandReaper.tacan) then
|
|
218
|
-
|
|
218
|
+
Jtff_map_marker[ReaperGroup:GetName()] = askedAnchorCoord:MarkToCoalition(
|
|
219
219
|
string.format(
|
|
220
220
|
'OnDemandUAV %s - TCN %i\nLaserCode %i\nFL %i at %i knots\nFreq %.2f MHz\nOn station for %i minutes.',
|
|
221
221
|
OnDemandReaper.type,
|
|
@@ -231,7 +231,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
231
231
|
'OnDemand Reaper %s is Activated'
|
|
232
232
|
)
|
|
233
233
|
else
|
|
234
|
-
|
|
234
|
+
Jtff_map_marker[ReaperGroup:GetName()] = askedAnchorCoord:MarkToCoalition(
|
|
235
235
|
string.format(
|
|
236
236
|
'OnDemandUAV %s\nLaserCode %i\nFL %i at %i knots\nFreq %.2f MHz\nOn station for %i minutes.',
|
|
237
237
|
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
|
|
@@ -292,7 +292,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
292
292
|
ReaperGroup:HandleEvent(EVENTS.Crash)
|
|
293
293
|
ReaperGroup:HandleEvent(EVENTS.Dead)
|
|
294
294
|
function ReaperGroup:OnEventLand(EventData)
|
|
295
|
-
COORDINATE:RemoveMark(
|
|
295
|
+
COORDINATE:RemoveMark(Jtff_map_marker[self:GetName()])
|
|
296
296
|
if self.customconfig.escortgroupname then
|
|
297
297
|
env.info('UAV RTB: '..self.GroupName..'...')
|
|
298
298
|
if self.escortGroupObject:IsAirborne(false) == true then
|
|
@@ -304,7 +304,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
304
304
|
end
|
|
305
305
|
end
|
|
306
306
|
function ReaperGroup:OnEventCrash(EventData)
|
|
307
|
-
COORDINATE:RemoveMark(
|
|
307
|
+
COORDINATE:RemoveMark(Jtff_map_marker[self:GetName()])
|
|
308
308
|
if self.customconfig.escortgroupname then
|
|
309
309
|
env.info('UAV RTB: '..self.GroupName..'...')
|
|
310
310
|
if self.escortGroupObject:IsAirborne(false) == true then
|
|
@@ -316,7 +316,7 @@ function triggerOnDemandReaper(type, askedLaserCode, askedDuration, askedFL, ask
|
|
|
316
316
|
end
|
|
317
317
|
end
|
|
318
318
|
function ReaperGroup:OnEventDead(EventData)
|
|
319
|
-
COORDINATE:RemoveMark(
|
|
319
|
+
COORDINATE:RemoveMark(Jtff_map_marker[self:GetName()])
|
|
320
320
|
if self.customconfig.escortgroupname then
|
|
321
321
|
env.info('UAV RTB: '..self.GroupName..'...')
|
|
322
322
|
if self.escortGroupObject:IsAirborne(false) == true then
|
|
@@ -407,7 +407,7 @@ function ReaperMarkHandler:onEvent(event)
|
|
|
407
407
|
cmd = full
|
|
408
408
|
end
|
|
409
409
|
|
|
410
|
-
if
|
|
410
|
+
if Log_levels[JTFF_LOGLEVEL] <= Log_levels['debug'] then
|
|
411
411
|
trigger.action.outText("Full Text = " .. full, 10)
|
|
412
412
|
trigger.action.outText("Command = " .. cmd, 10)
|
|
413
413
|
if param1 ~= nil then trigger.action.outText("type = " .. param1, 10) end
|
|
@@ -418,7 +418,7 @@ function ReaperMarkHandler:onEvent(event)
|
|
|
418
418
|
end
|
|
419
419
|
|
|
420
420
|
if string.find(cmd, "uav") then
|
|
421
|
-
if
|
|
421
|
+
if Log_levels[JTFF_LOGLEVEL] <= Log_levels['debug'] then
|
|
422
422
|
trigger.action.outText("DEBUG: On UAV Started!", 10)
|
|
423
423
|
end
|
|
424
424
|
reapersOnDemandArray[#reapersOnDemandArray+1] = triggerOnDemandReaper(
|
|
@@ -446,7 +446,7 @@ function SpawnReaperHQDelay(param)
|
|
|
446
446
|
-- 5 : boolean for sound warning play
|
|
447
447
|
-- 6 : boolean for message warning
|
|
448
448
|
local reaperObject = param[2]
|
|
449
|
-
local delay = param[3] or
|
|
449
|
+
local delay = param[3] or SpawnStandardDelay
|
|
450
450
|
local myfunc = param[4]
|
|
451
451
|
local sound_warning = true
|
|
452
452
|
if (type(param[5]) ~= nil) then
|
|
@@ -457,7 +457,7 @@ function SpawnReaperHQDelay(param)
|
|
|
457
457
|
message_warning = param[6]
|
|
458
458
|
end
|
|
459
459
|
if ( sound_warning ) then
|
|
460
|
-
|
|
460
|
+
Sound2Bip:ToAll()
|
|
461
461
|
end
|
|
462
462
|
if ( message_warning ) then
|
|
463
463
|
MESSAGE:NewType(string.format("Warning, Uav HQ Units %s will spawn in %d sec", reaperObject.customconfig.type, delay), MESSAGE.Type.Update):ToAll()
|
|
@@ -475,13 +475,13 @@ function SpawnReaperHQ(param)
|
|
|
475
475
|
local reaperName = reaperObject.customconfig.type
|
|
476
476
|
local reaperHQName = reaperObject.customconfig.hq_template_name
|
|
477
477
|
|
|
478
|
-
|
|
478
|
+
Jtff_log.info(string.format("Reaper %s - HQ %s", reaperName, reaperHQName),"UAV")
|
|
479
479
|
if (GROUP:FindByName(reaperHQName) ~= nil) then
|
|
480
480
|
reaperObject.HQSpawn = SPAWN:New(reaperHQName)
|
|
481
|
-
|
|
481
|
+
Jtff_log.info(string.format("SPAWN %s", reaperHQName),"UAV")
|
|
482
482
|
reaperObject.HQGroup = reaperObject.HQSpawn:Spawn()
|
|
483
483
|
else
|
|
484
|
-
|
|
484
|
+
Jtff_log.error(string.format("GROUP to spawn %s not found in mission", reaperHQName),"UAV")
|
|
485
485
|
end
|
|
486
486
|
MESSAGE:NewType(string.format("HQ group %s for %s UAV in place", reaperHQName, reaperName), MESSAGE.Type.Information)
|
|
487
487
|
:ToCoalition(reaperObject.customconfig.benefit_coalition)
|
|
@@ -495,12 +495,12 @@ end
|
|
|
495
495
|
|
|
496
496
|
ReapersInfraArray = {}
|
|
497
497
|
local compteur = 0
|
|
498
|
-
--mainRadioMenuForReapersBlue = MENU_COALITION:New( coalition.side.BLUE , "AFACs",
|
|
499
|
-
--mainRadioMenuForReapersRed = MENU_COALITION:New( coalition.side.RED , "AFACs",
|
|
498
|
+
--mainRadioMenuForReapersBlue = MENU_COALITION:New( coalition.side.BLUE , "AFACs", MenuCoalition[coalition.side.BLUE] )
|
|
499
|
+
--mainRadioMenuForReapersRed = MENU_COALITION:New( coalition.side.RED , "AFACs", MenuCoalition[coalition.side.RED] )
|
|
500
500
|
for index, reapersconfig in ipairs(OnDemandReapersConfig) do
|
|
501
501
|
if reapersconfig.enable == true then
|
|
502
502
|
compteur = compteur + 1
|
|
503
|
-
|
|
503
|
+
Jtff_log.info(string.format("%s creation HQ : %s", reapersconfig.type, reapersconfig.hq_template_name),"UAV")
|
|
504
504
|
ReapersInfraArray[compteur] = {
|
|
505
505
|
customconfig = reapersconfig,
|
|
506
506
|
ReaperRootMenu = {},
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
-- *********************************************************
|
|
4
4
|
FACRangeArray = {}
|
|
5
5
|
compteur = 0
|
|
6
|
-
mainRadioMenuForFacRangesBlue = MENU_COALITION:New( coalition.side.BLUE , "FAC",
|
|
7
|
-
mainRadioMenuForFacRangesRed = MENU_COALITION:New( coalition.side.RED , "FAC",
|
|
6
|
+
mainRadioMenuForFacRangesBlue = MENU_COALITION:New( coalition.side.BLUE , "FAC", MenuCoalition[coalition.side.BLUE] )
|
|
7
|
+
mainRadioMenuForFacRangesRed = MENU_COALITION:New( coalition.side.RED , "FAC", MenuCoalition[coalition.side.RED] )
|
|
8
8
|
for index, facrangeconfig in ipairs(FACRangeConfig) do
|
|
9
9
|
if facrangeconfig.enable == true then
|
|
10
10
|
compteur = compteur + 1
|