@jtff/miztemplate-lib 3.10.3 → 3.10.5
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/src/020-mission_functions.lua +1 -1
- package/lua/src/110-set_clients.lua +57 -57
- package/lua/src/120-tankers.lua +208 -209
- package/lua/src/130-airboss.lua +907 -562
- package/lua/src/150-awacs.lua +202 -203
- package/package.json +1 -1
package/lua/src/130-airboss.lua
CHANGED
|
@@ -1,54 +1,6 @@
|
|
|
1
1
|
-- *****************************************************************************
|
|
2
2
|
-- ** AirBoss **
|
|
3
3
|
-- *********************************************************
|
|
4
|
-
function detectShitHotBreak(objAirboss)
|
|
5
|
-
local clientData={}
|
|
6
|
-
local player_name=""
|
|
7
|
-
jtff_log.debug('detectShitHotBreak : '.. objAirboss.customconfig.alias .. ' has ' .. objAirboss.CVNClients:Count()..' clients in Set ...',"AIRBOSS")
|
|
8
|
-
objAirboss.CVNClients:ForEachClientInZone( objAirboss.CVN_UNITZone,
|
|
9
|
-
function( MooseClient )
|
|
10
|
-
|
|
11
|
-
local function resetFlag(userflag)
|
|
12
|
-
--trigger.action.outText('RESET SH Pass FLAG)', 5 )
|
|
13
|
-
userflag:Set(0)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
local player_velocity = MooseClient:GetVelocityKNOTS()
|
|
17
|
-
local player_name = MooseClient:GetPlayerName()
|
|
18
|
-
local player_type = MooseClient:GetTypeName()
|
|
19
|
-
local player_fuel = MooseClient:GetFuel()
|
|
20
|
-
local player_alt_feet = UTILS.MetersToFeet(MooseClient:GetAltitude())
|
|
21
|
-
--trigger.action.outText('ForEachClientInZone: MooseClient name is '..player_name , 5)
|
|
22
|
-
|
|
23
|
-
local Play_SH_Sound = USERSOUND:New( soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/GreatBallsOfFire.ogg" )
|
|
24
|
-
--trigger.action.outText(player_name..' altitude is '..player_alt_feet..' feet', 5)
|
|
25
|
-
--trigger.action.outText(player_name..' speed is '..player_velocity, 5)
|
|
26
|
-
local client_in_zone_flag = USERFLAG:New(MooseClient:GetUCID())
|
|
27
|
-
local client_performing_sh = USERFLAG:New(MooseClient:GetUCID()..'_sh')
|
|
28
|
-
|
|
29
|
-
if client_in_zone_flag:Get() == 0 and player_velocity > 475 and player_alt_feet < 700 then
|
|
30
|
-
-- Requirements for Shit Hot break are velocity >475 knots and less than 700 feet
|
|
31
|
-
trigger.action.outText(player_name..' performing a Sierra Hotel Break around ' .. objAirboss.customconfig.alias .. ' !', 10)
|
|
32
|
-
local sh_message_to_discord = ('**'..player_name..' is performing a Sierra Hotel Break at '..UTILS.Round(player_velocity, 0)..' knots and '..player_alt_feet..' feet!**')
|
|
33
|
-
FunkMan:SendTable({
|
|
34
|
-
command="moose_text",
|
|
35
|
-
text=sh_message_to_discord,
|
|
36
|
-
msg_type='lso'
|
|
37
|
-
})
|
|
38
|
-
Play_SH_Sound:ToClient(MooseClient)
|
|
39
|
-
client_in_zone_flag:Set(1)
|
|
40
|
-
client_performing_sh:Set(1)
|
|
41
|
-
timer.scheduleFunction(resetFlag, {client_in_zone_flag}, timer.getTime() + 5 * 60)
|
|
42
|
-
else
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
--trigger.action.outText('ForEachClientInZone: Client name is '..player_name , 5)
|
|
46
|
-
--trigger.action.outText('ForEachClientInZone: Client fuel is '..player_fuel , 5)
|
|
47
|
-
|
|
48
|
-
end
|
|
49
|
-
)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
4
|
function switchCarrierDefCon2(params)
|
|
53
5
|
local carrierName = params[1]
|
|
54
6
|
local timeMinutes = params[2]
|
|
@@ -57,15 +9,15 @@ function switchCarrierDefCon2(params)
|
|
|
57
9
|
cvGroup:OptionROE(ENUMS.ROE.WeaponFree):OptionAlarmStateRed()
|
|
58
10
|
jtff_log.info(string.format("CSG : %s DEFCON 2 -> ROE = %d", carrierName, ENUMS.ROE.WeaponFree),"AIRBOSS")
|
|
59
11
|
SCHEDULER:New(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
12
|
+
nil,
|
|
13
|
+
function(carrierName)
|
|
14
|
+
jtff_log.info(carrierName .. " switchback to DEFCON 4","AIRBOSS")
|
|
15
|
+
jtff_log.info(string.format("CSG : %s DEFCON 4 -> ROE = %d", carrierName, ENUMS.ROE.ReturnFire),"AIRBOSS")
|
|
16
|
+
UNIT:FindByName(carrierName):GetGroup():OptionROE(ENUMS.ROE.ReturnFire):OptionAlarmStateRed()
|
|
17
|
+
end,
|
|
18
|
+
{ carrierName },
|
|
19
|
+
timeMinutes*60
|
|
20
|
+
)
|
|
69
21
|
end
|
|
70
22
|
|
|
71
23
|
function forceCarrierDefCon4(params)
|
|
@@ -76,41 +28,48 @@ function forceCarrierDefCon4(params)
|
|
|
76
28
|
end
|
|
77
29
|
|
|
78
30
|
function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop)
|
|
31
|
+
--navyNightCondition : Day by default
|
|
32
|
+
local navyNightCondition = false
|
|
79
33
|
if (CVNCoordinates) then
|
|
80
34
|
if (type(tonumber(CVNCoordinates:GetSunset(true))) ~= "nil" and type(tonumber(CVNCoordinates:GetSunrise(true))) ~= "nil" ) then
|
|
81
35
|
if ((timer.getAbsTime() >= (tonumber(CVNCoordinates:GetSunset(true)) - 30*60)) or (timer.getAbsTime() <= (tonumber(CVNCoordinates:GetSunrise(true)) + 30*60))) then
|
|
82
36
|
--Navy Night conditions
|
|
83
37
|
jtff_log.info("CASE III weather : Navy Night", "AIRBOSS")
|
|
84
|
-
|
|
38
|
+
navyNightCondition = true
|
|
85
39
|
end
|
|
86
40
|
if (recovery_stop) then
|
|
87
41
|
if (recovery_stop > (tonumber(CVNCoordinates:GetSunset(true)) - 30*60)) then
|
|
88
42
|
--recovery_stop after Navy SunSet
|
|
89
43
|
jtff_log.info("CASE III weather : Recovery ending after Navy SunSet", "AIRBOSS")
|
|
90
|
-
|
|
44
|
+
navyNightCondition = true
|
|
91
45
|
end
|
|
92
46
|
end
|
|
93
47
|
if (recovery_start) then
|
|
94
48
|
if (recovery_start < (tonumber(CVNCoordinates:GetSunrise(true)) + 30*60)) then
|
|
95
49
|
--recover_start before Navy SunRise
|
|
96
50
|
jtff_log.info("CASE III weather : Recovery starting before Navy SunRise","AIRBOSS")
|
|
97
|
-
|
|
51
|
+
navyNightCondition = true
|
|
98
52
|
end
|
|
99
53
|
end
|
|
100
54
|
end
|
|
55
|
+
if (navyNightCondition) then
|
|
56
|
+
return 3
|
|
57
|
+
end
|
|
101
58
|
end
|
|
59
|
+
|
|
60
|
+
--récupération de la meteo globale de la mission
|
|
102
61
|
local weather = env.mission.weather
|
|
103
62
|
local clouds = weather.clouds
|
|
104
63
|
local static = weather.atmosphere_type == 0
|
|
105
64
|
local visibility = weather.visibility.distance
|
|
106
65
|
local turbulence = weather.groundTurbulence
|
|
107
|
-
local dust
|
|
66
|
+
local dust
|
|
108
67
|
if weather.enable_dust == true then
|
|
109
68
|
dust = weather.dust_density
|
|
110
69
|
else
|
|
111
70
|
dust = 0
|
|
112
71
|
end
|
|
113
|
-
local fog
|
|
72
|
+
local fog
|
|
114
73
|
if weather.enable_fog == true then
|
|
115
74
|
fog = weather.fog
|
|
116
75
|
else
|
|
@@ -119,8 +78,9 @@ function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop)
|
|
|
119
78
|
visibility = 0,
|
|
120
79
|
}
|
|
121
80
|
end
|
|
122
|
-
|
|
81
|
+
|
|
123
82
|
jtff_log.info(string.format("visibility : %i | cloud : base %i density %i | fog %i,%i | dust %i | precpt: %i", visibility, clouds.base, clouds.density, fog.thickness, fog.visibility, dust, clouds.iprecptns),"AIRBOSS")
|
|
83
|
+
--détermination de minVisibility en fonction des precipitations
|
|
124
84
|
local minVisibility = (clouds.iprecptns >= 2) and math.floor(visibility/2) or visibility
|
|
125
85
|
if (weather.enable_fog and fog.thickness > 0) then
|
|
126
86
|
minVisibility = math.min(minVisibility,fog.visibility)
|
|
@@ -128,55 +88,66 @@ function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop)
|
|
|
128
88
|
if (weather.enable_dust) then
|
|
129
89
|
minVisibility = math.min(minVisibility,dust)
|
|
130
90
|
end
|
|
131
|
-
|
|
91
|
+
|
|
132
92
|
if (minVisibility > UTILS.NMToMeters(5)) then
|
|
93
|
+
--minVisibility > 5nm we need to check the cloudbase
|
|
133
94
|
if (clouds.base > UTILS.FeetToMeters(3000)) then
|
|
134
|
-
|
|
95
|
+
--cloud base > 3000ft -> case I
|
|
96
|
+
jtff_log.info("CASE I weather","AIRBOSS")
|
|
135
97
|
return 1
|
|
136
|
-
elseif (clouds.base > UTILS.FeetToMeters(
|
|
137
|
-
|
|
98
|
+
elseif (clouds.base > UTILS.FeetToMeters(1200)) then
|
|
99
|
+
--cloud base > 1200ft -> case II
|
|
100
|
+
jtff_log.info("CASE II weather","AIRBOSS")
|
|
138
101
|
return 2
|
|
139
102
|
else
|
|
140
|
-
|
|
103
|
+
--cloud base <= 1200ft -> case III
|
|
104
|
+
jtff_log.info("CASE III weather","AIRBOSS")
|
|
141
105
|
return 3
|
|
142
106
|
end
|
|
143
107
|
else
|
|
144
|
-
|
|
108
|
+
--minVisibility <= 5 nm -> Case III
|
|
109
|
+
jtff_log.info("CASE III weather","AIRBOSS")
|
|
145
110
|
return 3
|
|
146
111
|
end
|
|
147
112
|
end
|
|
148
113
|
|
|
149
114
|
function startRecoveryOnDemand(objAirboss, forced_eventcase)
|
|
150
115
|
local effectiveeventcase
|
|
116
|
+
local turnBeforeRecoveryDuration = 5
|
|
117
|
+
local delayMinutesBeforeRecovery = 10
|
|
118
|
+
local recoveryStart = UTILS.Round(timer.getAbsTime() + delayMinutesBeforeRecovery *60,0)
|
|
119
|
+
local recoveryStop = UTILS.Round(recoveryStart + ((objAirboss.customconfig.recoveryops.ondemand.recovery_duration_minutes or 30) * 60),0)
|
|
151
120
|
if (forced_eventcase) then
|
|
121
|
+
--Forcage du case si demandé
|
|
152
122
|
effectiveeventcase = forced_eventcase
|
|
153
123
|
else
|
|
124
|
+
-- Si pas de forcage de case demandé determination par les conditions météo
|
|
154
125
|
effectiveeventcase = getCaseTypeFromWeather(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
126
|
+
objAirboss:GetCoordinate(),
|
|
127
|
+
recoveryStart - (turnBeforeRecoveryDuration * 60),
|
|
128
|
+
recoveryStop
|
|
158
129
|
)
|
|
159
130
|
if effectiveeventcase == 1 then
|
|
160
|
-
objAirboss:MessageToMarshal('Good visibility : Case
|
|
131
|
+
objAirboss:MessageToMarshal('Good visibility : Case 1', objAirboss.customconfig.alias, "", 45, false, 0)
|
|
161
132
|
objAirboss:SetMaxSectionSize(4)
|
|
162
133
|
elseif effectiveeventcase == 2 then
|
|
163
|
-
objAirboss:MessageToMarshal('Bad visibility in altitude : Case
|
|
134
|
+
objAirboss:MessageToMarshal('Bad visibility in altitude : Case 2', objAirboss.customconfig.alias, "", 45, false, 0)
|
|
164
135
|
objAirboss:SetMaxSectionSize(2)
|
|
165
136
|
elseif effectiveeventcase == 3 then
|
|
166
|
-
objAirboss:MessageToMarshal('Bad visibility : Case
|
|
137
|
+
objAirboss:MessageToMarshal('Bad visibility : Case 3', objAirboss.customconfig.alias, "", 45, false, 0)
|
|
167
138
|
objAirboss:SetMaxSectionSize(1)
|
|
168
139
|
else
|
|
169
140
|
objAirboss:SetMaxSectionSize(1)
|
|
170
141
|
end
|
|
171
142
|
end
|
|
172
143
|
objAirboss:AddRecoveryWindow(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
144
|
+
UTILS.SecondsToClock(recoveryStart, false, false),
|
|
145
|
+
UTILS.SecondsToClock(recoveryStop, false, false),
|
|
146
|
+
effectiveeventcase,
|
|
147
|
+
objAirboss.customconfig.menurecovery.offset,
|
|
148
|
+
true,
|
|
149
|
+
objAirboss.customconfig.menurecovery.windondeck,
|
|
150
|
+
objAirboss.customconfig.menurecovery.uturn
|
|
180
151
|
)
|
|
181
152
|
end
|
|
182
153
|
|
|
@@ -196,12 +167,12 @@ end
|
|
|
196
167
|
function spawnDeckLayout_Zone(objAirboss, zoneName, layoutData)
|
|
197
168
|
jtff_log.info(string.format("CSG : %s Deck Layout " .. zoneName .. " Spawning Layout...", objAirboss.customconfig.alias),"AIRBOSS")
|
|
198
169
|
spawnStaticListWithUnitLink(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
170
|
+
layoutData,
|
|
171
|
+
objAirboss.customconfig.alias .. "_Deck_Layout_" .. zoneName,
|
|
172
|
+
objAirboss.carrier:GetID(),
|
|
173
|
+
objAirboss.carrier:GetCountry()
|
|
174
|
+
)
|
|
175
|
+
jtff_log.info(string.format("CSG : %s Deck Layout " .. zoneName .. " is up and ready.", objAirboss.customconfig.alias),"AIRBOSS")
|
|
205
176
|
end
|
|
206
177
|
|
|
207
178
|
function cleanDeckLayout(objAirboss)
|
|
@@ -1028,6 +999,365 @@ function launchDeck1SpawnLayout(objAirboss)
|
|
|
1028
999
|
spawnDeckLayout_Zone(objAirboss, "Stern", sternLayout)
|
|
1029
1000
|
end
|
|
1030
1001
|
|
|
1002
|
+
function parseAirbossConfigJson(config)
|
|
1003
|
+
local json = require('Scripts/json')
|
|
1004
|
+
local airbossConfigJson = {
|
|
1005
|
+
enable = true,
|
|
1006
|
+
}
|
|
1007
|
+
local default_radio_freqs = {
|
|
1008
|
+
base = 127.300,
|
|
1009
|
+
marshall = 127.500,
|
|
1010
|
+
lso = 127.400
|
|
1011
|
+
}
|
|
1012
|
+
local default_alpha_recovery_config = {}
|
|
1013
|
+
local default_cyclic_recovery_config = {
|
|
1014
|
+
event_duration_minutes = 60,
|
|
1015
|
+
event_ia_reserved_minutes = 15,
|
|
1016
|
+
}
|
|
1017
|
+
local dl4_default_freq = 336.000
|
|
1018
|
+
local default_infinite_patrol = true
|
|
1019
|
+
local default_cca_radius_nm = 60
|
|
1020
|
+
local default_max_patterns = 5
|
|
1021
|
+
local default_max_stacks = 10
|
|
1022
|
+
local default_difficulty = AIRBOSS.Difficulty.NORMAL
|
|
1023
|
+
local default_coalition = coalition.side.BLUE
|
|
1024
|
+
local default_handleAI = true
|
|
1025
|
+
local default_respawnAI = true
|
|
1026
|
+
local default_menumarkzones = false
|
|
1027
|
+
local default_menusmokezones = false
|
|
1028
|
+
local default_menurecovery = {
|
|
1029
|
+
enable = true,
|
|
1030
|
+
duration = 45,
|
|
1031
|
+
windondeck = 30,
|
|
1032
|
+
offset = 0,
|
|
1033
|
+
uturn = true
|
|
1034
|
+
}
|
|
1035
|
+
local default_srs = {
|
|
1036
|
+
useSRS = false,
|
|
1037
|
+
voices = {
|
|
1038
|
+
marshall = MSRS.Voices.Microsoft.Zira,
|
|
1039
|
+
lso = MSRS.Voices.Microsoft.David,
|
|
1040
|
+
airboss = MSRS.Voices.Microsoft.Hazel,
|
|
1041
|
+
},
|
|
1042
|
+
voiceovers = {
|
|
1043
|
+
marshall = "Gabriella",
|
|
1044
|
+
lso = "FF"
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
local default_niceguy = false
|
|
1048
|
+
local default_wirecorrection = true
|
|
1049
|
+
local default_operationsstatspath = "C:/airboss-stats"
|
|
1050
|
+
local default_operationstrapsheetpath = "C:/airboss-trapsheets"
|
|
1051
|
+
local default_singlecarrier = false
|
|
1052
|
+
local default_recoveryops = {
|
|
1053
|
+
mode = 'ondemand',
|
|
1054
|
+
ondemand = {
|
|
1055
|
+
recovery_duration_minutes = 45,
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
if type(config.carriername ) == 'nil' then
|
|
1059
|
+
jtff_log.error(string.format("no carriername field in config Object, skipping %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1060
|
+
config.enable = false
|
|
1061
|
+
return config
|
|
1062
|
+
end
|
|
1063
|
+
if type(UNIT:FindByName(config.carriername)) == 'nil' then
|
|
1064
|
+
jtff_log.error(string.format("Unit %s not found, skipping %s Airboss Object",config.carriername, config.alias or ""),"AIRBOSS")
|
|
1065
|
+
config.enable = false
|
|
1066
|
+
return config
|
|
1067
|
+
end
|
|
1068
|
+
airbossConfigJson.carriername = config.carriername
|
|
1069
|
+
airbossConfigJson.alias = config.alias or config.carriername
|
|
1070
|
+
if type(config.recoveryops) == 'nil' then
|
|
1071
|
+
jtff_log.warn(string.format("no recoveryops Object in config Object, defaulting to ondemand mode for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1072
|
+
airbossConfigJson.recoveryops = default_recoveryops
|
|
1073
|
+
else
|
|
1074
|
+
if type(config.recoveryops.mode) == 'nil' then
|
|
1075
|
+
jtff_log.warn(string.format("no recoveryops mode defined, defaulting to ondemand mode for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1076
|
+
airbossConfigJson.recoveryops = default_recoveryops
|
|
1077
|
+
else
|
|
1078
|
+
if (config.recoveryops.mode == "ondemand") then
|
|
1079
|
+
if type(config.recoveryops.ondemand) == 'nil' then
|
|
1080
|
+
jtff_log.error(string.format("no recoveryops configuration defined in ondemand mode, skipping %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1081
|
+
config.enable = false
|
|
1082
|
+
return config
|
|
1083
|
+
end
|
|
1084
|
+
airbossConfigJson.recoveryops = {
|
|
1085
|
+
mode = 'ondemand',
|
|
1086
|
+
ondemand = {
|
|
1087
|
+
recovery_duration_minutes = config.recoveryops.ondemand.recovery_duration_minutes or 45,
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
elseif (config.recoveryops.mode == "alpha") then
|
|
1091
|
+
if type(config.recoveryops.alpha) == 'nil' then
|
|
1092
|
+
jtff_log.error(string.format("no recoveryops configuration defined in alpha mode, skipping %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1093
|
+
config.enable = false
|
|
1094
|
+
return config
|
|
1095
|
+
end
|
|
1096
|
+
local alpha_recoveries = default_alpha_recovery_config
|
|
1097
|
+
if type(config.recoveryops.alpha.recoveries) ~= 'table' then
|
|
1098
|
+
jtff_log.warn(string.format("no recoveries defined in alpha mode, using empty recoveries config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1099
|
+
end
|
|
1100
|
+
for alphaindex, alphaevent in ipairs(config.recoveryops.alpha.recoveries) do
|
|
1101
|
+
if type(alphaevent.recovery_start_minutes) ~= 'number' then
|
|
1102
|
+
jtff_log.warn(string.format("no start time for this alpha event, skipping event %i for %s Airboss Object",alphaindex, config.alias or ""),"AIRBOSS")
|
|
1103
|
+
else
|
|
1104
|
+
alpha_recoveries[#alpha_recoveries +1] = {
|
|
1105
|
+
recovery_start_minutes = alphaevent.recovery_start_minutes,
|
|
1106
|
+
recovery_duration_minutes = alphaevent.recovery_duration_minutes or 60,
|
|
1107
|
+
}
|
|
1108
|
+
end
|
|
1109
|
+
end
|
|
1110
|
+
airbossConfigJson.recoveryops = {
|
|
1111
|
+
mode = 'alpha',
|
|
1112
|
+
alpha = {
|
|
1113
|
+
recoveries = alpha_recoveries,
|
|
1114
|
+
},
|
|
1115
|
+
|
|
1116
|
+
}
|
|
1117
|
+
elseif (config.recoveryops.mode == "cyclic") then
|
|
1118
|
+
if type(config.recoveryops.cyclic) == 'nil'then
|
|
1119
|
+
jtff_log.warn(string.format("no cyclic recovery config defined, defaulting to standard for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1120
|
+
airbossConfigJson.recoveryops = {
|
|
1121
|
+
mode = 'cyclic',
|
|
1122
|
+
cyclic = default_cyclic_recovery_config,
|
|
1123
|
+
}
|
|
1124
|
+
else
|
|
1125
|
+
airbossConfigJson.recoveryops = {
|
|
1126
|
+
mode = 'cyclic',
|
|
1127
|
+
cyclic = {
|
|
1128
|
+
event_duration_minutes = config.recoveryops.cyclic.event_duration_minutes or default_cyclic_recovery_config.event_duration_minutes,
|
|
1129
|
+
event_ia_reserved_minutes = config.recoveryops.cyclic.event_ia_reserved_minutes or default_cyclic_recovery_config.event_ia_reserved_minutes,
|
|
1130
|
+
},
|
|
1131
|
+
}
|
|
1132
|
+
end
|
|
1133
|
+
else
|
|
1134
|
+
jtff_log.warn(string.format("no valid recovery mode defined, defaulting to ondemand mode for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1135
|
+
airbossConfigJson.recoveryops = {
|
|
1136
|
+
mode = 'ondemand',
|
|
1137
|
+
ondemand = {
|
|
1138
|
+
recovery_duration_minutes = 45,
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
end
|
|
1142
|
+
end
|
|
1143
|
+
end
|
|
1144
|
+
if type(config.tacan) == 'nil' then
|
|
1145
|
+
jtff_log.warn(string.format("no TACAN config defined, disabling TACAN for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1146
|
+
airbossConfigJson.tacan = nil
|
|
1147
|
+
else
|
|
1148
|
+
airbossConfigJson.tacan = {
|
|
1149
|
+
channel = config.tacan.channel,
|
|
1150
|
+
mode = config.tacan.mode,
|
|
1151
|
+
morse = config.tacan.morse or string.sub(string.upper(config.carriername),1,3)
|
|
1152
|
+
}
|
|
1153
|
+
end
|
|
1154
|
+
if type(config.icls) == 'nil' then
|
|
1155
|
+
jtff_log.warn(string.format("no ICLS config defined, disabling ICLS for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1156
|
+
airbossConfigJson.icls = nil
|
|
1157
|
+
else
|
|
1158
|
+
airbossConfigJson.icls = {
|
|
1159
|
+
channel = config.icls.channel,
|
|
1160
|
+
morse = config.icls.morse or string.sub(string.upper(config.carriername),1,3)
|
|
1161
|
+
}
|
|
1162
|
+
end
|
|
1163
|
+
if type(config.dl4) == 'nil' then
|
|
1164
|
+
jtff_log.warn(string.format("no DL4 config defined, defaulting to %.3f for %s Airboss Object",dl4_default_freq,config.alias or ""),"AIRBOSS")
|
|
1165
|
+
airbossConfigJson.dl4 = {
|
|
1166
|
+
freq = dl4_default_freq
|
|
1167
|
+
}
|
|
1168
|
+
else
|
|
1169
|
+
airbossConfigJson.dl4 = {
|
|
1170
|
+
freq = config.dl4.freq or dl4_default_freq,
|
|
1171
|
+
}
|
|
1172
|
+
end
|
|
1173
|
+
if type(config.infinitepatrol) ~= 'boolean' then
|
|
1174
|
+
jtff_log.warn(string.format("no proper switch infinitepatrol config defined, defaulting to %s for %s Airboss Object",tostring(default_infinite_patrol),config.alias or ""),"AIRBOSS")
|
|
1175
|
+
airbossConfigJson.infinitepatrol = default_infinite_patrol
|
|
1176
|
+
else
|
|
1177
|
+
airbossConfigJson.infinitepatrol = config.infinitepatrol or default_infinite_patrol
|
|
1178
|
+
end
|
|
1179
|
+
if type(config.enable_menumarkzones) ~= 'boolean' then
|
|
1180
|
+
jtff_log.warn(string.format("no proper switch enable_menumarkzones config defined, defaulting to %s for %s Airboss Object",tostring(default_menumarkzones),config.alias or ""),"AIRBOSS")
|
|
1181
|
+
airbossConfigJson.enable_menumarkzones = default_menumarkzones
|
|
1182
|
+
else
|
|
1183
|
+
airbossConfigJson.enable_menumarkzones = config.enable_menumarkzones or default_menumarkzones
|
|
1184
|
+
end
|
|
1185
|
+
if type(config.enable_menusmokezones) ~= 'boolean' then
|
|
1186
|
+
jtff_log.warn(string.format("no proper switch enable_menusmokezones config defined, defaulting to %s for %s Airboss Object",tostring(default_menusmokezones),config.alias or ""),"AIRBOSS")
|
|
1187
|
+
airbossConfigJson.enable_menusmokezones = default_menusmokezones
|
|
1188
|
+
else
|
|
1189
|
+
airbossConfigJson.enable_menusmokezones = config.enable_menusmokezones or default_menusmokezones
|
|
1190
|
+
end
|
|
1191
|
+
if type(config.enable_niceguy) ~= 'boolean' then
|
|
1192
|
+
jtff_log.warn(string.format("no proper switch enable_niceguy config defined, defaulting to %s for %s Airboss Object",tostring(default_niceguy),config.alias or ""),"AIRBOSS")
|
|
1193
|
+
airbossConfigJson.enable_niceguy = default_niceguy
|
|
1194
|
+
else
|
|
1195
|
+
airbossConfigJson.enable_niceguy = config.enable_niceguy or default_niceguy
|
|
1196
|
+
end
|
|
1197
|
+
if type(config.singlecarrier) ~= 'boolean' then
|
|
1198
|
+
jtff_log.warn(string.format("no proper switch singlecarrier config defined, defaulting to %s for %s Airboss Object",tostring(default_singlecarrier),config.alias or ""),"AIRBOSS")
|
|
1199
|
+
airbossConfigJson.singlecarrier = default_singlecarrier
|
|
1200
|
+
else
|
|
1201
|
+
airbossConfigJson.singlecarrier = config.singlecarrier or default_singlecarrier
|
|
1202
|
+
end
|
|
1203
|
+
if type(config.wirecorrection) ~= 'boolean' then
|
|
1204
|
+
jtff_log.warn(string.format("no proper switch wirecorrection config defined, defaulting to %s for %s Airboss Object",tostring(default_wirecorrection),config.alias or ""),"AIRBOSS")
|
|
1205
|
+
airbossConfigJson.wirecorrection = default_wirecorrection
|
|
1206
|
+
else
|
|
1207
|
+
airbossConfigJson.wirecorrection = config.wirecorrection or default_wirecorrection
|
|
1208
|
+
end
|
|
1209
|
+
if type(config.handleAI) ~= 'boolean' then
|
|
1210
|
+
jtff_log.warn(string.format("no proper switch handleAI config defined, defaulting to %s for %s Airboss Object",tostring(default_handleAI),config.alias or ""),"AIRBOSS")
|
|
1211
|
+
airbossConfigJson.handleAI = default_handleAI
|
|
1212
|
+
else
|
|
1213
|
+
airbossConfigJson.handleAI = config.handleAI or default_handleAI
|
|
1214
|
+
end
|
|
1215
|
+
if type(config.respawnAI) ~= 'boolean' then
|
|
1216
|
+
jtff_log.warn(string.format("no proper switch respawnAI config defined, defaulting to %s for %s Airboss Object",tostring(default_respawnAI),config.alias or ""),"AIRBOSS")
|
|
1217
|
+
airbossConfigJson.respawnAI = default_respawnAI
|
|
1218
|
+
else
|
|
1219
|
+
airbossConfigJson.respawnAI = config.respawnAI or default_respawnAI
|
|
1220
|
+
end
|
|
1221
|
+
if type(config.controlarea) ~= 'number' then
|
|
1222
|
+
jtff_log.warn(string.format("no proper controlarea defined, defaulting to %d for %s Airboss Object",default_cca_radius_nm,config.alias or ""),"AIRBOSS")
|
|
1223
|
+
airbossConfigJson.controlarea = default_cca_radius_nm
|
|
1224
|
+
else
|
|
1225
|
+
airbossConfigJson.controlarea = config.controlarea or default_cca_radius_nm
|
|
1226
|
+
end
|
|
1227
|
+
if type(config.maxpatterns) ~= 'number' then
|
|
1228
|
+
jtff_log.warn(string.format("no proper maxpatterns defined, defaulting to %d for %s Airboss Object",default_max_patterns,config.alias or ""),"AIRBOSS")
|
|
1229
|
+
airbossConfigJson.maxpatterns = default_max_patterns
|
|
1230
|
+
else
|
|
1231
|
+
airbossConfigJson.maxpatterns = config.maxpatterns or default_max_patterns
|
|
1232
|
+
end
|
|
1233
|
+
if type(config.maxstacks) ~= 'number' then
|
|
1234
|
+
jtff_log.warn(string.format("no proper maxstacks defined, defaulting to %d for %s Airboss Object",default_max_stacks,config.alias or ""),"AIRBOSS")
|
|
1235
|
+
airbossConfigJson.maxstacks = default_max_stacks
|
|
1236
|
+
else
|
|
1237
|
+
airbossConfigJson.maxstacks = config.maxstacks or default_max_stacks
|
|
1238
|
+
end
|
|
1239
|
+
if type(config.difficulty) ~= 'string' then
|
|
1240
|
+
jtff_log.warn(string.format("no proper difficulty defined, defaulting to %s for %s Airboss Object",default_difficulty,config.alias or ""),"AIRBOSS")
|
|
1241
|
+
airbossConfigJson.difficulty = default_difficulty
|
|
1242
|
+
else
|
|
1243
|
+
if ((config.difficulty ~= AIRBOSS.Difficulty.EASY) and (config.difficulty ~= AIRBOSS.Difficulty.NORMAL) and (config.difficulty ~= AIRBOSS.Difficulty.HARD)) then
|
|
1244
|
+
jtff_log.warn(string.format("invalid difficulty string defined, defaulting to %s for %s Airboss Object",default_difficulty,config.alias or ""),"AIRBOSS")
|
|
1245
|
+
airbossConfigJson.difficulty = default_difficulty
|
|
1246
|
+
else
|
|
1247
|
+
airbossConfigJson.difficulty = config.difficulty or default_difficulty
|
|
1248
|
+
end
|
|
1249
|
+
end
|
|
1250
|
+
if type(config.operationsstatspath) ~= 'string' then
|
|
1251
|
+
jtff_log.warn(string.format("no proper operationsstatspath defined, defaulting to %s for %s Airboss Object",default_operationsstatspath,config.alias or ""),"AIRBOSS")
|
|
1252
|
+
airbossConfigJson.operationsstatspath = default_operationsstatspath
|
|
1253
|
+
else
|
|
1254
|
+
airbossConfigJson.operationsstatspath = config.operationsstatspath or default_operationsstatspath
|
|
1255
|
+
end
|
|
1256
|
+
if type(config.operationstrapsheetpath) ~= 'string' then
|
|
1257
|
+
jtff_log.warn(string.format("no proper operationstrapsheetpath defined, defaulting to %s for %s Airboss Object",default_operationstrapsheetpath,config.alias or ""),"AIRBOSS")
|
|
1258
|
+
airbossConfigJson.operationstrapsheetpath = default_operationstrapsheetpath
|
|
1259
|
+
else
|
|
1260
|
+
airbossConfigJson.operationstrapsheetpath = config.operationstrapsheetpath or default_operationstrapsheetpath
|
|
1261
|
+
end
|
|
1262
|
+
if type(config.recoverytanker) ~= 'string' then
|
|
1263
|
+
jtff_log.warn(string.format("no proper recoverytanker defined, skipping recoverytanker config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1264
|
+
elseif type(GROUP:FindByName(config.recoverytanker)) == 'nil' then
|
|
1265
|
+
jtff_log.warn(string.format("recoverytanker %s group not found, skipping recoverytanker config for %s Airboss Object",config.recoverytanker, config.alias or ""),"AIRBOSS")
|
|
1266
|
+
else
|
|
1267
|
+
airbossConfigJson.recoverytanker = config.recoverytanker
|
|
1268
|
+
end
|
|
1269
|
+
if type(config.coalition) ~= 'string' then
|
|
1270
|
+
jtff_log.warn(string.format("no proper coalition defined, defaulting to %s for %s Airboss Object",default_coalition,config.alias or ""),"AIRBOSS")
|
|
1271
|
+
airbossConfigJson.coalition = default_coalition
|
|
1272
|
+
elseif ((config.coalition ~= coalition.side.BLUE) and (config.coalition ~= coalition.side.RED) and (config.coalition ~= coalition.side.NEUTRAL)) then
|
|
1273
|
+
jtff_log.warn(string.format("no proper coalition defined, defaulting to %s for %s Airboss Object",default_coalition,config.alias or ""),"AIRBOSS")
|
|
1274
|
+
airbossConfigJson.coalition = default_coalition
|
|
1275
|
+
else
|
|
1276
|
+
airbossConfigJson.coalition = config.coalition or default_coalition
|
|
1277
|
+
end
|
|
1278
|
+
if type(config.menurecovery) ~= 'table' then
|
|
1279
|
+
jtff_log.warn(string.format("no proper menurecovery defined, defaulting menurecovery config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1280
|
+
airbossConfigJson.menurecovery = default_menurecovery
|
|
1281
|
+
else
|
|
1282
|
+
airbossConfigJson.menurecovery = {
|
|
1283
|
+
enable = config.menurecovery.enable or default_menurecovery.enable,
|
|
1284
|
+
duration = config.menurecovery.duration or default_menurecovery.duration,
|
|
1285
|
+
windondeck = config.menurecovery.windondeck or default_menurecovery.windondeck,
|
|
1286
|
+
offset = config.menurecovery.offset or default_menurecovery.offset,
|
|
1287
|
+
uturn = config.menurecovery.uturn or default_menurecovery.uturn,
|
|
1288
|
+
}
|
|
1289
|
+
end
|
|
1290
|
+
if type(config.srs) ~= 'table' then
|
|
1291
|
+
jtff_log.warn(string.format("no proper SRS config defined, defaulting SRS config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1292
|
+
airbossConfigJson.srs = default_srs
|
|
1293
|
+
else
|
|
1294
|
+
airbossConfigJson.srs = {
|
|
1295
|
+
useSRS = config.srs.useSRS or default_srs.useSRS
|
|
1296
|
+
}
|
|
1297
|
+
if airbossConfigJson.srs.useSRS then
|
|
1298
|
+
if type(config.srs.voices) ~= 'table' then
|
|
1299
|
+
jtff_log.warn(string.format("no proper voices defined, defaulting voices config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1300
|
+
airbossConfigJson.srs.voices = default_srs.voices
|
|
1301
|
+
else
|
|
1302
|
+
airbossConfigJson.srs.voices = {
|
|
1303
|
+
marshall = config.srs.voices.marshall or default_srs.voices.marshall,
|
|
1304
|
+
lso = config.srs.voices.lso or default_srs.voices.lso,
|
|
1305
|
+
airboss = config.srs.voices.airboss or default_srs.voices.airboss,
|
|
1306
|
+
}
|
|
1307
|
+
end
|
|
1308
|
+
airbossConfigJson.srs.voiceovers = default_srs.voiceovers
|
|
1309
|
+
else
|
|
1310
|
+
if type(config.srs.voiceovers) ~= 'table' then
|
|
1311
|
+
jtff_log.warn(string.format("no proper voiceovers defined, defaulting voiceovers config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1312
|
+
airbossConfigJson.srs.voiceovers = default_srs.voiceovers
|
|
1313
|
+
else
|
|
1314
|
+
airbossConfigJson.srs.voiceovers = {
|
|
1315
|
+
marshall = config.srs.voiceovers.marshall or default_srs.voiceovers.marshall,
|
|
1316
|
+
lso = config.srs.voiceovers.lso or default_srs.voiceovers.lso,
|
|
1317
|
+
}
|
|
1318
|
+
end
|
|
1319
|
+
airbossConfigJson.srs.voices = default_srs.voices
|
|
1320
|
+
end
|
|
1321
|
+
end
|
|
1322
|
+
if type(config.freq) ~= 'table' then
|
|
1323
|
+
jtff_log.warn(string.format("no proper radio freqs defined, defaulting config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1324
|
+
airbossConfigJson.freq = default_radio_freqs
|
|
1325
|
+
else
|
|
1326
|
+
airbossConfigJson.freq = {
|
|
1327
|
+
base = config.freq.base or default_radio_freqs.base,
|
|
1328
|
+
marshall = config.freq.marshall or default_radio_freqs.marshall,
|
|
1329
|
+
lso = config.freq.lso or default_radio_freqs.lso,
|
|
1330
|
+
}
|
|
1331
|
+
end
|
|
1332
|
+
if type(config.releayunit) ~= 'table' then
|
|
1333
|
+
jtff_log.warn(string.format("no proper radio releayunit defined, skipping freqs config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1334
|
+
else
|
|
1335
|
+
local airboss_found = config.releayunit.airboss or nil
|
|
1336
|
+
local marshall_found = config.releayunit.marshall or nil
|
|
1337
|
+
local lso_found = config.releayunit.lso or nil
|
|
1338
|
+
if ((type(UNIT:FindByName(config.releayunit.airboss or '')) == 'nil') and (type(STATIC:FindByName(config.releayunit.airboss or '', false)) == 'nil')) then
|
|
1339
|
+
airboss_found = nil
|
|
1340
|
+
end
|
|
1341
|
+
if ((type(UNIT:FindByName(config.releayunit.marshall or '')) == 'nil') and (type(STATIC:FindByName(config.releayunit.marshall or '',false)) == 'nil')) then
|
|
1342
|
+
marshall_found = nil
|
|
1343
|
+
end
|
|
1344
|
+
if ((type(UNIT:FindByName(config.releayunit.lso or '')) == 'nil') and (type(STATIC:FindByName(config.releayunit.lso or '',false)) == 'nil')) then
|
|
1345
|
+
lso_found = nil
|
|
1346
|
+
end
|
|
1347
|
+
if not(airboss_found or marshall_found or lso_found) then
|
|
1348
|
+
jtff_log.warn(string.format("relayunit config empty, skipping freqs config for %s Airboss Object",config.alias or ""),"AIRBOSS")
|
|
1349
|
+
else
|
|
1350
|
+
airbossConfigJson.releayunit = {
|
|
1351
|
+
airboss = airboss_found or nil,
|
|
1352
|
+
marshall = marshall_found or nil,
|
|
1353
|
+
lso = lso_found or nil,
|
|
1354
|
+
}
|
|
1355
|
+
end
|
|
1356
|
+
end
|
|
1357
|
+
jtff_log.info(string.format("parsed Airboss config for %s Airboss, resulting config :\n%s",config.alias or "", json:encode(airbossConfigJson, { indent = true })),"AIRBOSS")
|
|
1358
|
+
return airbossConfigJson
|
|
1359
|
+
end
|
|
1360
|
+
|
|
1031
1361
|
function resetAirbossDeck(objAirboss, delay)
|
|
1032
1362
|
local delay_second = delay or 5
|
|
1033
1363
|
jtff_log.info(string.format("reset all Deck Operations, closing the Deck on %s in %i seconds",objAirboss.customconfig.alias, delay_second),"AIRBOSS")
|
|
@@ -1035,174 +1365,220 @@ function resetAirbossDeck(objAirboss, delay)
|
|
|
1035
1365
|
objAirboss:DeleteAllRecoveryWindows(delay_second+1)
|
|
1036
1366
|
end
|
|
1037
1367
|
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1368
|
+
function initCSGAirbossMenus(airbossObject)
|
|
1369
|
+
local MenuCoalitionCSGCommands
|
|
1370
|
+
local rootMenuObject
|
|
1371
|
+
local deckLayoutmenuObject
|
|
1372
|
+
if airbossObject.customconfig.coalition == coalition.side.BLUE then
|
|
1373
|
+
MenuCoalitionCSGCommands = MenuCoalitionCSGCommandsBlue
|
|
1374
|
+
else
|
|
1375
|
+
MenuCoalitionCSGCommands = MenuCoalitionCSGCommandsRed
|
|
1376
|
+
end
|
|
1377
|
+
rootMenuObject = MENU_COALITION:New(
|
|
1378
|
+
airbossObject.customconfig.coalition,
|
|
1379
|
+
airbossObject.customconfig.alias,
|
|
1380
|
+
MenuCoalitionCSGCommands
|
|
1381
|
+
)
|
|
1382
|
+
MENU_COALITION_COMMAND:New(
|
|
1383
|
+
airbossObject.customconfig.coalition,
|
|
1384
|
+
"DEFCON 2 - duration 5 minutes",
|
|
1385
|
+
rootMenuObject,
|
|
1386
|
+
switchCarrierDefCon2,
|
|
1387
|
+
{
|
|
1388
|
+
airbossObject.customconfig.carriername,
|
|
1389
|
+
5
|
|
1390
|
+
}
|
|
1391
|
+
)
|
|
1392
|
+
MENU_COALITION_COMMAND:New(
|
|
1393
|
+
airbossObject.customconfig.coalition,
|
|
1394
|
+
"DEFCON 2 - duration 10 minutes",
|
|
1395
|
+
rootMenuObject,
|
|
1396
|
+
switchCarrierDefCon2,
|
|
1397
|
+
{
|
|
1398
|
+
airbossObject.customconfig.carriername,
|
|
1399
|
+
10
|
|
1400
|
+
}
|
|
1401
|
+
)
|
|
1402
|
+
MENU_COALITION_COMMAND:New(
|
|
1403
|
+
airbossObject.customconfig.coalition,
|
|
1404
|
+
"Release : DEFCON 4",
|
|
1405
|
+
rootMenuObject,
|
|
1406
|
+
forceCarrierDefCon4,
|
|
1407
|
+
{
|
|
1408
|
+
airbossObject.customconfig.carriername
|
|
1409
|
+
}
|
|
1410
|
+
)
|
|
1411
|
+
if (
|
|
1412
|
+
(airbossObject.carriertype == AIRBOSS.CarrierType.ROOSEVELT) or
|
|
1413
|
+
(airbossObject.carriertype == AIRBOSS.CarrierType.LINCOLN) or
|
|
1414
|
+
(airbossObject.carriertype == AIRBOSS.CarrierType.WASHINGTON) or
|
|
1415
|
+
(airbossObject.carriertype == AIRBOSS.CarrierType.TRUMAN)
|
|
1416
|
+
) then
|
|
1417
|
+
deckLayoutmenuObject = MENU_COALITION:New(
|
|
1418
|
+
airbossObject.customconfig.coalition,
|
|
1419
|
+
"Deck Layout",
|
|
1420
|
+
rootMenuObject
|
|
1058
1421
|
)
|
|
1059
1422
|
MENU_COALITION_COMMAND:New(
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
airbossconfig.carriername,
|
|
1066
|
-
5
|
|
1067
|
-
}
|
|
1423
|
+
airbossObject.customconfig.coalition,
|
|
1424
|
+
"Clean Layout",
|
|
1425
|
+
deckLayoutmenuObject,
|
|
1426
|
+
cleanDeckLayout,
|
|
1427
|
+
airbossObject
|
|
1068
1428
|
)
|
|
1069
1429
|
MENU_COALITION_COMMAND:New(
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
airbossconfig.carriername,
|
|
1076
|
-
10
|
|
1077
|
-
}
|
|
1430
|
+
airbossObject.customconfig.coalition,
|
|
1431
|
+
"Flex 3 Spawns",
|
|
1432
|
+
deckLayoutmenuObject,
|
|
1433
|
+
flexDeck3SpawnLayout,
|
|
1434
|
+
airbossObject
|
|
1078
1435
|
)
|
|
1079
1436
|
MENU_COALITION_COMMAND:New(
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1437
|
+
airbossObject.customconfig.coalition,
|
|
1438
|
+
"Flex 7 Spawns",
|
|
1439
|
+
deckLayoutmenuObject,
|
|
1440
|
+
flexDeck7SpawnLayout,
|
|
1441
|
+
airbossObject
|
|
1442
|
+
)
|
|
1443
|
+
MENU_COALITION_COMMAND:New(
|
|
1444
|
+
airbossObject.customconfig.coalition,
|
|
1445
|
+
"Launch 7 Spawns",
|
|
1446
|
+
deckLayoutmenuObject,
|
|
1447
|
+
launchDeck7SpawnLayout,
|
|
1448
|
+
airbossObject
|
|
1449
|
+
)
|
|
1450
|
+
MENU_COALITION_COMMAND:New(
|
|
1451
|
+
airbossObject.customconfig.coalition,
|
|
1452
|
+
"Launch 1 Spawn",
|
|
1453
|
+
deckLayoutmenuObject,
|
|
1454
|
+
launchDeck1SpawnLayout,
|
|
1455
|
+
airbossObject
|
|
1087
1456
|
)
|
|
1088
|
-
if (
|
|
1089
|
-
(objAirboss.carriertype == AIRBOSS.CarrierType.ROOSEVELT) or
|
|
1090
|
-
(objAirboss.carriertype == AIRBOSS.CarrierType.LINCOLN) or
|
|
1091
|
-
(objAirboss.carriertype == AIRBOSS.CarrierType.WASHINGTON) or
|
|
1092
|
-
(objAirboss.carriertype == AIRBOSS.CarrierType.TRUMAN)
|
|
1093
|
-
) then
|
|
1094
|
-
objAirboss.deckLayoutmenuObject = MENU_COALITION:New(
|
|
1095
|
-
airbossconfig.coalition,
|
|
1096
|
-
"Deck Layout",
|
|
1097
|
-
objAirboss.menuObject
|
|
1098
|
-
)
|
|
1099
|
-
MENU_COALITION_COMMAND:New(
|
|
1100
|
-
airbossconfig.coalition,
|
|
1101
|
-
"DeckLayout : Clean Layout",
|
|
1102
|
-
objAirboss.deckLayoutmenuObject,
|
|
1103
|
-
cleanDeckLayout,
|
|
1104
|
-
objAirboss
|
|
1105
|
-
)
|
|
1106
|
-
MENU_COALITION_COMMAND:New(
|
|
1107
|
-
airbossconfig.coalition,
|
|
1108
|
-
"DeckLayout : Flex 3 Spawns",
|
|
1109
|
-
objAirboss.deckLayoutmenuObject,
|
|
1110
|
-
flexDeck3SpawnLayout,
|
|
1111
|
-
objAirboss
|
|
1112
|
-
)
|
|
1113
|
-
MENU_COALITION_COMMAND:New(
|
|
1114
|
-
airbossconfig.coalition,
|
|
1115
|
-
"DeckLayout : Flex 7 Spawns",
|
|
1116
|
-
objAirboss.deckLayoutmenuObject,
|
|
1117
|
-
flexDeck7SpawnLayout,
|
|
1118
|
-
objAirboss
|
|
1119
|
-
)
|
|
1120
|
-
MENU_COALITION_COMMAND:New(
|
|
1121
|
-
airbossconfig.coalition,
|
|
1122
|
-
"DeckLayout : Launch 7 Spawns",
|
|
1123
|
-
objAirboss.deckLayoutmenuObject,
|
|
1124
|
-
launchDeck7SpawnLayout,
|
|
1125
|
-
objAirboss
|
|
1126
|
-
)
|
|
1127
|
-
MENU_COALITION_COMMAND:New(
|
|
1128
|
-
airbossconfig.coalition,
|
|
1129
|
-
"DeckLayout : Launch 1 Spawn",
|
|
1130
|
-
objAirboss.deckLayoutmenuObject,
|
|
1131
|
-
launchDeck1SpawnLayout,
|
|
1132
|
-
objAirboss
|
|
1133
|
-
)
|
|
1134
|
-
MENU_COALITION_COMMAND:New(
|
|
1135
|
-
airbossconfig.coalition,
|
|
1136
|
-
"DeckLayout : Wipe All",
|
|
1137
|
-
objAirboss.deckLayoutmenuObject,
|
|
1138
|
-
wipeDeckLayout,
|
|
1139
|
-
objAirboss
|
|
1140
|
-
)
|
|
1141
|
-
end
|
|
1142
|
-
if (airbossconfig.recoveryops.mode == 'ondemand') then
|
|
1143
|
-
MENU_COALITION_COMMAND:New(
|
|
1144
|
-
airbossconfig.coalition,
|
|
1145
|
-
"OnDemand Recovery : will start turning in 5 minutes",
|
|
1146
|
-
objAirboss.menuObject,
|
|
1147
|
-
startRecoveryOnDemand,
|
|
1148
|
-
objAirboss
|
|
1149
|
-
)
|
|
1150
|
-
MENU_COALITION_COMMAND:New(
|
|
1151
|
-
airbossconfig.coalition,
|
|
1152
|
-
"OnDemand Recovery Forced Case 1: will start turning in 5 minutes",
|
|
1153
|
-
objAirboss.menuObject,
|
|
1154
|
-
startRecoveryOnDemand,
|
|
1155
|
-
objAirboss,
|
|
1156
|
-
1
|
|
1157
|
-
)
|
|
1158
|
-
MENU_COALITION_COMMAND:New(
|
|
1159
|
-
airbossconfig.coalition,
|
|
1160
|
-
"OnDemand Recovery Forced Case 2: will start turning in 5 minutes",
|
|
1161
|
-
objAirboss.menuObject,
|
|
1162
|
-
startRecoveryOnDemand,
|
|
1163
|
-
objAirboss,
|
|
1164
|
-
2
|
|
1165
|
-
)
|
|
1166
|
-
MENU_COALITION_COMMAND:New(
|
|
1167
|
-
airbossconfig.coalition,
|
|
1168
|
-
"OnDemand Recovery Forced Case 3: will start turning in 5 minutes",
|
|
1169
|
-
objAirboss.menuObject,
|
|
1170
|
-
startRecoveryOnDemand,
|
|
1171
|
-
objAirboss,
|
|
1172
|
-
3
|
|
1173
|
-
)
|
|
1174
|
-
end
|
|
1175
1457
|
MENU_COALITION_COMMAND:New(
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1458
|
+
airbossObject.customconfig.coalition,
|
|
1459
|
+
"Wipe All",
|
|
1460
|
+
deckLayoutmenuObject,
|
|
1461
|
+
wipeDeckLayout,
|
|
1462
|
+
airbossObject
|
|
1181
1463
|
)
|
|
1464
|
+
end
|
|
1465
|
+
if (airbossObject.customconfig.recoveryops.mode == 'ondemand') then
|
|
1466
|
+
MENU_COALITION_COMMAND:New(
|
|
1467
|
+
airbossObject.customconfig.coalition,
|
|
1468
|
+
"OnDemand Recovery : will start turning in 5 minutes",
|
|
1469
|
+
rootMenuObject,
|
|
1470
|
+
startRecoveryOnDemand,
|
|
1471
|
+
airbossObject
|
|
1472
|
+
)
|
|
1473
|
+
MENU_COALITION_COMMAND:New(
|
|
1474
|
+
airbossObject.customconfig.coalition,
|
|
1475
|
+
"OnDemand Recovery Forced Case I: will start turning in 5 minutes",
|
|
1476
|
+
rootMenuObject,
|
|
1477
|
+
startRecoveryOnDemand,
|
|
1478
|
+
airbossObject,
|
|
1479
|
+
1
|
|
1480
|
+
)
|
|
1481
|
+
MENU_COALITION_COMMAND:New(
|
|
1482
|
+
airbossObject.customconfig.coalition,
|
|
1483
|
+
"OnDemand Recovery Forced Case II: will start turning in 5 minutes",
|
|
1484
|
+
rootMenuObject,
|
|
1485
|
+
startRecoveryOnDemand,
|
|
1486
|
+
airbossObject,
|
|
1487
|
+
2
|
|
1488
|
+
)
|
|
1489
|
+
MENU_COALITION_COMMAND:New(
|
|
1490
|
+
airbossObject.customconfig.coalition,
|
|
1491
|
+
"OnDemand Recovery Forced Case III: will start turning in 5 minutes",
|
|
1492
|
+
rootMenuObject,
|
|
1493
|
+
startRecoveryOnDemand,
|
|
1494
|
+
airbossObject,
|
|
1495
|
+
3
|
|
1496
|
+
)
|
|
1497
|
+
end
|
|
1498
|
+
MENU_COALITION_COMMAND:New(
|
|
1499
|
+
airbossObject.customconfig.coalition,
|
|
1500
|
+
"Recovery : close the deck and reset Airboss",
|
|
1501
|
+
rootMenuObject,
|
|
1502
|
+
resetAirbossDeck,
|
|
1503
|
+
airbossObject
|
|
1504
|
+
)
|
|
1505
|
+
return rootMenuObject, MenuCoalitionCSGCommands, deckLayoutmenuObject
|
|
1506
|
+
end
|
|
1507
|
+
|
|
1508
|
+
function activateDL4(customconfig)
|
|
1509
|
+
if (customconfig.dl4) then
|
|
1510
|
+
local cvUnit = UNIT:FindByName(customconfig.carriername)
|
|
1511
|
+
cvUnit:SetCommand(
|
|
1512
|
+
{
|
|
1513
|
+
id = "ActivateLink4",
|
|
1514
|
+
params =
|
|
1515
|
+
{
|
|
1516
|
+
["unitId"] = cvUnit:GetID(),
|
|
1517
|
+
["frequency"] = customconfig.dl4.freq * 1000000
|
|
1518
|
+
},
|
|
1519
|
+
}
|
|
1520
|
+
)
|
|
1521
|
+
cvUnit:SetCommand(
|
|
1522
|
+
{
|
|
1523
|
+
id = "ActivateACLS",
|
|
1524
|
+
params =
|
|
1525
|
+
{
|
|
1526
|
+
["unitId"] = cvUnit:GetID(),
|
|
1527
|
+
},
|
|
1528
|
+
}
|
|
1529
|
+
)
|
|
1530
|
+
end
|
|
1531
|
+
end
|
|
1532
|
+
|
|
1533
|
+
AIRBOSSArray = {}
|
|
1534
|
+
compteur = 0
|
|
1535
|
+
MenuCoalitionCSGCommandsBlue = MENU_COALITION:New(coalition.side.BLUE, "CSG Commands", MenuCoalitionBlue)
|
|
1536
|
+
MenuCoalitionCSGCommandsRed = MENU_COALITION:New(coalition.side.RED, "CSG Commands", MenuCoalitionRed)
|
|
1537
|
+
for index, currentAirbossConfigObject in ipairs(AirBossConfig) do
|
|
1538
|
+
local airbossconfig = parseAirbossConfigJson(currentAirbossConfigObject)
|
|
1539
|
+
if airbossconfig.enable == true then
|
|
1540
|
+
compteur = compteur +1
|
|
1541
|
+
local MenuCoalitionCSGCommands
|
|
1542
|
+
local objAirboss = AIRBOSS:New(airbossconfig.carriername, airbossconfig.alias)
|
|
1543
|
+
objAirboss.autosave = false
|
|
1544
|
+
objAirboss.customconfig = airbossconfig
|
|
1545
|
+
objAirboss.menuObject, MenuCoalitionCSGCommands, objAirboss.deckLayoutmenuObject = initCSGAirbossMenus(objAirboss)
|
|
1546
|
+
--TACAN
|
|
1547
|
+
objAirboss:SetTACANoff()
|
|
1182
1548
|
objAirboss:SetTACAN(airbossconfig.tacan.channel, airbossconfig.tacan.mode, airbossconfig.tacan.morse)
|
|
1549
|
+
--ICLS
|
|
1550
|
+
objAirboss:SetICLSoff()
|
|
1183
1551
|
objAirboss:SetICLS(airbossconfig.icls.channel, airbossconfig.icls.morse)
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1552
|
+
--ACLS
|
|
1553
|
+
activateDL4(airbossconfig)
|
|
1554
|
+
--Control parameters
|
|
1555
|
+
--CCA
|
|
1187
1556
|
objAirboss:SetCarrierControlledArea(airbossconfig.controlarea)
|
|
1557
|
+
--Static weather
|
|
1188
1558
|
objAirboss:SetStaticWeather(true)
|
|
1189
|
-
|
|
1559
|
+
--Set Recovery case
|
|
1190
1560
|
objAirboss:SetRecoveryCase(getCaseTypeFromWeather(
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1561
|
+
objAirboss:GetCoordinate(),
|
|
1562
|
+
timer.getAbsTime(),
|
|
1563
|
+
timer.getAbsTime() + airbossconfig.menurecovery.duration * 60
|
|
1194
1564
|
))
|
|
1565
|
+
--Activate Emergency landings
|
|
1195
1566
|
objAirboss:SetEmergencyLandings(true)
|
|
1567
|
+
--Max authorized patterns
|
|
1196
1568
|
objAirboss:SetMaxLandingPattern(airbossconfig.maxpatterns)
|
|
1569
|
+
--Max section size
|
|
1197
1570
|
objAirboss:SetMaxSectionSize(4)
|
|
1571
|
+
--Max stacks authorized
|
|
1198
1572
|
objAirboss:SetMaxMarshalStacks(airbossconfig.maxstacks)
|
|
1199
|
-
|
|
1200
|
-
objAirboss:
|
|
1573
|
+
--Default playerSkills
|
|
1574
|
+
objAirboss:SetDefaultPlayerSkill(airbossconfig.difficulty)
|
|
1575
|
+
--MultiPlayer Wire correction
|
|
1201
1576
|
if airbossconfig.wirecorrection then
|
|
1202
|
-
objAirboss:SetMPWireCorrection(
|
|
1203
|
-
else
|
|
1204
|
-
objAirboss:SetMPWireCorrection()
|
|
1577
|
+
objAirboss:SetMPWireCorrection(12)
|
|
1205
1578
|
end
|
|
1579
|
+
--Funkman
|
|
1580
|
+
--objAirboss:SetFunkManOn(FunkmanConfig.port, FunkmanConfig.ip)
|
|
1581
|
+
objAirboss.funkmanSocket = nil
|
|
1206
1582
|
if airbossconfig.operationsstatspath then
|
|
1207
1583
|
objAirboss:Load(airbossconfig.operationsstatspath)
|
|
1208
1584
|
if airbossconfig.operationsstatspath then
|
|
@@ -1210,351 +1586,315 @@ for index, airbossconfig in ipairs(AirBossConfig) do
|
|
|
1210
1586
|
end
|
|
1211
1587
|
--objAirboss:SetAutoSave(airbossconfig.operationsstatspath)
|
|
1212
1588
|
end
|
|
1589
|
+
--Handle AI aircrafts
|
|
1590
|
+
objAirboss:SetRespawnAI(airbossconfig.respawnAI)
|
|
1213
1591
|
if airbossconfig.handleAI == true then
|
|
1214
1592
|
objAirboss:SetHandleAION()
|
|
1215
1593
|
objAirboss:SetDespawnOnEngineShutdown(true)
|
|
1216
1594
|
else
|
|
1217
1595
|
objAirboss:SetHandleAIOFF()
|
|
1596
|
+
objAirboss:SetRespawnAI(false)
|
|
1218
1597
|
end
|
|
1598
|
+
--Patrol control utility
|
|
1599
|
+
objAirboss:SetPatrolAdInfinitum(airbossconfig.infinitepatrol)
|
|
1600
|
+
--Nanny
|
|
1219
1601
|
if airbossconfig.recoverytanker then
|
|
1220
1602
|
for index,value in pairs(tankersArray) do
|
|
1221
|
-
if ((value.customconfig.airboss_recovery == true) and (value.customconfig.groupName == airbossconfig.recoverytanker))then
|
|
1603
|
+
if ((value.customconfig.airboss_recovery == true) and (value.customconfig.groupName == airbossconfig.recoverytanker)) then
|
|
1222
1604
|
objAirboss:SetRecoveryTanker(tankersArray[index])
|
|
1223
1605
|
objAirboss:MessageToMarshal('Recovery Tanker Setup : '..airbossconfig.recoverytanker, airbossconfig.alias, "", 30, false, 0)
|
|
1224
1606
|
break
|
|
1225
1607
|
end
|
|
1226
1608
|
end
|
|
1227
1609
|
end
|
|
1610
|
+
--Menus Management
|
|
1228
1611
|
if airbossconfig.menurecovery.enable == true then
|
|
1229
1612
|
objAirboss:SetMenuRecovery(airbossconfig.menurecovery.duration,
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1613
|
+
airbossconfig.menurecovery.windondeck,
|
|
1614
|
+
airbossconfig.menurecovery.uturn,
|
|
1615
|
+
airbossconfig.menurecovery.offset)
|
|
1233
1616
|
end
|
|
1234
1617
|
objAirboss:SetMenuMarkZones(airbossconfig.enable_menumarkzones)
|
|
1235
1618
|
objAirboss:SetMenuSmokeZones(airbossconfig.enable_menusmokezones)
|
|
1236
1619
|
objAirboss:SetAirbossNiceGuy(airbossconfig.enable_niceguy)
|
|
1237
|
-
if
|
|
1620
|
+
if airbossconfig.singlecarrier == true then
|
|
1621
|
+
objAirboss:SetMenuSingleCarrier()
|
|
1622
|
+
end
|
|
1623
|
+
--Communications Management
|
|
1624
|
+
if ( type(airbossconfig.srs) ~= 'nil' ) then
|
|
1238
1625
|
if ( airbossconfig.srs.useSRS == true) then
|
|
1626
|
+
--we use SRS as communication method
|
|
1239
1627
|
objAirboss:EnableSRS(SRSConfig.path, SRSConfig.port, 'en-US')
|
|
1628
|
+
objAirboss:SetLSORadio(airbossconfig.freq.lso, radio.modulation.AM, airbossconfig.srs.voices.lso)
|
|
1629
|
+
objAirboss:SetMarshalRadio(airbossconfig.freq.marshall, radio.modulation.AM, airbossconfig.srs.voices.marshall)
|
|
1630
|
+
objAirboss:SetAirbossRadio(airbossconfig.freq.base, radio.modulation.AM, airbossconfig.srs.voices.airboss)
|
|
1240
1631
|
else
|
|
1632
|
+
--we use voice overs from airboss : need to include soundfiles in the mission
|
|
1241
1633
|
objAirboss:SetSoundfilesFolder(soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/")
|
|
1242
|
-
if airbossconfig.voices.marshall then
|
|
1243
|
-
if airbossconfig.voices.marshall == "Raynor" then
|
|
1634
|
+
if airbossconfig.srs.voices.marshall then
|
|
1635
|
+
if airbossconfig.srs.voices.marshall == "Raynor" then
|
|
1244
1636
|
objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/')
|
|
1245
|
-
elseif airbossconfig.voices.marshall == "Gabriella" then
|
|
1637
|
+
elseif airbossconfig.srs.voices.marshall == "Gabriella" then
|
|
1246
1638
|
objAirboss:SetVoiceOversMarshalByGabriella(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Gabriella/')
|
|
1247
|
-
elseif airbossconfig.voices.marshall == "FF" then
|
|
1639
|
+
elseif airbossconfig.srs.voices.marshall == "FF" then
|
|
1248
1640
|
objAirboss:SetVoiceOversMarshalByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal FF/')
|
|
1249
1641
|
end
|
|
1250
1642
|
else
|
|
1251
1643
|
objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/')
|
|
1252
1644
|
end
|
|
1253
|
-
if airbossconfig.voices.lso then
|
|
1254
|
-
if airbossconfig.voices.lso == "Raynor" then
|
|
1645
|
+
if airbossconfig.srs.voices.lso then
|
|
1646
|
+
if airbossconfig.srs.voices.lso == "Raynor" then
|
|
1255
1647
|
objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/')
|
|
1256
|
-
elseif airbossconfig.voices.lso == "FF" then
|
|
1648
|
+
elseif airbossconfig.srs.voices.lso == "FF" then
|
|
1257
1649
|
objAirboss:SetVoiceOversLSOByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO FF/')
|
|
1258
1650
|
end
|
|
1259
1651
|
else
|
|
1260
1652
|
objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/')
|
|
1261
1653
|
end
|
|
1654
|
+
objAirboss:SetLSORadio(airbossconfig.freq.lso, radio.modulation.AM)
|
|
1655
|
+
objAirboss:SetMarshalRadio(airbossconfig.freq.marshall, radio.modulation.AM)
|
|
1656
|
+
objAirboss:SetAirbossRadio(airbossconfig.freq.base, radio.modulation.AM)
|
|
1262
1657
|
end
|
|
1263
1658
|
else
|
|
1659
|
+
--airbossconfig.srs does not exist
|
|
1660
|
+
--Should never happen as we parse the config
|
|
1264
1661
|
objAirboss:SetSoundfilesFolder(soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/")
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
elseif airbossconfig.voices.marshall == "FF" then
|
|
1271
|
-
objAirboss:SetVoiceOversMarshalByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal FF/')
|
|
1272
|
-
end
|
|
1273
|
-
else
|
|
1274
|
-
objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/')
|
|
1275
|
-
end
|
|
1276
|
-
if airbossconfig.voices.lso then
|
|
1277
|
-
if airbossconfig.voices.lso == "Raynor" then
|
|
1278
|
-
objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/')
|
|
1279
|
-
elseif airbossconfig.voices.lso == "FF" then
|
|
1280
|
-
objAirboss:SetVoiceOversLSOByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO FF/')
|
|
1281
|
-
end
|
|
1282
|
-
else
|
|
1283
|
-
objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/')
|
|
1284
|
-
end
|
|
1662
|
+
objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/')
|
|
1663
|
+
objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/')
|
|
1664
|
+
objAirboss:SetLSORadio(airbossconfig.freq.lso, radio.modulation.AM)
|
|
1665
|
+
objAirboss:SetMarshalRadio(airbossconfig.freq.marshall, radio.modulation.AM)
|
|
1666
|
+
objAirboss:SetAirbossRadio(airbossconfig.freq.base, radio.modulation.AM)
|
|
1285
1667
|
end
|
|
1286
|
-
objAirboss:SetLSORadio(airbossconfig.freq.lso, radio.modulation.AM, airbossconfig.voices.lso)
|
|
1287
|
-
objAirboss:SetMarshalRadio(airbossconfig.freq.marshall, radio.modulation.AM, airbossconfig.voices.marshall)
|
|
1288
|
-
objAirboss:SetAirbossRadio(airbossconfig.freq.base, radio.modulation.AM, airbossconfig.voices.airboss)
|
|
1289
1668
|
objAirboss:SetRadioRelayMarshal(airbossconfig.releayunit.marshall)
|
|
1290
1669
|
objAirboss:SetRadioRelayLSO(airbossconfig.releayunit.lso)
|
|
1291
1670
|
objAirboss:SetDebugModeOFF()
|
|
1292
|
-
objAirboss.trapsheet = false
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
end
|
|
1671
|
+
--objAirboss.trapsheet = false
|
|
1672
|
+
|
|
1673
|
+
--Recovery operation management
|
|
1296
1674
|
if (airbossconfig.recoveryops.mode == 'cyclic') then
|
|
1297
1675
|
if not(airbossconfig.recoveryops.cyclic.event_duration_minutes) then
|
|
1298
1676
|
airbossconfig.recoveryops.cyclic.event_duration_minutes = 60
|
|
1299
1677
|
end
|
|
1300
1678
|
end
|
|
1301
|
-
|
|
1302
|
-
local cvUnit = UNIT:FindByName(airbossconfig.carriername)
|
|
1303
|
-
cvUnit:SetCommand(
|
|
1304
|
-
{
|
|
1305
|
-
id = "ActivateLink4",
|
|
1306
|
-
params =
|
|
1307
|
-
{
|
|
1308
|
-
["unitId"] = cvUnit:GetID(),
|
|
1309
|
-
["frequency"] = airbossconfig.dl4.freq * 1000000
|
|
1310
|
-
},
|
|
1311
|
-
}
|
|
1312
|
-
)
|
|
1313
|
-
cvUnit:SetCommand(
|
|
1314
|
-
{
|
|
1315
|
-
id = "ActivateACLS",
|
|
1316
|
-
params =
|
|
1317
|
-
{
|
|
1318
|
-
["unitId"] = cvUnit:GetID(),
|
|
1319
|
-
},
|
|
1320
|
-
}
|
|
1321
|
-
)
|
|
1322
|
-
end
|
|
1679
|
+
--registering customconfig
|
|
1323
1680
|
objAirboss.customconfig = airbossconfig
|
|
1681
|
+
--Apply DeckLayout
|
|
1324
1682
|
if (
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1683
|
+
(objAirboss.carriertype == AIRBOSS.CarrierType.LINCOLN) or
|
|
1684
|
+
(objAirboss.carriertype == AIRBOSS.CarrierType.ROOSEVELT) or
|
|
1685
|
+
(objAirboss.carriertype == AIRBOSS.CarrierType.TRUMAN) or
|
|
1686
|
+
(objAirboss.carriertype == AIRBOSS.CarrierType.WASHINGTON)
|
|
1329
1687
|
) then
|
|
1330
1688
|
jtff_log.info(string.format("CSG : %s is Supercarrier apply Deck Layout...", objAirboss.customconfig.alias),"AIRBOSS")
|
|
1331
1689
|
flexDeck7SpawnLayout(objAirboss)
|
|
1332
1690
|
else
|
|
1333
1691
|
jtff_log.info(string.format("CSG : %s is not Supercarrier (%s) skipping Deck Layout...", objAirboss.customconfig.alias, objAirboss.carriertype),"AIRBOSS")
|
|
1334
1692
|
end
|
|
1335
|
-
function objAirboss:OnAfterLSOGrade(From, Event, To, playerData, myGrade)
|
|
1336
1693
|
|
|
1694
|
+
function objAirboss:detectShitHotBreak()
|
|
1695
|
+
local clientData={}
|
|
1696
|
+
local player_name=""
|
|
1697
|
+
jtff_log.debug('detectShitHotBreak : '.. objAirboss.customconfig.alias .. ' has ' .. objAirboss.CVNClients:Count()..' clients in Set ...',"AIRBOSS")
|
|
1698
|
+
objAirboss.CVNClients:ForEachClientInZone( objAirboss.CVN_UNITZone,
|
|
1699
|
+
function( MooseClient )
|
|
1700
|
+
|
|
1701
|
+
local function resetFlag(client)
|
|
1702
|
+
--trigger.action.outText('RESET SH Pass FLAG)', 5 )
|
|
1703
|
+
USERFLAG:New(client:GetUCID()):Set(0)
|
|
1704
|
+
end
|
|
1705
|
+
|
|
1706
|
+
local player_velocity = MooseClient:GetVelocityKNOTS()
|
|
1707
|
+
local player_name = MooseClient:GetPlayerName()
|
|
1708
|
+
local player_type = MooseClient:GetTypeName()
|
|
1709
|
+
local player_fuel = MooseClient:GetFuel()
|
|
1710
|
+
local player_alt_feet = UTILS.MetersToFeet(MooseClient:GetAltitude())
|
|
1711
|
+
--trigger.action.outText('ForEachClientInZone: MooseClient name is '..player_name , 5)
|
|
1712
|
+
|
|
1713
|
+
local Play_SH_Sound = USERSOUND:New( soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/GreatBallsOfFire.ogg" )
|
|
1714
|
+
--trigger.action.outText(player_name..' altitude is '..player_alt_feet..' feet', 5)
|
|
1715
|
+
--trigger.action.outText(player_name..' speed is '..player_velocity, 5)
|
|
1716
|
+
local client_in_zone_flag = USERFLAG:New(MooseClient:GetUCID())
|
|
1717
|
+
local client_performing_sh = USERFLAG:New(MooseClient:GetUCID()..'_sh')
|
|
1718
|
+
|
|
1719
|
+
if client_in_zone_flag:Get() == 0 and player_velocity > 475 and player_alt_feet < 700 then
|
|
1720
|
+
-- Requirements for Shit Hot break are velocity >475 knots and less than 700 feet
|
|
1721
|
+
trigger.action.outText(player_name..' performing a Sierra Hotel Break around ' .. objAirboss.customconfig.alias .. ' !', 10)
|
|
1722
|
+
if (type(dcsbot) ~= 'nil') then
|
|
1723
|
+
local title = string.format('Shit Hot Break !!!')
|
|
1724
|
+
local description = string.format("[%s] is performing a Sierra Hotel Break at %.0f knots and %.0f feet over %s.",player_name , UTILS.Round(player_velocity, 0), player_alt_feet, objAirboss.customconfig.alias)
|
|
1725
|
+
local img = 'https://media1.tenor.com/m/s5P2w4A4H2MAAAAd/003.gif'
|
|
1726
|
+
local fields = {
|
|
1727
|
+
['Pilot'] = player_name,
|
|
1728
|
+
['CVN'] = objAirboss.customconfig.alias
|
|
1729
|
+
}
|
|
1730
|
+
local footer = 'Great balls of fire...'
|
|
1731
|
+
dcsbot.sendEmbed(title, description, img, fields, footer)
|
|
1732
|
+
end
|
|
1733
|
+
Play_SH_Sound:ToClient(MooseClient)
|
|
1734
|
+
client_performing_sh:Set(1)
|
|
1735
|
+
client_in_zone_flag:Set(1)
|
|
1736
|
+
timer.scheduleFunction(resetFlag, MooseClient, timer.getTime() + 5 * 60)
|
|
1737
|
+
jtff_log.info('Sierra Hotel Bravo detected : '.. player_name .. ' is breaking over ' .. objAirboss.customconfig.alias ..'...',"AIRBOSS")
|
|
1738
|
+
end
|
|
1739
|
+
end
|
|
1740
|
+
)
|
|
1741
|
+
end
|
|
1742
|
+
|
|
1743
|
+
function objAirboss:OnAfterLSOGrade(From, Event, To, playerData, myGrade)
|
|
1337
1744
|
local string_grade = myGrade.grade
|
|
1338
|
-
local player_callsign = playerData.callsign
|
|
1339
1745
|
local unit_name = playerData.unitname
|
|
1340
1746
|
local player_name = playerData.name
|
|
1341
1747
|
local player_wire = playerData.wire
|
|
1748
|
+
local isSH = false
|
|
1749
|
+
local bonusPoint = 0
|
|
1750
|
+
local malusPoint = 0
|
|
1751
|
+
local trapSheetBaseName = string.format("AIRBOSS-trapsheet-%s", player_name)
|
|
1752
|
+
local boolSendFunkman = true
|
|
1753
|
+
|
|
1754
|
+
local PerfectSound = USERSOUND:New( soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/ffyrtp.ogg" )
|
|
1755
|
+
local FirstWireSound = USERSOUND:New( soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/GetYourButtsUptoVipersOffice.ogg" )
|
|
1342
1756
|
|
|
1343
1757
|
player_name = player_name:gsub('[%p]', '')
|
|
1344
1758
|
local client_performing_sh = USERFLAG:New(UNIT:FindByName(unit_name):GetClient():GetUCID()..'_sh')
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1759
|
+
if client_performing_sh:Get() == 1 then
|
|
1760
|
+
myGrade.grade = string.format("%s<SH>",myGrade.grade)
|
|
1761
|
+
client_performing_sh:Set(0)
|
|
1762
|
+
isSH = true
|
|
1763
|
+
bonusPoint = 1
|
|
1764
|
+
jtff_log.debug('Adding bonus point to '.. player_name .. ' for his shit hot break over ' .. objAirboss.customconfig.alias ..'...',"AIRBOSS")
|
|
1765
|
+
end
|
|
1766
|
+
if player_wire == 1 then
|
|
1767
|
+
malusPoint = 1
|
|
1768
|
+
jtff_log.debug('Substracting malus point to '.. player_name .. ' for his 1-wire trap on ' .. objAirboss.customconfig.alias ..'...',"AIRBOSS")
|
|
1348
1769
|
timer.scheduleFunction(
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1770
|
+
function()
|
|
1771
|
+
FirstWireSound:ToClient(UNIT:FindByName(unit_name):GetClient())
|
|
1772
|
+
end,
|
|
1773
|
+
{},
|
|
1774
|
+
timer.getTime() + 5
|
|
1354
1775
|
)
|
|
1355
|
-
if
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1776
|
+
if (type(dcsbot) ~= 'nil') then
|
|
1777
|
+
local title = string.format('Poor recovery !!!')
|
|
1778
|
+
local description = string.format("%s almost had a rampstrike with that 1-wire !",player_name)
|
|
1779
|
+
local img = 'https://theaviationgeekclub.com/wp-content/uploads/2019/05/VF-51-F-14A.jpg'
|
|
1780
|
+
local fields = {
|
|
1781
|
+
['Pilot'] = player_name,
|
|
1782
|
+
['CVN'] = objAirboss.customconfig.alias
|
|
1783
|
+
}
|
|
1784
|
+
local footer = 'Almost went direct to the parking...'
|
|
1785
|
+
dcsbot.sendEmbed(title, description, img, fields, footer)
|
|
1362
1786
|
end
|
|
1787
|
+
end
|
|
1788
|
+
if string_grade == "_OK_" then
|
|
1789
|
+
--if string_grade == "_OK_" and player_wire == "3" and player_Tgroove >=15 and player_Tgroove <19 then
|
|
1790
|
+
trapSheetBaseName = string.format("unicorn_%s",trapSheetBaseName)
|
|
1363
1791
|
timer.scheduleFunction(
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1792
|
+
function()
|
|
1793
|
+
PerfectSound:ToClient(UNIT:FindByName(unit_name):GetClient())
|
|
1794
|
+
end,
|
|
1795
|
+
{},
|
|
1796
|
+
timer.getTime() + 5
|
|
1369
1797
|
)
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
myGrade.points = myGrade.points + 1.00
|
|
1375
|
-
client_performing_sh:Set(0)
|
|
1376
|
-
self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name)
|
|
1377
|
-
else
|
|
1378
|
-
self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
|
|
1379
|
-
end
|
|
1380
|
-
|
|
1381
|
-
elseif string_grade == "(OK)" and player_wire >1 then
|
|
1382
|
-
self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
|
|
1383
|
-
if client_performing_sh:Get() == 1 then
|
|
1384
|
-
myGrade.grade = "(OK)<SH>"
|
|
1385
|
-
myGrade.points = myGrade.points + 1.00
|
|
1386
|
-
client_performing_sh:Set(0)
|
|
1387
|
-
self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name)
|
|
1388
|
-
else
|
|
1389
|
-
self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
|
|
1390
|
-
end
|
|
1391
|
-
|
|
1392
|
-
elseif string_grade == "--" and player_wire >1 then
|
|
1393
|
-
if client_performing_sh:Get() == 1 then
|
|
1394
|
-
myGrade.grade = "--<SH>"
|
|
1395
|
-
myGrade.points = myGrade.points + 1.00
|
|
1396
|
-
client_performing_sh:Set(0)
|
|
1397
|
-
self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name)
|
|
1398
|
-
else
|
|
1399
|
-
self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
|
|
1400
|
-
end
|
|
1401
|
-
else
|
|
1402
|
-
self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
|
|
1798
|
+
elseif string_grade == "WO" then
|
|
1799
|
+
boolSendFunkman = false
|
|
1800
|
+
elseif string_grade == "NC" then
|
|
1801
|
+
boolSendFunkman = false
|
|
1403
1802
|
end
|
|
1404
1803
|
myGrade.messageType = 2
|
|
1405
1804
|
myGrade.callsign = playerData.callsign
|
|
1406
1805
|
myGrade.name = playerData.name
|
|
1407
|
-
myGrade.airbossconfig =
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
FunkMan:SendTable({
|
|
1412
|
-
command="moose_text",
|
|
1413
|
-
text=onewire_to_discord,
|
|
1414
|
-
msg_type='lso'
|
|
1415
|
-
})
|
|
1416
|
-
timer.scheduleFunction(
|
|
1417
|
-
function()
|
|
1418
|
-
--trigger.action.outSound("AIRBOSS/Airboss Soundfiles/GetYourButtsUptoVipersOffice.ogg")
|
|
1419
|
-
end,
|
|
1420
|
-
{},
|
|
1421
|
-
timer.getTime() + 5
|
|
1422
|
-
)
|
|
1806
|
+
myGrade.airbossconfig = objAirboss.customconfig
|
|
1807
|
+
myGrade.points = math.min(math.max(myGrade.points - malusPoint, 0.50) + bonusPoint, 5)
|
|
1808
|
+
if isSH then
|
|
1809
|
+
trapSheetBaseName = string.format("SH_%s",trapSheetBaseName)
|
|
1423
1810
|
end
|
|
1424
|
-
|
|
1811
|
+
objAirboss:SetTrapSheet(objAirboss.trappath, trapSheetBaseName)
|
|
1812
|
+
if boolSendFunkman then
|
|
1813
|
+
--objAirboss:_SaveTrapSheet(playerData, myGrade)
|
|
1425
1814
|
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
-- -- Extract used info for FunkMan. We need to be careful with the amount of data send via UDP socket.
|
|
1429
|
-
-- local trapsheet={} ; trapsheet.X={} ; trapsheet.Z={} ; trapsheet.AoA={} ; trapsheet.Alt={}
|
|
1430
|
-
--
|
|
1431
|
-
-- -- Loop over trapsheet and extract used values.
|
|
1432
|
-
-- for i = 1, #playerData.trapsheet do
|
|
1433
|
-
-- local ts=playerData.trapsheet[i] --#AIRBOSS.GrooveData
|
|
1434
|
-
-- table.insert(trapsheet.X, UTILS.Round(ts.X, 1))
|
|
1435
|
-
-- table.insert(trapsheet.Z, UTILS.Round(ts.Z, 1))
|
|
1436
|
-
-- table.insert(trapsheet.AoA, UTILS.Round(ts.AoA, 2))
|
|
1437
|
-
-- table.insert(trapsheet.Alt, UTILS.Round(ts.Alt, 1))
|
|
1438
|
-
-- end
|
|
1439
|
-
--
|
|
1440
|
-
-- local result={}
|
|
1441
|
-
-- result.command=SOCKET.DataType.LSOGRADE
|
|
1442
|
-
-- result.name=playerData.name
|
|
1443
|
-
-- result.trapsheet=trapsheet
|
|
1444
|
-
-- result.airframe=myGrade.airframe
|
|
1445
|
-
-- result.modex=myGrade.modex
|
|
1446
|
-
-- result.mitime=myGrade.mitime
|
|
1447
|
-
-- result.midate=myGrade.midate
|
|
1448
|
-
-- result.wind=myGrade.wind
|
|
1449
|
-
-- result.carriertype=myGrade.carriertype
|
|
1450
|
-
-- result.carriername=myGrade.carriername
|
|
1451
|
-
-- result.carrierrwy=myGrade.carrierrwy
|
|
1452
|
-
-- result.landingdist=self.carrierparam.landingdist
|
|
1453
|
-
-- result.theatre=myGrade.theatre
|
|
1454
|
-
-- result.case=playerData.case
|
|
1455
|
-
-- result.Tgroove=myGrade.Tgroove
|
|
1456
|
-
-- result.wire=myGrade.wire
|
|
1457
|
-
-- result.grade=myGrade.grade
|
|
1458
|
-
-- result.points=myGrade.points
|
|
1459
|
-
-- result.details=myGrade.details
|
|
1460
|
-
-- result.finalscore=myGrade.finalscore or myGrade.points
|
|
1461
|
-
--
|
|
1462
|
-
-- -- Debug info.
|
|
1463
|
-
-- self:T(self.lid.."Result onafterLSOGrade")
|
|
1464
|
-
-- self:T(result)
|
|
1465
|
-
--
|
|
1466
|
-
-- -- Send result.
|
|
1467
|
-
-- self.funkmanSocket:SendTable(result)
|
|
1468
|
-
--end
|
|
1469
|
-
|
|
1470
|
-
--TODO reactivate the timer.schedule maybe ?
|
|
1471
|
-
--timer.scheduleFunction(
|
|
1472
|
-
-- function(airbossObject)
|
|
1473
|
-
-- airbossObject:SetTrapSheet(airbossObject.trappath)
|
|
1474
|
-
-- end,
|
|
1475
|
-
-- {self},
|
|
1476
|
-
-- timer.getTime() + 10
|
|
1477
|
-
--)
|
|
1478
|
-
--local myScheduleTime = TIMER:New(10, nil,nil):resetTrapSheetFileFormat()
|
|
1479
|
-
end
|
|
1815
|
+
objAirboss:SetFunkManOn(FunkmanConfig.port, FunkmanConfig.ip)
|
|
1816
|
+
local trapsheet={} ; trapsheet.X={} ; trapsheet.Z={} ; trapsheet.AoA={} ; trapsheet.Alt={}
|
|
1480
1817
|
|
|
1818
|
+
-- Loop over trapsheet and extract used values.
|
|
1819
|
+
for i = 1, #playerData.trapsheet do
|
|
1820
|
+
local ts=playerData.trapsheet[i] --#AIRBOSS.GrooveData
|
|
1821
|
+
table.insert(trapsheet.X, UTILS.Round(ts.X, 1))
|
|
1822
|
+
table.insert(trapsheet.Z, UTILS.Round(ts.Z, 1))
|
|
1823
|
+
table.insert(trapsheet.AoA, UTILS.Round(ts.AoA, 2))
|
|
1824
|
+
table.insert(trapsheet.Alt, UTILS.Round(ts.Alt, 1))
|
|
1825
|
+
end
|
|
1826
|
+
local result={}
|
|
1827
|
+
result.command=SOCKET.DataType.LSOGRADE
|
|
1828
|
+
result.name=playerData.name
|
|
1829
|
+
result.trapsheet=trapsheet
|
|
1830
|
+
result.airframe=myGrade.airframe
|
|
1831
|
+
result.mitime=myGrade.mitime
|
|
1832
|
+
result.midate=myGrade.midate
|
|
1833
|
+
result.wind=myGrade.wind
|
|
1834
|
+
result.carriertype=myGrade.carriertype
|
|
1835
|
+
result.carriername=myGrade.carriername
|
|
1836
|
+
result.carrierrwy=myGrade.carrierrwy
|
|
1837
|
+
result.landingdist=objAirboss.carrierparam.landingdist
|
|
1838
|
+
result.theatre=myGrade.theatre
|
|
1839
|
+
result.case=playerData.case
|
|
1840
|
+
result.Tgroove=myGrade.Tgroove
|
|
1841
|
+
result.wire=player_wire
|
|
1842
|
+
result.grade=myGrade.grade
|
|
1843
|
+
result.points=myGrade.points
|
|
1844
|
+
result.details=myGrade.details
|
|
1481
1845
|
|
|
1846
|
+
-- Send result.
|
|
1847
|
+
objAirboss.funkmanSocket:SendTable(result)
|
|
1848
|
+
objAirboss.funkmanSocket = nil
|
|
1849
|
+
end
|
|
1850
|
+
jtff_log.info(string.format("%s trapped on %s in case %.0f with Grade %s and %.1f points.",player_name,objAirboss.customconfig.alias,playerData.case,myGrade.grade,myGrade.points),"AIRBOSS")
|
|
1851
|
+
end
|
|
1482
1852
|
|
|
1483
1853
|
function objAirboss:OnAfterRecoveryStart(From, Event, To, Case, Offset)
|
|
1484
|
-
|
|
1854
|
+
objAirboss:MessageToMarshal('Recovery started Case '..Case..' operations...', objAirboss.customconfig.alias, "", 30, false, 10)
|
|
1485
1855
|
end
|
|
1486
1856
|
|
|
1487
1857
|
function objAirboss:OnAfterRecoveryStop(From, Event, To)
|
|
1488
|
-
|
|
1858
|
+
local nextRecoveryStart
|
|
1859
|
+
local nextRecoveryStop
|
|
1860
|
+
objAirboss:MessageToMarshal('Recovery operations closed.', objAirboss.customconfig.alias, "", 30, false, 10)
|
|
1489
1861
|
if (airbossconfig.recoveryops.mode == 'cyclic') then
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
self:SetMaxSectionSize(1)
|
|
1504
|
-
else
|
|
1505
|
-
self:SetMaxSectionSize(1)
|
|
1506
|
-
end
|
|
1507
|
-
self:AddRecoveryWindow(
|
|
1508
|
-
UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0),
|
|
1509
|
-
UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0),
|
|
1510
|
-
self.defaultcase,
|
|
1511
|
-
self.customconfig.menurecovery.offset,
|
|
1512
|
-
true,
|
|
1513
|
-
self.customconfig.menurecovery.windondeck,
|
|
1514
|
-
self.customconfig.menurecovery.uturn
|
|
1515
|
-
)
|
|
1516
|
-
self:MessageToMarshal('Next Recovery in : '..UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes/3, 0)..' minutes', self.customconfig.alias, "", 30, false, 0)
|
|
1517
|
-
--LeaveRecovery(self)
|
|
1518
|
-
end
|
|
1862
|
+
nextRecoveryStart = timer.getAbsTime() + UTILS.Round(objAirboss.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0)
|
|
1863
|
+
nextRecoveryStop = timer.getAbsTime() + UTILS.Round(objAirboss.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0)
|
|
1864
|
+
objAirboss:SetRecoveryCase(getCaseTypeFromWeather(
|
|
1865
|
+
objAirboss:GetCoordinate(),
|
|
1866
|
+
nextRecoveryStart,
|
|
1867
|
+
nextRecoveryStop
|
|
1868
|
+
))
|
|
1869
|
+
if objAirboss.defaultcase == 1 then
|
|
1870
|
+
objAirboss:SetMaxSectionSize(4)
|
|
1871
|
+
elseif objAirboss.defaultcase == 2 then
|
|
1872
|
+
objAirboss:SetMaxSectionSize(2)
|
|
1873
|
+
elseif objAirboss.defaultcase == 3 then
|
|
1874
|
+
objAirboss:SetMaxSectionSize(1)
|
|
1519
1875
|
else
|
|
1520
|
-
|
|
1521
|
-
self:GetCoordinate(),
|
|
1522
|
-
timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0),
|
|
1523
|
-
timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0)
|
|
1524
|
-
))
|
|
1525
|
-
if self.defaultcase == 1 then
|
|
1526
|
-
self:MessageToMarshal('Good visibility : Case I', self.customconfig.alias, "", 45, false, 0)
|
|
1527
|
-
self:SetMaxSectionSize(4)
|
|
1528
|
-
elseif self.defaultcase == 2 then
|
|
1529
|
-
self:MessageToMarshal('Bad visibility in altitude : Case II', self.customconfig.alias, "", 45, false, 0)
|
|
1530
|
-
self:SetMaxSectionSize(2)
|
|
1531
|
-
elseif self.defaultcase == 3 then
|
|
1532
|
-
self:MessageToMarshal('Bad visibility : Case III', self.customconfig.alias, "", 45, false, 0)
|
|
1533
|
-
self:SetMaxSectionSize(1)
|
|
1534
|
-
else
|
|
1535
|
-
self:SetMaxSectionSize(1)
|
|
1536
|
-
end
|
|
1537
|
-
self:AddRecoveryWindow(
|
|
1538
|
-
UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0),
|
|
1539
|
-
UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0),
|
|
1540
|
-
self.defaultcase,
|
|
1541
|
-
self.customconfig.menurecovery.offset,
|
|
1542
|
-
true,
|
|
1543
|
-
self.customconfig.menurecovery.windondeck,
|
|
1544
|
-
self.customconfig.menurecovery.uturn
|
|
1545
|
-
)
|
|
1546
|
-
self:MessageToMarshal('Next Recovery in : '..UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes/3, 0)..' minutes', self.customconfig.alias, "", 30, false, 0)
|
|
1547
|
-
--LeaveRecovery(self)
|
|
1876
|
+
objAirboss:SetMaxSectionSize(1)
|
|
1548
1877
|
end
|
|
1878
|
+
objAirboss:AddRecoveryWindow(
|
|
1879
|
+
UTILS.SecondsToClock(nextRecoveryStart,false,false),
|
|
1880
|
+
UTILS.SecondsToClock(nextRecoveryStop,false,false),
|
|
1881
|
+
objAirboss.defaultcase,
|
|
1882
|
+
objAirboss.customconfig.menurecovery.offset,
|
|
1883
|
+
true,
|
|
1884
|
+
objAirboss.customconfig.menurecovery.windondeck,
|
|
1885
|
+
objAirboss.customconfig.menurecovery.uturn
|
|
1886
|
+
)
|
|
1887
|
+
objAirboss:MessageToMarshal('Next Recovery in : '..UTILS.Round(objAirboss.customconfig.recoveryops.cyclic.event_duration_minutes/3, 0)..' minutes', objAirboss.customconfig.alias, "", 30, false, 0)
|
|
1888
|
+
--LeaveRecovery(objAirboss)
|
|
1549
1889
|
end
|
|
1550
1890
|
end
|
|
1551
|
-
|
|
1552
1891
|
AIRBOSSArray[compteur] = objAirboss
|
|
1553
1892
|
AIRBOSSArray[compteur]:Start()
|
|
1554
1893
|
AIRBOSSArray[compteur].CVN_UNITZone = ZONE_UNIT:New(
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1894
|
+
'cvnUnitZone-'..AIRBOSSArray[compteur].customconfig.alias,
|
|
1895
|
+
AIRBOSSArray[compteur].carrier,
|
|
1896
|
+
1111
|
|
1897
|
+
)
|
|
1558
1898
|
AIRBOSSArray[compteur].CVNClients = SET_CLIENT:New()
|
|
1559
1899
|
:FilterActive()
|
|
1560
1900
|
:FilterCoalitions(string.lower(UTILS.GetCoalitionName(objAirboss.customconfig.coalition)))
|
|
@@ -1562,101 +1902,106 @@ for index, airbossconfig in ipairs(AirBossConfig) do
|
|
|
1562
1902
|
local myscheduler
|
|
1563
1903
|
local myschedulerID
|
|
1564
1904
|
myscheduler, myschedulerID = SCHEDULER:New(
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1905
|
+
nil,
|
|
1906
|
+
AIRBOSSArray[compteur].detectShitHotBreak,
|
|
1907
|
+
nil,
|
|
1908
|
+
2,
|
|
1909
|
+
1
|
|
1570
1910
|
)
|
|
1571
1911
|
AIRBOSSArray[compteur].scheduler = myscheduler
|
|
1572
1912
|
AIRBOSSArray[compteur].schedulerID = myschedulerID
|
|
1573
|
-
|
|
1913
|
+
trigger.action.outText('INFO '..airbossconfig.alias..' : Naval sunset at '..UTILS.SecondsToClock((AIRBOSSArray[compteur]:GetCoordinate():GetSunset(true) - 30*60)), 75)
|
|
1914
|
+
local nextRecoveryStart
|
|
1915
|
+
local nextRecoveryStop
|
|
1574
1916
|
if (airbossconfig.recoveryops.mode == 'cyclic') then
|
|
1917
|
+
if airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes then
|
|
1918
|
+
nextRecoveryStart = timer.getAbsTime() + (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*0/3, 0)
|
|
1919
|
+
nextRecoveryStop = timer.getAbsTime() + (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*2/3, 0)
|
|
1920
|
+
else
|
|
1921
|
+
nextRecoveryStart = timer.getAbsTime() + 15*60 + UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*0/3, 0)
|
|
1922
|
+
nextRecoveryStop = timer.getAbsTime() + 15*60 + UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*2/3, 0)
|
|
1923
|
+
end
|
|
1575
1924
|
AIRBOSSArray[compteur]:SetRecoveryCase(getCaseTypeFromWeather(
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1925
|
+
AIRBOSSArray[compteur]:GetCoordinate(),
|
|
1926
|
+
nextRecoveryStart,
|
|
1927
|
+
nextRecoveryStop
|
|
1579
1928
|
))
|
|
1580
1929
|
if AIRBOSSArray[compteur].defaultcase == 1 then
|
|
1581
|
-
AIRBOSSArray[compteur]:MessageToMarshal('Good visibility : Case I', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
|
|
1582
1930
|
AIRBOSSArray[compteur]:SetMaxSectionSize(4)
|
|
1583
1931
|
elseif AIRBOSSArray[compteur].defaultcase == 2 then
|
|
1584
|
-
AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility in altitude : Case II', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
|
|
1585
1932
|
AIRBOSSArray[compteur]:SetMaxSectionSize(2)
|
|
1586
1933
|
elseif AIRBOSSArray[compteur].defaultcase == 3 then
|
|
1587
|
-
AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility : Case III', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
|
|
1588
1934
|
AIRBOSSArray[compteur]:SetMaxSectionSize(1)
|
|
1589
1935
|
else
|
|
1590
1936
|
AIRBOSSArray[compteur]:SetMaxSectionSize(1)
|
|
1591
1937
|
end
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
UTILS.Round(env.mission.start_time + (alphaevent.recovery_start_minutes * 60) ,0),
|
|
1621
|
-
UTILS.Round(env.mission.start_time + (( alphaevent.recovery_start_minutes + alphaevent.recovery_duration_minutes ) * 60),0)
|
|
1622
|
-
))
|
|
1623
|
-
if AIRBOSSArray[compteur].defaultcase == 1 then
|
|
1624
|
-
AIRBOSSArray[compteur]:MessageToMarshal('Good visibility : Case I', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
|
|
1625
|
-
AIRBOSSArray[compteur]:SetMaxSectionSize(4)
|
|
1626
|
-
elseif AIRBOSSArray[compteur].defaultcase == 2 then
|
|
1627
|
-
AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility in altitude : Case II', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
|
|
1628
|
-
AIRBOSSArray[compteur]:SetMaxSectionSize(2)
|
|
1629
|
-
elseif AIRBOSSArray[compteur].defaultcase == 3 then
|
|
1630
|
-
AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility : Case III', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
|
|
1631
|
-
AIRBOSSArray[compteur]:SetMaxSectionSize(1)
|
|
1632
|
-
else
|
|
1633
|
-
AIRBOSSArray[compteur]:SetMaxSectionSize(1)
|
|
1634
|
-
end
|
|
1635
|
-
AIRBOSSArray[compteur]:AddRecoveryWindow(
|
|
1636
|
-
UTILS.SecondsToClock(env.mission.start_time + (alphaevent.recovery_start_minutes * 60) ),
|
|
1637
|
-
UTILS.SecondsToClock(env.mission.start_time +
|
|
1638
|
-
( (alphaevent.recovery_start_minutes + alphaevent.recovery_duration_minutes) * 60)),
|
|
1639
|
-
AIRBOSSArray[compteur].defaultcase,
|
|
1640
|
-
airbossconfig.menurecovery.offset,
|
|
1641
|
-
true,
|
|
1642
|
-
airbossconfig.menurecovery.windondeck,
|
|
1643
|
-
airbossconfig.menurecovery.uturn
|
|
1644
|
-
)
|
|
1938
|
+
AIRBOSSArray[compteur]:AddRecoveryWindow(
|
|
1939
|
+
UTILS.SecondsToClock(nextRecoveryStart,false,false),
|
|
1940
|
+
UTILS.SecondsToClock(nextRecoveryStop,false,false),
|
|
1941
|
+
AIRBOSSArray[compteur].defaultcase,
|
|
1942
|
+
airbossconfig.menurecovery.offset,
|
|
1943
|
+
true,
|
|
1944
|
+
airbossconfig.menurecovery.windondeck,
|
|
1945
|
+
airbossconfig.menurecovery.uturn
|
|
1946
|
+
)
|
|
1947
|
+
elseif (airbossconfig.recoveryops.mode == 'alpha') then
|
|
1948
|
+
if (airbossconfig.recoveryops.alpha) then
|
|
1949
|
+
if (airbossconfig.recoveryops.alpha.recoveries) then
|
|
1950
|
+
for alphaindex, alphaevent in ipairs(airbossconfig.recoveryops.alpha.recoveries) do
|
|
1951
|
+
nextRecoveryStart = UTILS.Round(env.mission.start_time + (alphaevent.recovery_start_minutes * 60),0)
|
|
1952
|
+
nextRecoveryStop = UTILS.Round(env.mission.start_time + (( alphaevent.recovery_start_minutes + alphaevent.recovery_duration_minutes ) * 60),0)
|
|
1953
|
+
AIRBOSSArray[compteur]:SetRecoveryCase(getCaseTypeFromWeather(
|
|
1954
|
+
AIRBOSSArray[compteur]:GetCoordinate(),
|
|
1955
|
+
nextRecoveryStart,
|
|
1956
|
+
nextRecoveryStop
|
|
1957
|
+
))
|
|
1958
|
+
if AIRBOSSArray[compteur].defaultcase == 1 then
|
|
1959
|
+
AIRBOSSArray[compteur]:SetMaxSectionSize(4)
|
|
1960
|
+
elseif AIRBOSSArray[compteur].defaultcase == 2 then
|
|
1961
|
+
AIRBOSSArray[compteur]:SetMaxSectionSize(2)
|
|
1962
|
+
elseif AIRBOSSArray[compteur].defaultcase == 3 then
|
|
1963
|
+
AIRBOSSArray[compteur]:SetMaxSectionSize(1)
|
|
1964
|
+
else
|
|
1965
|
+
AIRBOSSArray[compteur]:SetMaxSectionSize(1)
|
|
1645
1966
|
end
|
|
1967
|
+
AIRBOSSArray[compteur]:AddRecoveryWindow(
|
|
1968
|
+
UTILS.SecondsToClock(nextRecoveryStart),
|
|
1969
|
+
UTILS.SecondsToClock(nextRecoveryStop)
|
|
1970
|
+
)
|
|
1646
1971
|
end
|
|
1647
1972
|
end
|
|
1973
|
+
end
|
|
1974
|
+
else
|
|
1975
|
+
AIRBOSSArray[compteur]:SetRecoveryCase(getCaseTypeFromWeather(
|
|
1976
|
+
AIRBOSSArray[compteur]:GetCoordinate(),
|
|
1977
|
+
UTILS.Round(env.mission.start_time + (5 * 60),0),
|
|
1978
|
+
UTILS.Round(env.mission.start_time + (35 * 60),0)
|
|
1979
|
+
))
|
|
1980
|
+
if AIRBOSSArray[compteur].defaultcase == 1 then
|
|
1981
|
+
AIRBOSSArray[compteur]:SetMaxSectionSize(4)
|
|
1982
|
+
elseif AIRBOSSArray[compteur].defaultcase == 2 then
|
|
1983
|
+
AIRBOSSArray[compteur]:SetMaxSectionSize(2)
|
|
1984
|
+
elseif AIRBOSSArray[compteur].defaultcase == 3 then
|
|
1985
|
+
AIRBOSSArray[compteur]:SetMaxSectionSize(1)
|
|
1648
1986
|
else
|
|
1649
|
-
|
|
1650
|
-
end
|
|
1987
|
+
AIRBOSSArray[compteur]:SetMaxSectionSize(1)
|
|
1651
1988
|
end
|
|
1652
1989
|
end
|
|
1653
1990
|
trigger.action.outText('AIRBOSS scripts Loaded for unit '..airbossconfig.carriername, 10)
|
|
1654
|
-
timer.scheduleFunction(
|
|
1655
|
-
|
|
1656
|
-
|
|
1991
|
+
timer.scheduleFunction(
|
|
1992
|
+
function()
|
|
1993
|
+
trigger.action.outText( "<< If the AIRBOSS option does not appear in your F10 - Other Menu, try switching slots a few times and you will get the AIRBOSS message popups! Check the AIRBOSS documentation (link in briefing for more info) >>", 30)
|
|
1994
|
+
end,
|
|
1995
|
+
nil,
|
|
1996
|
+
timer.getTime() + 30
|
|
1997
|
+
)
|
|
1657
1998
|
else
|
|
1658
|
-
timer.scheduleFunction(
|
|
1659
|
-
|
|
1660
|
-
|
|
1999
|
+
timer.scheduleFunction(
|
|
2000
|
+
function()
|
|
2001
|
+
trigger.action.outText('AIRBOSS script disabled for unit '..airbossconfig.carriername, 10)
|
|
2002
|
+
end,
|
|
2003
|
+
nil,
|
|
2004
|
+
timer.getTime() + 8
|
|
2005
|
+
)
|
|
1661
2006
|
end
|
|
1662
2007
|
end
|