@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
|
@@ -1,22 +1,101 @@
|
|
|
1
|
+
-- region RATConfigFunctions
|
|
2
|
+
|
|
3
|
+
-- @type RATConfig
|
|
4
|
+
-- @field #string name Name of the RAT scenario.
|
|
5
|
+
-- @field #boolean enable Enable the RAT scenario.
|
|
6
|
+
-- @field #number constant_alive_groups Number of groups to keep alive at all times.
|
|
7
|
+
-- @field #RATGroupConfig[] aircrafts_groupconfigs Table of aircraft group configurations.
|
|
8
|
+
|
|
9
|
+
-- @type RATGroupConfig
|
|
10
|
+
-- @field #string[] templatename Template name (string or table of strings).
|
|
11
|
+
-- @field #number minimun_spawns Minimum number of spawns.
|
|
12
|
+
-- @field #number inactive_timer Inactive timer in seconds.
|
|
13
|
+
-- @field #boolean atcmessage_enable Enable ATC messages.
|
|
14
|
+
-- @field #number flightlevelmin Flight level in feet.
|
|
15
|
+
-- @field #number flightlevelmaw Flight level in feet.
|
|
16
|
+
-- @field #number speed Speed in knots.
|
|
17
|
+
-- @field #table liveries Table of liveries.
|
|
18
|
+
-- @field #boolean allow_immortal Allow immortal groups.
|
|
19
|
+
-- @field #boolean allow_invisible Allow invisible groups.
|
|
20
|
+
-- @field #boolean commute Allow commute.
|
|
21
|
+
-- @field #boolean despawnAirborne Allow Despawn when entering arrival zone.
|
|
22
|
+
-- @field #RATAirbasesConfig airbases_names Table of airbases names.
|
|
23
|
+
|
|
24
|
+
-- @type RATAirbasesConfig
|
|
25
|
+
-- @field #string[] departure Departure airbases or zone names.
|
|
26
|
+
-- @field #string[] arrival Arrival airbases or zone names.
|
|
27
|
+
|
|
28
|
+
--- Parse a RAT config Object.
|
|
29
|
+
-- @param #JsonObject config Config object to parse
|
|
30
|
+
-- @return #RATConfig ratConfigJson Parsed QRA config object
|
|
31
|
+
function ParseRATConfigJson(config)
|
|
32
|
+
local json = require('Scripts/json')
|
|
33
|
+
local parser_name = "RAT"
|
|
34
|
+
-- **************************************************************************
|
|
35
|
+
-- enable
|
|
36
|
+
-- **************************************************************************
|
|
37
|
+
local ratConfigJson = {}
|
|
38
|
+
if config.enable == true then
|
|
39
|
+
ratConfigJson = config
|
|
40
|
+
else
|
|
41
|
+
ratConfigJson = {
|
|
42
|
+
enable = false,
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
Jtff_log.debug(
|
|
46
|
+
string.format(
|
|
47
|
+
"parsed RAT config for %s, resulting config :\n%s",
|
|
48
|
+
config.name or "",
|
|
49
|
+
json:encode(
|
|
50
|
+
ratConfigJson,
|
|
51
|
+
{ indent = true }
|
|
52
|
+
)
|
|
53
|
+
),
|
|
54
|
+
parser_name
|
|
55
|
+
)
|
|
56
|
+
return ratConfigJson
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
-- endregion RATConfigFunctions
|
|
60
|
+
|
|
61
|
+
-- region RATFunctions
|
|
62
|
+
-- endregion RATFunctions
|
|
63
|
+
|
|
1
64
|
-- *****************************************************************************
|
|
2
65
|
-- ** Random Air Traffic **
|
|
3
66
|
-- *********************************************************
|
|
4
67
|
RATManagerArray = {}
|
|
5
|
-
compteur =
|
|
6
|
-
|
|
68
|
+
local compteur = #RATManagerArray
|
|
69
|
+
|
|
70
|
+
for index, currentRATConfigObject in ipairs(RATConfig) do
|
|
71
|
+
local ratconfig = ParseRATConfigJson(currentRATConfigObject)
|
|
7
72
|
if ratconfig.enable == true then
|
|
8
|
-
|
|
73
|
+
Jtff_log.info(
|
|
74
|
+
string.format(
|
|
75
|
+
"RATManager %s Enable",
|
|
76
|
+
ratconfig.name
|
|
77
|
+
),
|
|
78
|
+
"RAT"
|
|
79
|
+
)
|
|
9
80
|
compteur = compteur +1
|
|
10
81
|
local ratManagerName = ratconfig.name or "unknown"
|
|
11
82
|
RATManagerArray[compteur] = RATMANAGER:New(ratconfig.constant_alive_groups or nil)
|
|
12
83
|
RATManagerArray[compteur].RATObjectsArray = {}
|
|
84
|
+
|
|
13
85
|
for index_planegroup, planegroupconfig in ipairs(ratconfig.aircrafts_groupconfigs) do
|
|
14
86
|
if (type(planegroupconfig.templatename) == "string") then
|
|
15
87
|
planegroupconfig.templatename = {planegroupconfig.templatename}
|
|
16
88
|
end
|
|
17
89
|
if (type(planegroupconfig.templatename) == "table") then
|
|
18
90
|
for templateindex, templatename in ipairs(planegroupconfig.templatename) do
|
|
19
|
-
|
|
91
|
+
Jtff_log.debug(
|
|
92
|
+
string.format(
|
|
93
|
+
"RATManager %s - template %s",
|
|
94
|
+
ratManagerName,
|
|
95
|
+
templatename
|
|
96
|
+
),
|
|
97
|
+
"RAT"
|
|
98
|
+
)
|
|
20
99
|
RATManagerArray[compteur].RATObjectsArray[templateindex] = RAT:New(templatename)
|
|
21
100
|
if (type(planegroupconfig.airbases_names) == "table" ) then
|
|
22
101
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:SetTakeoff("cold")
|
|
@@ -30,6 +109,9 @@ for index, ratconfig in ipairs(RATConfig) do
|
|
|
30
109
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:DestinationZone()
|
|
31
110
|
end
|
|
32
111
|
end
|
|
112
|
+
if (type(planegroupconfig.despawnAirborne) == "boolean" and planegroupconfig.despawnAirborne == true) then
|
|
113
|
+
RATManagerArray[compteur].RATObjectsArray[templateindex]:DestinationZone()
|
|
114
|
+
end
|
|
33
115
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:SetDeparture(planegroupconfig.airbases_names.departure)
|
|
34
116
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:SetDestination(planegroupconfig.airbases_names.arrival)
|
|
35
117
|
end
|
|
@@ -41,8 +123,11 @@ for index, ratconfig in ipairs(RATConfig) do
|
|
|
41
123
|
else
|
|
42
124
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:ATC_Messages(false)
|
|
43
125
|
end
|
|
44
|
-
if (type(planegroupconfig.
|
|
45
|
-
RATManagerArray[compteur].RATObjectsArray[templateindex]:
|
|
126
|
+
if (type(planegroupconfig.flightlevelmin) == "number" ) then
|
|
127
|
+
RATManagerArray[compteur].RATObjectsArray[templateindex]:SetFLmin(planegroupconfig.flightlevelmin)
|
|
128
|
+
end
|
|
129
|
+
if (type(planegroupconfig.flightlevelmax) == "number" ) then
|
|
130
|
+
RATManagerArray[compteur].RATObjectsArray[templateindex]:SetFLmax(planegroupconfig.flightlevelmax)
|
|
46
131
|
end
|
|
47
132
|
if (type(planegroupconfig.speed) == "number") then
|
|
48
133
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:SetMaxCruiseSpeed(UTILS.KnotsToKmph(planegroupconfig.speed))
|
|
@@ -53,23 +138,27 @@ for index, ratconfig in ipairs(RATConfig) do
|
|
|
53
138
|
if (type(planegroupconfig.allow_immortal) == "boolean" and planegroupconfig.allow_immortal == true) then
|
|
54
139
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:Immortal()
|
|
55
140
|
end
|
|
56
|
-
if (type(planegroupconfig.allow_invisible) == "boolean" and planegroupconfig.allow_invisible ==
|
|
141
|
+
if not(type(planegroupconfig.allow_invisible) == "boolean" and planegroupconfig.allow_invisible == false) then
|
|
57
142
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:Invisible()
|
|
58
143
|
end
|
|
59
144
|
if (type(planegroupconfig.commute) == "boolean" and planegroupconfig.commute == true) then
|
|
60
145
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:Commute(true)
|
|
61
146
|
end
|
|
62
147
|
RATManagerArray[compteur].RATObjectsArray[templateindex]:SetEPLRS(true)
|
|
148
|
+
RATManagerArray[compteur].RATObjectsArray[templateindex]:SetROT(ENUMS.ROT.NoReaction)
|
|
63
149
|
RATManagerArray[compteur]:Add(RATManagerArray[compteur].RATObjectsArray[templateindex], planegroupconfig.minimun_spawns)
|
|
64
|
-
--RATManagerArray[compteur].RATObjectsArray[templateindex]:SetSpawnInterval(planegroupconfig.inactive_timer)
|
|
65
|
-
--RATManagerArray[compteur].RATObjectsArray[templateindex]:InitRepeat()
|
|
66
|
-
--RATManagerArray[compteur].RATObjectsArray[templateindex]:Spawn()
|
|
67
150
|
end
|
|
68
151
|
else
|
|
69
|
-
|
|
152
|
+
Jtff_log.error(
|
|
153
|
+
string.format(
|
|
154
|
+
"RAT error in template name type : %s",
|
|
155
|
+
planegroupconfig.templatename
|
|
156
|
+
),
|
|
157
|
+
"RAT"
|
|
158
|
+
)
|
|
70
159
|
end
|
|
71
160
|
end
|
|
72
161
|
RATManagerArray[compteur].customconfig = ratconfig
|
|
73
|
-
RATManagerArray[compteur]:Start(
|
|
162
|
+
RATManagerArray[compteur]:Start(SpawnStandardDelay)
|
|
74
163
|
end
|
|
75
164
|
end
|