@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/160-atis.lua
CHANGED
|
@@ -1,80 +1,144 @@
|
|
|
1
1
|
-- *****************************************************************************
|
|
2
2
|
-- ** ATIS **
|
|
3
3
|
-- *********************************************************
|
|
4
|
+
|
|
5
|
+
-- region ATISFunctions
|
|
6
|
+
|
|
4
7
|
--- Enable ATIS for a specific airbase.
|
|
5
8
|
---@param airbase string The name of the airbase for which to enable ATIS for. (MOOSE Enum)
|
|
6
9
|
function EnableAtis(airbase)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
for _, atis in ipairs(ATISArray) do
|
|
11
|
+
if atis.customconfig.airfield == airbase then
|
|
12
|
+
-- Enable ATIS
|
|
13
|
+
atis:Start()
|
|
14
|
+
Jtff_log.info(
|
|
15
|
+
string.format(
|
|
16
|
+
"ATIS at airfield %s enabled (usually by bot).",
|
|
17
|
+
atis.customconfig.airfield
|
|
18
|
+
),
|
|
19
|
+
"ATIS"
|
|
20
|
+
)
|
|
21
|
+
for _k, _coalition in pairs(coalition.side) do
|
|
22
|
+
atis.menu[_coalition]:Remove()
|
|
23
|
+
atis.menu[_coalition] = MENU_COALITION_COMMAND:New(
|
|
24
|
+
_coalition,
|
|
25
|
+
"Disable Auto Atis at " .. atis.customconfig.airfield,
|
|
26
|
+
MenuCoalitionAtis[UTILS.GetCoalitionName(_coalition)],
|
|
27
|
+
DisableAtis,
|
|
28
|
+
atis.customconfig.airfield
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
return true
|
|
32
|
+
end
|
|
33
|
+
end
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
--- Disable ATIS for a specific airbase.
|
|
34
37
|
---@param airbase string The name of the airbase for which to disable ATIS for. (MOOSE Enum)
|
|
35
38
|
function DisableAtis(airbase)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
for _, atis in ipairs(ATISArray) do
|
|
40
|
+
if atis.customconfig.airfield == airbase then
|
|
41
|
+
-- Disable ATIS
|
|
42
|
+
atis:Stop()
|
|
43
|
+
Jtff_log.info(
|
|
44
|
+
string.format(
|
|
45
|
+
"ATIS at airfield %s disabled (usually by bot).",
|
|
46
|
+
atis.customconfig.airfield
|
|
47
|
+
),
|
|
48
|
+
"ATIS"
|
|
49
|
+
)
|
|
50
|
+
for _k, _coalition in pairs(coalition.side) do
|
|
51
|
+
atis.menu[_coalition]:Remove()
|
|
52
|
+
atis.menu[_coalition] = MENU_COALITION_COMMAND:New(
|
|
53
|
+
_coalition,
|
|
54
|
+
"Enable Auto Atis at " .. atis.customconfig.airfield,
|
|
55
|
+
MenuCoalitionAtis[UTILS.GetCoalitionName(_coalition)],
|
|
56
|
+
EnableAtis,
|
|
57
|
+
atis.customconfig.airfield
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
return true
|
|
61
|
+
end
|
|
62
|
+
end
|
|
60
63
|
end
|
|
61
64
|
|
|
65
|
+
-- endregion ATISFunctions
|
|
66
|
+
|
|
67
|
+
-- region ATISConfigFunctions
|
|
68
|
+
-- @type ATISConfig
|
|
69
|
+
-- @field #boolean enable Enable Atis creation.
|
|
70
|
+
-- @field #string airfield Airfield name.
|
|
71
|
+
-- @field #radioConfig radio configuration object.
|
|
72
|
+
-- @field #string relayunit UNIT Name to emit radio On.
|
|
73
|
+
-- @field #table active Active Runway config Object.
|
|
74
|
+
-- @field #tacanConfig tacan TACAN configuration..
|
|
75
|
+
-- @field #table ils ILS configuration.
|
|
76
|
+
-- @field #boolean useSRS Use SRS for the ATIS.
|
|
77
|
+
|
|
78
|
+
--- Parse ATIS config Object.
|
|
79
|
+
-- @param #JsonObject config Config object to parse
|
|
80
|
+
-- @return #ATISConfig atisConfigJson Parsed ATISConfig object
|
|
81
|
+
function ParseAtisConfigJson(config)
|
|
82
|
+
local json = require('Scripts/json')
|
|
83
|
+
local parser_name = "ATIS"
|
|
84
|
+
-- **************************************************************************
|
|
85
|
+
-- enable
|
|
86
|
+
-- **************************************************************************
|
|
87
|
+
local atisConfigJson = {
|
|
88
|
+
enable = config.enable or false,
|
|
89
|
+
}
|
|
90
|
+
if type(config) ~= 'table' then
|
|
91
|
+
Jtff_log.error(
|
|
92
|
+
string.format(
|
|
93
|
+
"no proper atisconfig defined, skipping Atis configuration"
|
|
94
|
+
),
|
|
95
|
+
parser_name
|
|
96
|
+
)
|
|
97
|
+
atisConfigJson.enable = false
|
|
98
|
+
return atisConfigJson
|
|
99
|
+
end
|
|
100
|
+
atisConfigJson = config
|
|
101
|
+
Jtff_log.debug(
|
|
102
|
+
string.format(
|
|
103
|
+
"parsed ATIS config for %s ATIS, resulting config :\n%s",
|
|
104
|
+
config.airfield or "unknown Airbase",
|
|
105
|
+
json:encode(
|
|
106
|
+
atisConfigJson,
|
|
107
|
+
{ indent = true }
|
|
108
|
+
)
|
|
109
|
+
),
|
|
110
|
+
parser_name
|
|
111
|
+
)
|
|
112
|
+
return atisConfigJson
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
-- endregion ATISConfigFunctions
|
|
116
|
+
|
|
62
117
|
ATISArray = {}
|
|
63
|
-
compteur = 0
|
|
64
118
|
MenuCoalitionAtis = {}
|
|
65
|
-
|
|
66
|
-
MenuCoalitionAtis[
|
|
67
|
-
|
|
119
|
+
for _k, _coalition in pairs(coalition.side) do
|
|
120
|
+
MenuCoalitionAtis[UTILS.GetCoalitionName(_coalition)] = MENU_COALITION:New(_coalition, "Atis", MenuCoalition[UTILS.GetCoalitionName(_coalition)])
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
local compteur = #ATISArray
|
|
124
|
+
for _index, _currentAtisConfigObject in ipairs(AtisConfig or {}) do
|
|
125
|
+
local atisconfig = ParseAtisConfigJson(_currentAtisConfigObject)
|
|
68
126
|
if atisconfig.enable == true then
|
|
69
127
|
compteur = compteur + 1
|
|
70
|
-
|
|
128
|
+
Jtff_log.info(
|
|
129
|
+
string.format(
|
|
130
|
+
"Creation ATIS at airfield %s",
|
|
131
|
+
atisconfig.airfield
|
|
132
|
+
),
|
|
133
|
+
"ATIS"
|
|
134
|
+
)
|
|
71
135
|
local objAtis = ATIS:New(atisconfig.airfield, atisconfig.radio.freq, atisconfig.radio.modulation)
|
|
72
136
|
:SetImperialUnits()
|
|
73
|
-
:SetSoundfilesPath(
|
|
137
|
+
:SetSoundfilesPath(SoundFilesPrefix .. 'ATIS/ATIS Soundfiles/')
|
|
74
138
|
:SetSubtitleDuration(0)
|
|
75
139
|
:SetMapMarks(true)
|
|
76
|
-
if (atisconfig.
|
|
77
|
-
objAtis:SetRadioRelayUnitName(atisconfig.
|
|
140
|
+
if (atisconfig.relayunit) then
|
|
141
|
+
objAtis:SetRadioRelayUnitName(atisconfig.relayunit)
|
|
78
142
|
else
|
|
79
143
|
if (atisconfig.radio.power) then
|
|
80
144
|
objAtis:SetRadioPower(atisconfig.radio.power)
|
|
@@ -109,27 +173,26 @@ for index, atisconfig in ipairs(AtisConfig) do
|
|
|
109
173
|
end
|
|
110
174
|
objAtis.customconfig = atisconfig
|
|
111
175
|
objAtis.menu = {}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
atisconfig.airfield
|
|
125
|
-
)
|
|
176
|
+
for _k, _coalition in pairs(coalition.side) do
|
|
177
|
+
objAtis.menu[_coalition] = MENU_COALITION_COMMAND:New(
|
|
178
|
+
_coalition,
|
|
179
|
+
string.format(
|
|
180
|
+
"Disable Auto Atis at %s",
|
|
181
|
+
atisconfig.airfield
|
|
182
|
+
),
|
|
183
|
+
MenuCoalitionAtis[UTILS.GetCoalitionName(_coalition)],
|
|
184
|
+
DisableAtis,
|
|
185
|
+
atisconfig.airfield
|
|
186
|
+
)
|
|
187
|
+
end
|
|
126
188
|
ATISArray[compteur] = objAtis
|
|
127
189
|
ATISArray[compteur]:Start()
|
|
128
190
|
end
|
|
129
191
|
end
|
|
130
192
|
|
|
131
193
|
if compteur == 0 then
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
194
|
+
for _k, _coalition in pairs(coalition.side) do
|
|
195
|
+
MenuCoalitionAtis[UTILS.GetCoalitionName(_coalition)]:Remove()
|
|
196
|
+
end
|
|
197
|
+
MenuCoalitionAtis = {}
|
|
135
198
|
end
|
|
@@ -2,92 +2,160 @@
|
|
|
2
2
|
-- ** CAPZone Training **
|
|
3
3
|
-- *********************************************************
|
|
4
4
|
function wipeCapZone(objCAPZone)
|
|
5
|
-
|
|
5
|
+
while (#(objCAPZone.objFlightGroups) > 0) do
|
|
6
|
+
Jtff_log.debug(string.format("Wipe CAP Zone : %s, before wipe remaining flight groups: %d", objCAPZone.customconfig.name, #(objCAPZone.objFlightGroups)),"CAP_ZONE_TRAINING")
|
|
7
|
+
if objCAPZone.objFlightGroups[1].MissionPatrol then
|
|
8
|
+
objCAPZone.objFlightGroups[1].MissionPatrol.markerOn = false
|
|
9
|
+
if objCAPZone.objFlightGroups[1].MissionPatrol.marker then
|
|
10
|
+
objCAPZone.objFlightGroups[1].MissionPatrol.marker:Remove()
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
objCAPZone.objFlightGroups[1]:Destroy()
|
|
14
|
+
objCAPZone.objFlightGroups[1]:__Stop(10)
|
|
15
|
+
table.remove(objCAPZone.objFlightGroups, 1)
|
|
16
|
+
Jtff_log.debug(string.format("Wipe CAP Zone : %s, after wipe remaining flight groups: %d", objCAPZone.customconfig.name, #(objCAPZone.objFlightGroups)),"CAP_ZONE_TRAINING")
|
|
17
|
+
end
|
|
18
|
+
objCAPZone.objFlightGroups = {}
|
|
19
|
+
-- fctKillSpawnObject(objCAPZone.objSpawn)
|
|
6
20
|
trigger.action.outText('CAP Training Zone '..(objCAPZone.customconfig.name)..' cleaned !!', 30)
|
|
21
|
+
Jtff_log.info(string.format("Wipe CAP Zone : %s", objCAPZone.customconfig.name),"CAP_ZONE_TRAINING")
|
|
7
22
|
end
|
|
8
23
|
|
|
9
|
-
function startCapZone(
|
|
24
|
+
function startCapZone(params)
|
|
25
|
+
local objCAPZone = params[1]
|
|
26
|
+
local effectiveForce = params[2] or 2
|
|
27
|
+
objCAPZone.objSpawn:InitGrouping(effectiveForce)
|
|
10
28
|
local AICapGroup = objCAPZone.objSpawn:SpawnInZone(objCAPZone.objPatrolZone,
|
|
11
29
|
true
|
|
12
30
|
)
|
|
13
|
-
local objCAP = AI_CAP_ZONE:New(
|
|
14
|
-
objCAPZone.objPatrolZone,
|
|
15
|
-
UTILS.Round(objCAPZone.customconfig.capParameters.patrolFloor*0.3048,0),
|
|
16
|
-
UTILS.Round(objCAPZone.customconfig.capParameters.patrolCeiling*0.3048,0),
|
|
17
|
-
UTILS.Round(objCAPZone.customconfig.capParameters.minPatrolSpeed*1.852,0),
|
|
18
|
-
UTILS.Round(objCAPZone.customconfig.capParameters.maxPatrolSpeed*1.852,0),
|
|
19
|
-
AI.Task.AltitudeType.BARO
|
|
20
|
-
)
|
|
21
|
-
objCAP:SetControllable(AICapGroup)
|
|
22
|
-
objCAP:SetEngageZone(objCAPZone.objEngageZone)
|
|
23
|
-
objCAP:__Start(1)
|
|
24
|
-
--local objAiCapZone = AI_CAP_ZONE:New(
|
|
25
|
-
-- objCAPZone.objPatrolZone,
|
|
26
|
-
-- UTILS.Round(objCAPZone.customconfig.capParameters.patrolFloor*0.3048,0),
|
|
27
|
-
-- UTILS.Round(objCAPZone.customconfig.capParameters.patrolCeiling*0.3048,0),
|
|
28
|
-
-- UTILS.Round(objCAPZone.customconfig.capParameters.minPatrolSpeed*1.852,0),
|
|
29
|
-
-- UTILS.Round(objCAPZone.customconfig.capParameters.maxPatrolSpeed*1.852,0),
|
|
30
|
-
-- AI.Task.AltitudeType.BARO
|
|
31
|
-
--)
|
|
32
|
-
--function objAiCapZone:OnAfterStart(from, event, to)
|
|
33
|
-
--end
|
|
34
|
-
|
|
35
|
-
--objAiCapZone:SetControllable(
|
|
36
|
-
-- objCAPZone.objSpawn:SpawnInZone(objCAPZone.objPatrolZone,
|
|
37
|
-
-- true
|
|
38
|
-
-- )
|
|
39
|
-
--)
|
|
40
31
|
end
|
|
41
32
|
|
|
42
33
|
|
|
43
34
|
CAPZoneArray = {}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
MenuCoalitionCAPZoneBlue = MENU_COALITION:New(coalition.side.BLUE, "Hostile CAP Zones", MenuCoalition[coalition.side.BLUE])
|
|
36
|
+
MenuCoalitionCAPZoneRed = MENU_COALITION:New(coalition.side.RED, "Hostile CAP Zones", MenuCoalition[coalition.side.RED])
|
|
37
|
+
local compteur = #CAPZoneArray
|
|
47
38
|
for index, capzoneconfig in ipairs(TrainingCAPConfig) do
|
|
48
39
|
if capzoneconfig.enable == true then
|
|
49
40
|
compteur = compteur + 1
|
|
50
|
-
|
|
41
|
+
Jtff_log.info(string.format("creation CAP Zone : %s", capzoneconfig.name),"CAP_ZONE_TRAINING")
|
|
51
42
|
objCapZone = {}
|
|
43
|
+
objCapZone.objFlightGroups = {}
|
|
52
44
|
objCapZone.objSpawn = SPAWN:New(capzoneconfig.CAPGoups[1])
|
|
53
45
|
:InitSkill(capzoneconfig.skill)
|
|
54
46
|
:InitRandomizeTemplate(capzoneconfig.CAPGoups)
|
|
55
|
-
:OnSpawnGroup(function(SpawnGroup)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
--
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
47
|
+
:OnSpawnGroup(function(SpawnGroup, objCapZone)
|
|
48
|
+
-- ******************************************************
|
|
49
|
+
-- ** OnGroupSpawn : Setup FlightGroup and mission **
|
|
50
|
+
-- ******************************************************
|
|
51
|
+
-- **********************Flight GroupSetup*************************
|
|
52
|
+
Jtff_log.info(string.format("Group spawned : %s - %s", SpawnGroup:GetName(), SpawnGroup:GetTypeName()),"CAP_ZONE_TRAINING")
|
|
53
|
+
local flightgroup = FLIGHTGROUP:New(SpawnGroup)
|
|
54
|
+
Jtff_log.debug(string.format("FlightGroup created from group %s", SpawnGroup:GetName()),"CAP_ZONE_TRAINING")
|
|
55
|
+
flightgroup:SetFuelCriticalThreshold(15)
|
|
56
|
+
flightgroup:SetFuelLowThreshold(25)
|
|
57
|
+
flightgroup:SetOutOfAAMRTB(true)
|
|
58
|
+
flightgroup:SetFuelCriticalRTB(true)
|
|
59
|
+
flightgroup:SetFuelLowRTB(true)
|
|
60
|
+
flightgroup:SetAllowAfterburner()
|
|
61
|
+
flightgroup:SetDetection(true)
|
|
62
|
+
Jtff_log.debug(string.format("FlightGroup %s goes nose hot !", SpawnGroup:GetName()),"CAP_ZONE_TRAINING")
|
|
63
|
+
flightgroup:SetVerbosity(JTFF_verbosity_levels[JTFF_LOGLEVEL])
|
|
64
|
+
function flightgroup:OnAfterDead(From, Event, To)
|
|
65
|
+
self:CancelAllMissions()
|
|
66
|
+
self.MissionPatrol.markerOn = false
|
|
67
|
+
if self.MissionPatrol.marker then
|
|
68
|
+
self.MissionPatrol.marker:Remove()
|
|
69
|
+
end
|
|
70
|
+
self.MissionPatrol:Stop()
|
|
71
|
+
self.MissionPatrol = nil
|
|
72
|
+
Jtff_log.debug(string.format("Zone %s: FlightGroup %s Dead !", objCapZone.customconfig.name, SpawnGroup:GetName()),"CAP_ZONE_TRAINING")
|
|
73
|
+
self:__Stop(10)
|
|
74
|
+
end
|
|
75
|
+
function flightgroup:OnAfterRTB(From, Event, To, airbase)
|
|
76
|
+
Jtff_log.debug(string.format("Zone %s: FlightGroup %s is RTB to %s !", objCapZone.customconfig.name, SpawnGroup:GetName(), airbase:GetName()),"CAP_ZONE_TRAINING")
|
|
77
|
+
self:CancelAllMissions()
|
|
78
|
+
self.MissionPatrol.markerOn = false
|
|
79
|
+
if self.MissionPatrol.marker then
|
|
80
|
+
self.MissionPatrol.marker:Remove()
|
|
81
|
+
end
|
|
82
|
+
self.MissionPatrol:Stop()
|
|
83
|
+
for index, curFlightGroup in ipairs(objCapZone.objFlightGroups) do
|
|
84
|
+
if curFlightGroup:GetName() == self:GetName() then
|
|
85
|
+
table.remove(objCapZone.objFlightGroups, index)
|
|
86
|
+
break
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
if objCapZone.customconfig.airBaseName and AIRBASE:FindByName(objCapZone.customconfig.airBaseName) then
|
|
91
|
+
flightgroup:SetHomebase(AIRBASE:FindByName(objCapZone.customconfig.airBaseName))
|
|
92
|
+
end
|
|
93
|
+
-- *********************Mission Setup******************************
|
|
94
|
+
flightgroup.MissionPatrol = AUFTRAG:NewPATROL_RACETRACK(
|
|
95
|
+
objCapZone.objPatrolZone:GetRandomCoordinate(),
|
|
96
|
+
objCapZone.customconfig.capParameters.patrolAltitude,
|
|
97
|
+
objCapZone.customconfig.capParameters.patrolSpeed,
|
|
98
|
+
objCapZone.customconfig.capParameters.patrolHeading,
|
|
99
|
+
objCapZone.customconfig.capParameters.patrolLegLength,
|
|
100
|
+
ENUMS.Formation.FixedWing.LineAbreast.Group
|
|
101
|
+
)
|
|
102
|
+
flightgroup.MissionPatrol:SetName(
|
|
103
|
+
string.format('MISSION_CAP_PATROL_%s_%d', objCapZone.customconfig.name, #objCapZone.objFlightGroups + 1)
|
|
104
|
+
)
|
|
105
|
+
flightgroup.MissionPatrol:SetEngageDetected(
|
|
106
|
+
150,
|
|
107
|
+
{"All"},
|
|
108
|
+
objCapZone.objEngageZone
|
|
109
|
+
)
|
|
110
|
+
if objCapZone.customconfig.coalitionCAP == coalition.side.RED then
|
|
111
|
+
flightgroup.MissionPatrol:SetEnableMarkers(coalition.side.BLUE)
|
|
112
|
+
else
|
|
113
|
+
flightgroup.MissionPatrol:SetEnableMarkers(coalition.side.RED)
|
|
114
|
+
end
|
|
115
|
+
flightgroup.MissionPatrol.markerOn = (JTFF_verbosity_levels[JTFF_LOGLEVEL] >= 1)
|
|
116
|
+
flightgroup.MissionPatrol:UpdateMarker()
|
|
117
|
+
flightgroup.MissionPatrol:SetDuration((10*60*60))
|
|
118
|
+
flightgroup.MissionPatrol:SetVerbosity(JTFF_verbosity_levels[JTFF_LOGLEVEL])
|
|
119
|
+
|
|
120
|
+
-- ****************************Mission Add to FlightGroup**********************
|
|
121
|
+
flightgroup:AddMission(flightgroup.MissionPatrol)
|
|
122
|
+
flightgroup:MissionStart(flightgroup.MissionPatrol)
|
|
123
|
+
table.insert(objCapZone.objFlightGroups, flightgroup)
|
|
124
|
+
Jtff_log.debug(string.format("FlightGroup %s is assigned mission %s", SpawnGroup:GetName(), flightgroup.MissionPatrol:GetName()),"CAP_ZONE_TRAINING")
|
|
125
|
+
end, objCapZone)
|
|
126
|
+
|
|
127
|
+
-- ******************************************
|
|
128
|
+
-- ** Set Patrol Zone **
|
|
129
|
+
-- ******************************************
|
|
69
130
|
if capzoneconfig.patrolZoneGroupName then
|
|
70
131
|
objCapZone.objPatrolZone = ZONE_POLYGON:New(
|
|
71
132
|
'CAP_PATROL_ZONE_'..capzoneconfig.name,
|
|
72
133
|
GROUP:FindByName(capzoneconfig.patrolZoneGroupName))
|
|
73
|
-
|
|
134
|
+
Jtff_log.info(string.format("Patrol zone Polygon created : %s", objCapZone.objPatrolZone:GetName()),"CAP_ZONE_TRAINING")
|
|
74
135
|
else
|
|
75
136
|
if capzoneconfig.patrolZoneName then
|
|
76
137
|
objCapZone.objPatrolZone = ZONE:New(capzoneconfig.patrolZoneName)
|
|
77
138
|
end
|
|
78
139
|
end
|
|
140
|
+
-- ******************************************
|
|
141
|
+
-- ** Set Engage Zone **
|
|
142
|
+
-- ******************************************
|
|
79
143
|
if capzoneconfig.engageZoneGroupName then
|
|
80
144
|
objCapZone.objEngageZone = ZONE_POLYGON:New(
|
|
81
145
|
'CAP_ENGAGE_ZONE_'..capzoneconfig.name,
|
|
82
146
|
GROUP:FindByName(capzoneconfig.engageZoneGroupName))
|
|
83
|
-
|
|
147
|
+
Jtff_log.info(string.format("Engage zone Polygon created : %s", objCapZone.objEngageZone:GetName()),"CAP_ZONE_TRAINING")
|
|
84
148
|
else
|
|
85
149
|
if capzoneconfig.engageZoneName then
|
|
86
150
|
objCapZone.objEngageZone = ZONE:New(capzoneconfig.engageZoneName)
|
|
87
151
|
end
|
|
88
152
|
end
|
|
153
|
+
|
|
154
|
+
-- ******************************************
|
|
155
|
+
-- ** Draw Engage Zone **
|
|
156
|
+
-- ******************************************
|
|
89
157
|
if capzoneconfig.coalitionCAP == coalition.side.RED then
|
|
90
|
-
if ((capzoneconfig.drawzone == true) or false) then
|
|
158
|
+
if ((capzoneconfig.drawzone == true) or false or (JTFF_verbosity_levels[JTFF_LOGLEVEL] >= 5)) then
|
|
91
159
|
objCapZone.objEngageZone:DrawZone(
|
|
92
160
|
coalition.side.BLUE,
|
|
93
161
|
{1,0,0},
|
|
@@ -110,7 +178,7 @@ for index, capzoneconfig in ipairs(TrainingCAPConfig) do
|
|
|
110
178
|
)
|
|
111
179
|
end
|
|
112
180
|
else
|
|
113
|
-
if ((capzoneconfig.drawzone == true) or false) then
|
|
181
|
+
if ((capzoneconfig.drawzone == true) or false or (JTFF_verbosity_levels[JTFF_LOGLEVEL] >= 5)) then
|
|
114
182
|
objCapZone.objEngageZone:DrawZone(
|
|
115
183
|
coalition.side.RED,
|
|
116
184
|
{1,0,0},
|
|
@@ -133,42 +201,77 @@ for index, capzoneconfig in ipairs(TrainingCAPConfig) do
|
|
|
133
201
|
)
|
|
134
202
|
end
|
|
135
203
|
end
|
|
204
|
+
-- *****************************************
|
|
205
|
+
-- ** Set Custom Config **
|
|
206
|
+
-- *****************************************
|
|
136
207
|
objCapZone.customconfig = capzoneconfig
|
|
137
208
|
CAPZoneArray[compteur] = objCapZone
|
|
209
|
+
-- ******************************************
|
|
210
|
+
-- ** Set Menu Commands **
|
|
211
|
+
-- ******************************************
|
|
138
212
|
if capzoneconfig.coalitionCAP == coalition.side.RED then
|
|
139
213
|
MENU_COALITION_COMMAND:New(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
214
|
+
coalition.side.BLUE,
|
|
215
|
+
string.format("Zone %s : Spawn %d Hostile(s)", capzoneconfig.name, 1),
|
|
216
|
+
MenuCoalitionCAPZoneBlue,
|
|
217
|
+
startCapZone,
|
|
218
|
+
{CAPZoneArray[compteur], 1}
|
|
219
|
+
)
|
|
220
|
+
MENU_COALITION_COMMAND:New(
|
|
221
|
+
coalition.side.BLUE,
|
|
222
|
+
string.format("Zone %s : Spawn %d Hostile(s)", capzoneconfig.name, 2),
|
|
223
|
+
MenuCoalitionCAPZoneBlue,
|
|
224
|
+
startCapZone,
|
|
225
|
+
{CAPZoneArray[compteur], 2}
|
|
226
|
+
)
|
|
227
|
+
MENU_COALITION_COMMAND:New(
|
|
228
|
+
coalition.side.BLUE,
|
|
229
|
+
string.format("Zone %s : Spawn %d Hostile(s)", capzoneconfig.name, 4),
|
|
230
|
+
MenuCoalitionCAPZoneBlue,
|
|
231
|
+
startCapZone,
|
|
232
|
+
{CAPZoneArray[compteur], 4}
|
|
233
|
+
)
|
|
145
234
|
MENU_COALITION_COMMAND:New(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
235
|
+
coalition.side.BLUE,
|
|
236
|
+
string.format("Zone %s : Clean", capzoneconfig.name),
|
|
237
|
+
MenuCoalitionCAPZoneBlue,
|
|
238
|
+
wipeCapZone,
|
|
239
|
+
CAPZoneArray[compteur]
|
|
151
240
|
)
|
|
152
241
|
else
|
|
153
242
|
MENU_COALITION_COMMAND:New(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
243
|
+
coalition.side.RED,
|
|
244
|
+
string.format("Zone %s : Spawn %d Hostile(s)", capzoneconfig.name, 1),
|
|
245
|
+
MenuCoalitionCAPZoneRed,
|
|
246
|
+
startCapZone,
|
|
247
|
+
{CAPZoneArray[compteur], 1}
|
|
248
|
+
)
|
|
249
|
+
MENU_COALITION_COMMAND:New(
|
|
250
|
+
coalition.side.RED,
|
|
251
|
+
string.format("Zone %s : Spawn %d Hostile(s)", capzoneconfig.name, 2),
|
|
252
|
+
MenuCoalitionCAPZoneRed,
|
|
253
|
+
startCapZone,
|
|
254
|
+
{CAPZoneArray[compteur], 2}
|
|
255
|
+
)
|
|
256
|
+
MENU_COALITION_COMMAND:New(
|
|
257
|
+
coalition.side.RED,
|
|
258
|
+
string.format("Zone %s : Spawn %d Hostile(s)", capzoneconfig.name, 4),
|
|
259
|
+
MenuCoalitionCAPZoneRed,
|
|
260
|
+
startCapZone,
|
|
261
|
+
{CAPZoneArray[compteur], 4}
|
|
262
|
+
)
|
|
159
263
|
MENU_COALITION_COMMAND:New(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
264
|
+
coalition.side.RED,
|
|
265
|
+
string.format("Zone %s : Clean", capzoneconfig.name),
|
|
266
|
+
MenuCoalitionCAPZoneRed,
|
|
267
|
+
wipeCapZone,
|
|
268
|
+
CAPZoneArray[compteur]
|
|
165
269
|
)
|
|
166
270
|
end
|
|
167
|
-
--CAPZoneArray[compteur]:Start()
|
|
168
271
|
end
|
|
169
272
|
end
|
|
170
273
|
|
|
171
|
-
if
|
|
274
|
+
if #CAPZoneArray == 0 then
|
|
172
275
|
MenuCoalitionCAPZoneBlue:Remove()
|
|
173
276
|
MenuCoalitionCAPZoneRed:Remove()
|
|
174
277
|
end
|