@jtff/miztemplate-lib 3.10.5 → 3.10.7

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.
@@ -5,69 +5,71 @@ RATManagerArray = {}
5
5
  compteur = 0
6
6
  for index, ratconfig in ipairs(RATConfig) do
7
7
  if ratconfig.enable == true then
8
- jtff_log.info(string.format("RAT Enable"),"RAT")
8
+ jtff_log.info(string.format("RATManager %s Enable",ratconfig.name),"RAT")
9
9
  compteur = compteur +1
10
- if not (ratconfig.maximum_aircrafts) then
11
- ratconfig.maximum_aircrafts = 10
12
- end
13
- local RATmanager=RATMANAGER:New(ratconfig.maximum_aircrafts)
10
+ local ratManagerName = ratconfig.name or "unknown"
11
+ RATManagerArray[compteur] = RATMANAGER:New(ratconfig.constant_alive_groups or nil)
12
+ RATManagerArray[compteur].RATObjectsArray = {}
14
13
  for index_planegroup, planegroupconfig in ipairs(ratconfig.aircrafts_groupconfigs) do
15
14
  if (type(planegroupconfig.templatename) == "string") then
16
15
  planegroupconfig.templatename = {planegroupconfig.templatename}
17
16
  end
18
17
  if (type(planegroupconfig.templatename) == "table") then
19
- for index, templatename in ipairs(planegroupconfig.templatename) do
20
- jtff_log.debug(string.format("RAT %s", templatename),"RAT")
21
- local RATGroup = RAT:New(templatename)
18
+ for templateindex, templatename in ipairs(planegroupconfig.templatename) do
19
+ jtff_log.debug(string.format("RATManager %s - template %s", ratManagerName ,templatename),"RAT")
20
+ RATManagerArray[compteur].RATObjectsArray[templateindex] = RAT:New(templatename)
22
21
  if (type(planegroupconfig.airbases_names) == "table" ) then
23
- RATGroup:SetTakeoff("cold")
22
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:SetTakeoff("cold")
24
23
  for airstartindex, airstartname in ipairs(planegroupconfig.airbases_names.departure) do
25
- if not(RATGroup:_AirportExists(airstartname)) then
26
- RATGroup:SetTakeoff("air")
24
+ if not(RATManagerArray[compteur].RATObjectsArray[templateindex]:_AirportExists(airstartname)) then
25
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:SetTakeoff("air")
27
26
  end
28
27
  end
29
28
  for airstopindex, airstopname in ipairs(planegroupconfig.airbases_names.arrival) do
30
- if not(RATGroup:_AirportExists(airstopname)) then
31
- RATGroup:DestinationZone()
29
+ if not(RATManagerArray[compteur].RATObjectsArray[templateindex]:_AirportExists(airstopname)) then
30
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:DestinationZone()
32
31
  end
33
32
  end
34
- RATGroup:SetDeparture(planegroupconfig.airbases_names.departure)
35
- RATGroup:SetDestination(planegroupconfig.airbases_names.arrival)
33
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:SetDeparture(planegroupconfig.airbases_names.departure)
34
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:SetDestination(planegroupconfig.airbases_names.arrival)
36
35
  end
37
36
  if (type(planegroupconfig.inactive_timer) == "number" ) then
38
- RATGroup:TimeDestroyInactive(planegroupconfig.inactive_timer)
37
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:TimeDestroyInactive(planegroupconfig.inactive_timer)
39
38
  end
40
39
  if (type(planegroupconfig.atcmessage_enable) == "boolean" ) then
41
- RATGroup:ATC_Messages(planegroupconfig.atcmessage_enable)
40
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:ATC_Messages(planegroupconfig.atcmessage_enable)
42
41
  else
43
- RATGroup:ATC_Messages(false)
42
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:ATC_Messages(false)
44
43
  end
45
44
  if (type(planegroupconfig.flightlevel) == "number" ) then
46
- RATGroup:SetFLcruise(planegroupconfig.flightlevel)
45
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:SetFLcruise(planegroupconfig.flightlevel)
47
46
  end
48
47
  if (type(planegroupconfig.speed) == "number") then
49
- RATGroup:SetMaxCruiseSpeed(UTILS.KnotsToKmph(planegroupconfig.speed))
48
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:SetMaxCruiseSpeed(UTILS.KnotsToKmph(planegroupconfig.speed))
50
49
  end
51
50
  if (planegroupconfig.liveries) then
52
- RATGroup:Livery(planegroupconfig.liveries)
51
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:Livery(planegroupconfig.liveries)
53
52
  end
54
53
  if (type(planegroupconfig.allow_immortal) == "boolean" and planegroupconfig.allow_immortal == true) then
55
- RATGroup:Immortal()
54
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:Immortal()
56
55
  end
57
56
  if (type(planegroupconfig.allow_invisible) == "boolean" and planegroupconfig.allow_invisible == true) then
58
- RATGroup:Invisible()
57
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:Invisible()
59
58
  end
60
59
  if (type(planegroupconfig.commute) == "boolean" and planegroupconfig.commute == true) then
61
- RATGroup:Commute(true)
60
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:Commute(true)
62
61
  end
63
- RATGroup:SetEPLRS(true)
64
- RATmanager:Add(RATGroup, planegroupconfig.minimun_spawns)
62
+ RATManagerArray[compteur].RATObjectsArray[templateindex]:SetEPLRS(true)
63
+ 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()
65
67
  end
66
68
  else
67
69
  jtff_log.error(string.format("RAT error in template name type : %s", planegroupconfig.templatename),"RAT")
68
70
  end
69
71
  end
70
- RATManagerArray[compteur] = RATmanager
72
+ RATManagerArray[compteur].customconfig = ratconfig
71
73
  RATManagerArray[compteur]:Start(spawnStandardDelay)
72
74
  end
73
75
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jtff/miztemplate-lib",
3
- "version": "3.10.5",
3
+ "version": "3.10.7",
4
4
  "description": "JTFF mission template library",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -196,13 +196,6 @@ async function doInject(ciObject, sourceMizFileName, workspacePath,destinationMi
196
196
  timing: 12,
197
197
  color: '0x008000ff'
198
198
  });
199
- libsArray.push({
200
- folder: 'lib',
201
- scriptTitle: 'Hercules',
202
- scripts: ['Hercules_Cargo.lua'],
203
- timing: 14,
204
- color: '0x008000ff'
205
- });
206
199
  libsArray.push({
207
200
  folder: 'lib',
208
201
  scriptTitle: 'Skynet and Hound',