@jtff/miztemplate-lib 3.5.2 → 3.5.4

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.
@@ -1,4 +1,4 @@
1
- env.info('*** MOOSE GITHUB Commit Hash ID: 2024-10-21T11:33:14+02:00-cd178d6a8cd8467af0d09f9669a779d84991ef58 ***')
1
+ env.info('*** MOOSE GITHUB Commit Hash ID: 2024-12-03T18:07:38+01:00-a30079c45b24979a1cb0d9ba781e5c30af8f4018 ***')
2
2
  if not MOOSE_DEVELOPMENT_FOLDER then
3
3
  MOOSE_DEVELOPMENT_FOLDER='Scripts'
4
4
  end
@@ -1053,18 +1053,18 @@ ENUMS.Storage.weapons.UH1H.M134_MiniGun_Right_Door={4,15,46,175}
1053
1053
  ENUMS.Storage.weapons.UH1H.M60_MG_Right_Door={4,15,46,177}
1054
1054
  ENUMS.Storage.weapons.UH1H.M134_MiniGun_Left_Door={4,15,46,174}
1055
1055
  ENUMS.Storage.weapons.UH1H.M60_MG_Left_Door={4,15,46,176}
1056
- ENUMS.Storage.weapons.OH58.FIM92={4,4,7,446}
1057
- ENUMS.Storage.weapons.OH58.MG_M3P100={4,15,46,2578}
1058
- ENUMS.Storage.weapons.OH58.MG_M3P200={4,15,46,2577}
1059
- ENUMS.Storage.weapons.OH58.MG_M3P300={4,15,46,2576}
1060
- ENUMS.Storage.weapons.OH58.MG_M3P400={4,15,46,2575}
1061
- ENUMS.Storage.weapons.OH58.MG_M3P500={4,15,46,2574}
1062
- ENUMS.Storage.weapons.OH58.Smk_Grenade_Blue={4,5,9,484}
1063
- ENUMS.Storage.weapons.OH58.Smk_Grenade_Green={4,5,9,485}
1064
- ENUMS.Storage.weapons.OH58.Smk_Grenade_Red={4,5,9,483}
1065
- ENUMS.Storage.weapons.OH58.Smk_Grenade_Violet={4,5,9,486}
1066
- ENUMS.Storage.weapons.OH58.Smk_Grenade_White={4,5,9,488}
1067
- ENUMS.Storage.weapons.OH58.Smk_Grenade_Yellow={4,5,9,487}
1056
+ ENUMS.Storage.weapons.OH58.FIM92={4,4,7,449}
1057
+ ENUMS.Storage.weapons.OH58.MG_M3P100={4,15,46,2608}
1058
+ ENUMS.Storage.weapons.OH58.MG_M3P200={4,15,46,2607}
1059
+ ENUMS.Storage.weapons.OH58.MG_M3P300={4,15,46,2606}
1060
+ ENUMS.Storage.weapons.OH58.MG_M3P400={4,15,46,2605}
1061
+ ENUMS.Storage.weapons.OH58.MG_M3P500={4,15,46,2604}
1062
+ ENUMS.Storage.weapons.OH58.Smk_Grenade_Blue={4,5,9,486}
1063
+ ENUMS.Storage.weapons.OH58.Smk_Grenade_Green={4,5,9,487}
1064
+ ENUMS.Storage.weapons.OH58.Smk_Grenade_Red={4,5,9,485}
1065
+ ENUMS.Storage.weapons.OH58.Smk_Grenade_Violet={4,5,9,488}
1066
+ ENUMS.Storage.weapons.OH58.Smk_Grenade_White={4,5,9,490}
1067
+ ENUMS.Storage.weapons.OH58.Smk_Grenade_Yellow={4,5,9,489}
1068
1068
  ENUMS.Storage.weapons.AH64D.AN_APG78={4,15,44,2138}
1069
1069
  ENUMS.Storage.weapons.AH64D.Internal_Aux_FuelTank={1,3,43,1700}
1070
1070
  ENUMS.FARPType={
@@ -5567,7 +5567,7 @@ LineFrom=DebugInfoFrom.currentline
5567
5567
  end
5568
5568
  env.info(string.format("%6d(%6d)/%1s:%30s%05d.%s(%s)",LineCurrent,LineFrom,"E",self.ClassName,self.ClassID,Function,UTILS.BasicSerialize(Arguments)))
5569
5569
  else
5570
- env.info(string.format("%1s:%30s%05d(%s)","E",self.ClassName,self.ClassID,BASE:_Serialize(Arguments)))
5570
+ env.info(string.format("%1s:%30s%05d(%s)","E",self.ClassName,self.ClassID,UTILS.BasicSerialize(Arguments)))
5571
5571
  end
5572
5572
  end
5573
5573
  function BASE:I(Arguments)
@@ -5585,7 +5585,7 @@ LineFrom=DebugInfoFrom.currentline
5585
5585
  end
5586
5586
  env.info(string.format("%6d(%6d)/%1s:%30s%05d.%s(%s)",LineCurrent,LineFrom,"I",self.ClassName,self.ClassID,Function,UTILS.BasicSerialize(Arguments)))
5587
5587
  else
5588
- env.info(string.format("%1s:%30s%05d(%s)","I",self.ClassName,self.ClassID,BASE:_Serialize(Arguments)))
5588
+ env.info(string.format("%1s:%30s%05d(%s)","I",self.ClassName,self.ClassID,UTILS.BasicSerialize(Arguments)))
5589
5589
  end
5590
5590
  end
5591
5591
  ASTAR={
@@ -7458,6 +7458,7 @@ if not Event.IniUnit then
7458
7458
  Event.IniUnit=CLIENT:FindByName(Event.IniDCSUnitName,'',true)
7459
7459
  end
7460
7460
  Event.IniDCSGroupName=Event.IniUnit and Event.IniUnit.GroupName or""
7461
+ Event.IniGroupName=Event.IniDCSGroupName
7461
7462
  if Event.IniDCSGroup and Event.IniDCSGroup:isExist()then
7462
7463
  Event.IniDCSGroupName=Event.IniDCSGroup:getName()
7463
7464
  Event.IniGroup=GROUP:FindByName(Event.IniDCSGroupName)
@@ -7564,6 +7565,7 @@ end
7564
7565
  elseif Event.TgtObjectCategory==Object.Category.SCENERY then
7565
7566
  Event.TgtDCSUnit=Event.target
7566
7567
  Event.TgtDCSUnitName=Event.TgtDCSUnit:getName()
7568
+ if Event.TgtDCSUnitName==nil then return end
7567
7569
  Event.TgtUnitName=Event.TgtDCSUnitName
7568
7570
  Event.TgtUnit=SCENERY:Register(Event.TgtDCSUnitName,Event.target)
7569
7571
  Event.TgtCategory=Event.TgtDCSUnit:getDesc().category
@@ -18505,15 +18507,15 @@ Briefing="Briefing Report",
18505
18507
  Overview="Overview Report",
18506
18508
  Detailed="Detailed Report",
18507
18509
  }
18508
- function MESSAGE:New(MessageText,MessageDuration,MessageCategory,ClearScreen)
18510
+ function MESSAGE:New(Text,Duration,Category,ClearScreen)
18509
18511
  local self=BASE:Inherit(self,BASE:New())
18510
- self:F({MessageText,MessageDuration,MessageCategory})
18512
+ self:F({Text,Duration,Category})
18511
18513
  self.MessageType=nil
18512
- if MessageCategory and MessageCategory~=""then
18513
- if MessageCategory:sub(-1)~="\n"then
18514
- self.MessageCategory=MessageCategory..": "
18514
+ if Category and Category~=""then
18515
+ if Category:sub(-1)~="\n"then
18516
+ self.MessageCategory=Category..": "
18515
18517
  else
18516
- self.MessageCategory=MessageCategory:sub(1,-2)..":\n"
18518
+ self.MessageCategory=Category:sub(1,-2)..":\n"
18517
18519
  end
18518
18520
  else
18519
18521
  self.MessageCategory=""
@@ -18522,9 +18524,9 @@ self.ClearScreen=false
18522
18524
  if ClearScreen~=nil then
18523
18525
  self.ClearScreen=ClearScreen
18524
18526
  end
18525
- self.MessageDuration=MessageDuration or 5
18527
+ self.MessageDuration=Duration or 5
18526
18528
  self.MessageTime=timer.getTime()
18527
- self.MessageText=MessageText:gsub("^\n","",1):gsub("\n$","",1)
18529
+ self.MessageText=Text:gsub("^\n","",1):gsub("\n$","",1)
18528
18530
  self.MessageSent=false
18529
18531
  self.MessageGroup=false
18530
18532
  self.MessageCoalition=false
@@ -23577,7 +23579,7 @@ power=Power or 10,
23577
23579
  },
23578
23580
  }
23579
23581
  if Delay and Delay>0 then
23580
- SCHEDULER:New(nil,self.CommandSetFrequency,{self,Frequency,Modulation,Power})
23582
+ SCHEDULER:New(nil,self.CommandSetFrequency,{self,Frequency,Modulation,Power},Delay)
23581
23583
  else
23582
23584
  self:SetCommand(CommandSetFrequency)
23583
23585
  end
@@ -23594,7 +23596,7 @@ power=Power or 10,
23594
23596
  },
23595
23597
  }
23596
23598
  if Delay and Delay>0 then
23597
- SCHEDULER:New(nil,self.CommandSetFrequencyForUnit,{self,Frequency,Modulation,Power,UnitID})
23599
+ SCHEDULER:New(nil,self.CommandSetFrequencyForUnit,{self,Frequency,Modulation,Power,UnitID},Delay)
23598
23600
  else
23599
23601
  self:SetCommand(CommandSetFrequencyForUnit)
23600
23602
  end
@@ -24644,7 +24646,7 @@ self:F2(self.ControllableName)
24644
24646
  local DCSControllable=self:GetDCSObject()
24645
24647
  if DCSControllable then
24646
24648
  local DetectionVisual=(DetectVisual and DetectVisual==true)and Controller.Detection.VISUAL or nil
24647
- local DetectionOptical=(DetectOptical and DetectOptical==true)and Controller.Detection.OPTICAL or nil
24649
+ local DetectionOptical=(DetectOptical and DetectOptical==true)and Controller.Detection.OPTIC or nil
24648
24650
  local DetectionRadar=(DetectRadar and DetectRadar==true)and Controller.Detection.RADAR or nil
24649
24651
  local DetectionIRST=(DetectIRST and DetectIRST==true)and Controller.Detection.IRST or nil
24650
24652
  local DetectionRWR=(DetectRWR and DetectRWR==true)and Controller.Detection.RWR or nil
@@ -24678,15 +24680,15 @@ self:F2(self.ControllableName)
24678
24680
  local DCSControllable=self:GetDCSObject()
24679
24681
  if DCSControllable then
24680
24682
  local DetectionVisual=(DetectVisual and DetectVisual==true)and Controller.Detection.VISUAL or nil
24681
- local DetectionOptical=(DetectOptical and DetectOptical==true)and Controller.Detection.OPTICAL or nil
24683
+ local DetectionOptical=(DetectOptical and DetectOptical==true)and Controller.Detection.OPTIC or nil
24682
24684
  local DetectionRadar=(DetectRadar and DetectRadar==true)and Controller.Detection.RADAR or nil
24683
24685
  local DetectionIRST=(DetectIRST and DetectIRST==true)and Controller.Detection.IRST or nil
24684
24686
  local DetectionRWR=(DetectRWR and DetectRWR==true)and Controller.Detection.RWR or nil
24685
24687
  local DetectionDLINK=(DetectDLINK and DetectDLINK==true)and Controller.Detection.DLINK or nil
24686
24688
  local Controller=self:_GetController()
24687
- local TargetIsDetected,TargetIsVisible,TargetLastTime,TargetKnowType,TargetKnowDistance,TargetLastPos,TargetLastVelocity
24689
+ local TargetIsDetected,TargetIsVisible,TargetKnowType,TargetKnowDistance,TargetLastTime,TargetLastPos,TargetLastVelocity
24688
24690
  =Controller:isTargetDetected(DCSObject,DetectionVisual,DetectionOptical,DetectionRadar,DetectionIRST,DetectionRWR,DetectionDLINK)
24689
- return TargetIsDetected,TargetIsVisible,TargetLastTime,TargetKnowType,TargetKnowDistance,TargetLastPos,TargetLastVelocity
24691
+ return TargetIsDetected,TargetIsVisible,TargetKnowType,TargetKnowDistance,TargetLastTime,TargetLastPos,TargetLastVelocity
24690
24692
  end
24691
24693
  return nil
24692
24694
  end
@@ -26459,18 +26461,11 @@ end
26459
26461
  return GroupsFound
26460
26462
  end
26461
26463
  function GROUP:GetDCSObject()
26462
- if(not self.LastCallDCSObject)or(self.LastCallDCSObject and timer.getTime()-self.LastCallDCSObject>1)then
26463
26464
  local DCSGroup=Group.getByName(self.GroupName)
26464
26465
  if DCSGroup then
26465
26466
  self.LastCallDCSObject=timer.getTime()
26466
26467
  self.DCSObject=DCSGroup
26467
26468
  return DCSGroup
26468
- else
26469
- self.DCSObject=nil
26470
- self.LastCallDCSObject=nil
26471
- end
26472
- else
26473
- return self.DCSObject
26474
26469
  end
26475
26470
  return nil
26476
26471
  end
@@ -26513,7 +26508,7 @@ function GROUP:Destroy(GenerateEvent,delay)
26513
26508
  if delay and delay>0 then
26514
26509
  self:ScheduleOnce(delay,GROUP.Destroy,self,GenerateEvent)
26515
26510
  else
26516
- local DCSGroup=self:GetDCSObject()
26511
+ local DCSGroup=Group.getByName(self.GroupName)
26517
26512
  if DCSGroup then
26518
26513
  for Index,UnitData in pairs(DCSGroup:getUnits())do
26519
26514
  if GenerateEvent and GenerateEvent==true then
@@ -27497,7 +27492,11 @@ function GROUP:GetTaskMission()
27497
27492
  return UTILS.DeepCopy(_DATABASE.Templates.Groups[self.GroupName].Template)
27498
27493
  end
27499
27494
  function GROUP:GetTaskRoute()
27495
+ if _DATABASE.Templates.Groups[self.GroupName].Template and _DATABASE.Templates.Groups[self.GroupName].Template.route and _DATABASE.Templates.Groups[self.GroupName].Template.route.points then
27500
27496
  return UTILS.DeepCopy(_DATABASE.Templates.Groups[self.GroupName].Template.route.points)
27497
+ else
27498
+ return{}
27499
+ end
27501
27500
  end
27502
27501
  function GROUP:CopyRoute(Begin,End,Randomize,Radius)
27503
27502
  local Points={}
@@ -27984,7 +27983,7 @@ function UNIT:Name()
27984
27983
  return self.UnitName
27985
27984
  end
27986
27985
  function UNIT:GetDCSObject()
27987
- if(not self.LastCallDCSObject)or(self.LastCallDCSObject and timer.getTime()-self.LastCallDCSObject>1)then
27986
+ if(not self.LastCallDCSObject)or(self.LastCallDCSObject and timer.getTime()-self.LastCallDCSObject>1)or(self.DCSObject==nil)or(self.DCSObject:isExist()==false)then
27988
27987
  local DCSUnit=Unit.getByName(self.UnitName)
27989
27988
  if DCSUnit then
27990
27989
  self.LastCallDCSObject=timer.getTime()
@@ -29316,6 +29315,9 @@ AIRBASE.Normandy={
29316
29315
  ["Villacoublay"]="Villacoublay",
29317
29316
  ["Vrigny"]="Vrigny",
29318
29317
  ["West_Malling"]="West Malling",
29318
+ ["Eastchurch"]="Eastchurch",
29319
+ ["Headcorn"]="Headcorn",
29320
+ ["Hawkinge"]="Hawkinge",
29319
29321
  }
29320
29322
  AIRBASE.PersianGulf={
29321
29323
  ["Abu_Dhabi_Intl"]="Abu Dhabi Intl",
@@ -29430,6 +29432,10 @@ AIRBASE.Syria={
29430
29432
  ["Tha_lah"]="Tha'lah",
29431
29433
  ["Tiyas"]="Tiyas",
29432
29434
  ["Wujah_Al_Hajar"]="Wujah Al Hajar",
29435
+ ["Ben_Gurion"]="Ben Gurion",
29436
+ ["Hatzor"]="Hatzor",
29437
+ ["Palmashim"]="Palmashim",
29438
+ ["Tel_Nof"]="Tel Nof",
29433
29439
  }
29434
29440
  AIRBASE.MarianaIslands={
29435
29441
  ["Andersen_AFB"]="Andersen AFB",
@@ -29536,6 +29542,8 @@ AIRBASE.Kola={
29536
29542
  ["Severomorsk_3"]="Severomorsk-3",
29537
29543
  ["Vidsel"]="Vidsel",
29538
29544
  ["Vuojarvi"]="Vuojarvi",
29545
+ ["Andoya"]="Andoya",
29546
+ ["Alakourtti"]="Alakourtti",
29539
29547
  }
29540
29548
  AIRBASE.Afghanistan={
29541
29549
  ["Bost"]="Bost",
@@ -31230,7 +31238,7 @@ end
31230
31238
  do
31231
31239
  NET={
31232
31240
  ClassName="NET",
31233
- Version="0.1.3",
31241
+ Version="0.1.4",
31234
31242
  BlockTime=600,
31235
31243
  BlockedPilots={},
31236
31244
  BlockedUCIDs={},
@@ -31248,6 +31256,9 @@ self.BlockedPilots={}
31248
31256
  self.KnownPilots={}
31249
31257
  self:SetBlockMessage()
31250
31258
  self:SetUnblockMessage()
31259
+ self.BlockedSides={}
31260
+ self.BlockedSides[1]=false
31261
+ self.BlockedSides[2]=false
31251
31262
  self:SetStartState("Stopped")
31252
31263
  self:AddTransition("Stopped","Run","Running")
31253
31264
  self:AddTransition("*","PlayerJoined","*")
@@ -31263,23 +31274,26 @@ self:Run()
31263
31274
  return self
31264
31275
  end
31265
31276
  function NET:IsAnyBlocked(UCID,Name,PlayerID,PlayerSide,PlayerSlot)
31277
+ self:T({UCID,Name,PlayerID,PlayerSide,PlayerSlot})
31266
31278
  local blocked=false
31267
31279
  local TNow=timer.getTime()
31268
31280
  if UCID and self.BlockedUCIDs[UCID]and TNow<self.BlockedUCIDs[UCID]then
31269
- return true
31281
+ blocked=true
31270
31282
  end
31271
31283
  if PlayerID and not Name then
31272
31284
  Name=self:GetPlayerIDByName(Name)
31273
31285
  end
31274
31286
  if Name and self.BlockedPilots[Name]and TNow<self.BlockedPilots[Name]then
31275
- return true
31287
+ blocked=true
31276
31288
  end
31277
- if PlayerSide and self.BlockedSides[PlayerSide]and TNow<self.BlockedSides[PlayerSide]then
31278
- return true
31289
+ self:T({time=self.BlockedSides[PlayerSide]})
31290
+ if PlayerSide and type(self.BlockedSides[PlayerSide])=="number"and TNow<self.BlockedSides[PlayerSide]then
31291
+ blocked=true
31279
31292
  end
31280
31293
  if PlayerSlot and self.BlockedSlots[PlayerSlot]and TNow<self.BlockedSlots[PlayerSlot]then
31281
- return true
31294
+ blocked=true
31282
31295
  end
31296
+ self:T("IsAnyBlocked: "..tostring(blocked))
31283
31297
  return blocked
31284
31298
  end
31285
31299
  function NET:_EventHandler(EventData)
@@ -31291,13 +31305,22 @@ local name=data.IniPlayerName and data.IniPlayerName or data.IniUnit:GetPlayerNa
31291
31305
  local ucid=self:GetPlayerUCID(nil,name)or"none"
31292
31306
  local PlayerID=self:GetPlayerIDByName(name)or"none"
31293
31307
  local PlayerSide,PlayerSlot=self:GetSlot(data.IniUnit)
31308
+ if not PlayerSide then PlayerSide=EventData.IniCoalition end
31309
+ if not PlayerSlot then PlayerSlot=EventData.IniUnit:GetID()end
31294
31310
  local TNow=timer.getTime()
31295
- self:T(self.lid.."Event for: "..name.." | UCID: "..ucid)
31311
+ self:T(self.lid.."Event for: "..name.." | UCID: "..ucid.." | ID/SIDE/SLOT "..PlayerID.."/"..PlayerSide.."/"..PlayerSlot)
31296
31312
  if data.id==EVENTS.PlayerEnterUnit or data.id==EVENTS.PlayerEnterAircraft then
31297
31313
  self:T(self.lid.."Pilot Joining: "..name.." | UCID: "..ucid.." | Event ID: "..data.id)
31298
31314
  local blocked=self:IsAnyBlocked(ucid,name,PlayerID,PlayerSide,PlayerSlot)
31299
- if blocked and PlayerID and tonumber(PlayerID)~=1 then
31300
- local outcome=net.force_player_slot(tonumber(PlayerID),0,'')
31315
+ if blocked and PlayerID then
31316
+ self:T("Player blocked")
31317
+ local outcome=net.force_player_slot(tonumber(PlayerID),PlayerSide,data.IniUnit:GetID())
31318
+ self:T({Blocked_worked=outcome})
31319
+ if outcome==false then
31320
+ local unit=data.IniUnit
31321
+ local sched=TIMER:New(unit.Destroy,unit,3):Start(3)
31322
+ self:__PlayerBlocked(5,unit,name,1)
31323
+ end
31301
31324
  else
31302
31325
  local client=CLIENT:FindByPlayerName(name)or data.IniUnit
31303
31326
  if not self.KnownPilots[name]or(self.KnownPilots[name]and TNow-self.KnownPilots[name].timestamp>3)then
@@ -31394,7 +31417,6 @@ self.BlockedUCIDs[ucid]=nil
31394
31417
  return self
31395
31418
  end
31396
31419
  function NET:BlockSide(Side,Seconds)
31397
- self:T({Side,Seconds})
31398
31420
  local addon=Seconds or self.BlockTime
31399
31421
  if Side==1 or Side==2 then
31400
31422
  self.BlockedSides[Side]=timer.getTime()+addon
@@ -31402,10 +31424,9 @@ end
31402
31424
  return self
31403
31425
  end
31404
31426
  function NET:UnblockSide(Side,Seconds)
31405
- self:T({Side,Seconds})
31406
31427
  local addon=Seconds or self.BlockTime
31407
31428
  if Side==1 or Side==2 then
31408
- self.BlockedSides[Side]=nil
31429
+ self.BlockedSides[Side]=false
31409
31430
  end
31410
31431
  return self
31411
31432
  end
@@ -31472,8 +31493,11 @@ end
31472
31493
  return nil
31473
31494
  end
31474
31495
  function NET:GetPlayerIDFromClient(Client)
31496
+ self:T("GetPlayerIDFromClient")
31497
+ self:T({Client=Client})
31475
31498
  if Client then
31476
31499
  local name=Client:GetPlayerName()
31500
+ self:T({name=name})
31477
31501
  local id=self:GetPlayerIDByName(name)
31478
31502
  return id
31479
31503
  else
@@ -31558,9 +31582,12 @@ return nil
31558
31582
  end
31559
31583
  end
31560
31584
  function NET:GetSlot(Client)
31585
+ self:T("NET.GetSlot")
31561
31586
  local PlayerID=self:GetPlayerIDFromClient(Client)
31587
+ self:T("NET.GetSlot PlayerID = "..tostring(PlayerID))
31562
31588
  if PlayerID then
31563
31589
  local side,slot=net.get_slot(tonumber(PlayerID))
31590
+ self:T("NET.GetSlot side, slot = "..tostring(side)..","..tostring(slot))
31564
31591
  return side,slot
31565
31592
  else
31566
31593
  return nil,nil
@@ -31568,14 +31595,16 @@ end
31568
31595
  end
31569
31596
  function NET:ForceSlot(Client,SideID,SlotID)
31570
31597
  local PlayerID=self:GetPlayerIDFromClient(Client)
31571
- if PlayerID and tonumber(PlayerID)~=1 then
31572
- return net.force_player_slot(tonumber(PlayerID),SideID,SlotID or'')
31598
+ local SlotID=SlotID or Client:GetID()
31599
+ if PlayerID then
31600
+ return net.force_player_slot(tonumber(PlayerID),SideID,SlotID)
31573
31601
  else
31574
31602
  return false
31575
31603
  end
31576
31604
  end
31577
31605
  function NET:ReturnToSpectators(Client)
31578
31606
  local outcome=self:ForceSlot(Client,0)
31607
+ local sched=TIMER:New(Client.Destroy,Client,1):Start(1)
31579
31608
  return outcome
31580
31609
  end
31581
31610
  function NET.Lua2Json(Lua)
@@ -31607,7 +31636,7 @@ self:T({From,Event,To})
31607
31636
  local function HouseHold(tavolo)
31608
31637
  local TNow=timer.getTime()
31609
31638
  for _,entry in pairs(tavolo)do
31610
- if entry>=TNow then entry=nil end
31639
+ if type(entry)=="number"and entry>=TNow then entry=false end
31611
31640
  end
31612
31641
  end
31613
31642
  HouseHold(self.BlockedPilots)
@@ -36613,19 +36642,21 @@ NotInRunwayZone=(Client:IsNotInZone(_runwaydata.zone)==true)and NotInRunwayZone
36613
36642
  end
36614
36643
  end
36615
36644
  if NotInRunwayZone then
36616
- if IsOnGround then
36617
36645
  local Taxi=Client:GetState(self,"Taxi")
36646
+ if IsOnGround then
36618
36647
  self:T(Taxi)
36619
36648
  if Taxi==false then
36620
36649
  local Velocity=VELOCITY:New(AirbaseMeta.KickSpeed or self.KickSpeed)
36621
36650
  Client:Message("Welcome to "..AirbaseID..". The maximum taxiing speed is "..
36622
36651
  Velocity:ToString(),20,"ATC")
36623
36652
  Client:SetState(self,"Taxi",true)
36653
+ Client:SetState(self,"Speeding",false)
36654
+ Client:SetState(self,"Warnings",0)
36624
36655
  end
36625
36656
  local Velocity=VELOCITY_POSITIONABLE:New(Client)
36626
36657
  local IsAboveRunway=Client:IsAboveRunway()
36627
36658
  self:T({IsAboveRunway,IsOnGround,Velocity:Get()})
36628
- if IsOnGround then
36659
+ if IsOnGround and not Taxi then
36629
36660
  local Speeding=false
36630
36661
  if AirbaseMeta.MaximumKickSpeed then
36631
36662
  if Velocity:Get()>AirbaseMeta.MaximumKickSpeed then
@@ -36637,11 +36668,11 @@ Speeding=true
36637
36668
  end
36638
36669
  end
36639
36670
  if Speeding==true then
36640
- MESSAGE:New("Penalty! Player "..Client:GetPlayerName()..
36641
- " has been kicked, due to a severe airbase traffic rule violation ...",10,"ATC"):ToAll()
36642
- Client:Destroy()
36643
- Client:SetState(self,"Speeding",false)
36644
- Client:SetState(self,"Warnings",0)
36671
+ Client:SetState(self,"Speeding",true)
36672
+ local SpeedingWarnings=Client:GetState(self,"Warnings")
36673
+ Client:SetState(self,"Warnings",SpeedingWarnings+1)
36674
+ Client:Message("Warning "..SpeedingWarnings.."/3! Airbase traffic rule violation! Slow down now! Your speed is "..
36675
+ Velocity:ToString(),5,"ATC")
36645
36676
  end
36646
36677
  end
36647
36678
  if IsOnGround then
@@ -36901,7 +36932,7 @@ end
36901
36932
  for DetectionObjectName,DetectedObjectData in pairs(self.DetectedObjects or{})do
36902
36933
  local DetectedObject=DetectedObjectData.Object
36903
36934
  if DetectedObject:isExist()then
36904
- local TargetIsDetected,TargetIsVisible,TargetLastTime,TargetKnowType,TargetKnowDistance,TargetLastPos,TargetLastVelocity=DetectionUnit:IsTargetDetected(
36935
+ local TargetIsDetected,TargetIsVisible,TargetKnowType,TargetKnowDistance,TargetLastTime,TargetLastPos,TargetLastVelocity=DetectionUnit:IsTargetDetected(
36905
36936
  DetectedObject,
36906
36937
  self.DetectVisual,
36907
36938
  self.DetectOptical,
@@ -53684,7 +53715,7 @@ MANTISAwacs:Start()
53684
53715
  return MANTISAwacs
53685
53716
  end
53686
53717
  function MANTIS:_GetSAMDataFromUnits(grpname,mod,sma,chm)
53687
- self:T(self.lid.."_GetSAMRangeFromUnits")
53718
+ self:T(self.lid.."_GetSAMDataFromUnits")
53688
53719
  local found=false
53689
53720
  local range=self.checkradius
53690
53721
  local height=3000
@@ -53725,7 +53756,7 @@ end
53725
53756
  return range,height,type,blind
53726
53757
  end
53727
53758
  function MANTIS:_GetSAMRange(grpname)
53728
- self:T(self.lid.."_GetSAMRange")
53759
+ self:T(self.lid.."_GetSAMRange for "..tostring(grpname))
53729
53760
  local range=self.checkradius
53730
53761
  local height=3000
53731
53762
  local type=MANTIS.SamType.MEDIUM
@@ -53742,8 +53773,8 @@ SMAMod=true
53742
53773
  elseif string.find(grpname,"CHM",1,true)then
53743
53774
  CHMod=true
53744
53775
  end
53745
- if self.automode then
53746
53776
  for idx,entry in pairs(self.SamData)do
53777
+ self:T("ID = "..idx)
53747
53778
  if string.find(grpname,idx,1,true)then
53748
53779
  local _entry=entry
53749
53780
  type=_entry.Type
@@ -53751,12 +53782,12 @@ radiusscale=self.radiusscale[type]
53751
53782
  range=_entry.Range*1000*radiusscale
53752
53783
  height=_entry.Height*1000
53753
53784
  blind=_entry.Blindspot
53785
+ self:T("Matching Groupname = "..grpname.." Range= "..range)
53754
53786
  found=true
53755
53787
  break
53756
53788
  end
53757
53789
  end
53758
- end
53759
- if(not found and self.automode)or HDSmod or SMAMod or CHMod then
53790
+ if(not found)or HDSmod or SMAMod or CHMod then
53760
53791
  range,height,type=self:_GetSAMDataFromUnits(grpname,HDSmod,SMAMod,CHMod)
53761
53792
  elseif not found then
53762
53793
  self:E(self.lid..string.format("*****Could not match radar data for %s! Will default to midrange values!",grpname))
@@ -67004,7 +67035,7 @@ CTLD.UnitTypeCapabilities={
67004
67035
  ["OH58D"]={type="OH58D",crates=false,troops=false,cratelimit=0,trooplimit=0,length=14,cargoweightlimit=400},
67005
67036
  ["CH-47Fbl1"]={type="CH-47Fbl1",crates=true,troops=true,cratelimit=4,trooplimit=31,length=20,cargoweightlimit=10800},
67006
67037
  }
67007
- CTLD.version="1.1.17"
67038
+ CTLD.version="1.1.18"
67008
67039
  function CTLD:New(Coalition,Prefixes,Alias)
67009
67040
  local self=BASE:Inherit(self,FSM:New())
67010
67041
  BASE:T({Coalition,Prefixes,Alias})
@@ -67570,6 +67601,7 @@ local unitcoord=unit:GetCoordinate()
67570
67601
  local nearestGroup=nil
67571
67602
  local nearestGroupIndex=-1
67572
67603
  local nearestDistance=10000000
67604
+ local maxdistance=0
67573
67605
  local nearestList={}
67574
67606
  local distancekeys={}
67575
67607
  local extractdistance=self.CrateDistance*self.ExtractFactor
@@ -67581,6 +67613,11 @@ if distance<=extractdistance and distance~=-1 and(TNow-vtime>300)then
67581
67613
  nearestGroup=v
67582
67614
  nearestGroupIndex=k
67583
67615
  nearestDistance=distance
67616
+ if math.floor(distance)>maxdistance then maxdistance=math.floor(distance)end
67617
+ if nearestList[math.floor(distance)]then
67618
+ distance=maxdistance+1
67619
+ maxdistance=distance
67620
+ end
67584
67621
  table.insert(nearestList,math.floor(distance),v)
67585
67622
  distancekeys[#distancekeys+1]=math.floor(distance)
67586
67623
  end
@@ -67626,7 +67663,7 @@ self.CargoCounter=self.CargoCounter+1
67626
67663
  nearestGroup.ExtractTime=timer.getTime()
67627
67664
  local loadcargotype=CTLD_CARGO:New(self.CargoCounter,Cargotype.Name,Cargotype.Templates,Cargotype.CargoType,true,true,Cargotype.CratesNeeded,nil,nil,Cargotype.PerCrateMass)
67628
67665
  self:T({cargotype=loadcargotype})
67629
- local running=math.floor(nearestDistance/4)+10
67666
+ local running=math.floor(nearestDistance/4)+20
67630
67667
  loaded.Troopsloaded=loaded.Troopsloaded+troopsize
67631
67668
  table.insert(loaded.Cargo,loadcargotype)
67632
67669
  self.Loaded_Cargo[unitname]=loaded
@@ -67641,18 +67678,22 @@ local heading=unit:GetHeading()or 0
67641
67678
  local Angle=math.floor((heading+160)%360)
67642
67679
  Point=coord:Translate(8,Angle):GetVec2()
67643
67680
  if Point then
67644
- nearestGroup:RouteToVec2(Point,4)
67681
+ nearestGroup:RouteToVec2(Point,5)
67645
67682
  end
67646
67683
  end
67684
+ local hassecondaries=false
67647
67685
  if type(Cargotype.Templates)=="table"and Cargotype.Templates[2]then
67648
67686
  for _,_key in pairs(Cargotype.Templates)do
67649
67687
  table.insert(secondarygroups,_key)
67688
+ hassecondaries=true
67650
67689
  end
67651
67690
  end
67652
- nearestGroup:Destroy(false,running)
67691
+ local destroytimer=math.random(10,20)
67692
+ nearestGroup:Destroy(false,destroytimer)
67653
67693
  end
67654
67694
  end
67655
67695
  end
67696
+ if hassecondaries==true then
67656
67697
  for _,_name in pairs(secondarygroups)do
67657
67698
  for _,_group in pairs(nearestList)do
67658
67699
  if _group and _group:IsAlive()then
@@ -67663,6 +67704,7 @@ end
67663
67704
  end
67664
67705
  end
67665
67706
  end
67707
+ end
67666
67708
  self:CleanDroppedTroops()
67667
67709
  return self
67668
67710
  end
@@ -68344,8 +68386,8 @@ function CTLD:_GetUnitPositions(Coordinate,Radius,Heading,Template)
68344
68386
  local Positions={}
68345
68387
  local template=_DATABASE:GetGroupTemplate(Template)
68346
68388
  local numbertroops=#template.units
68347
- local slightshift=math.abs(math.random(0,200)/100)
68348
- local newcenter=Coordinate:Translate(Radius+slightshift,((Heading+270)%360))
68389
+ local slightshift=math.abs(math.random(1,500)/100)
68390
+ local newcenter=Coordinate:Translate(Radius+slightshift,((Heading+270+math.random(1,10))%360))
68349
68391
  for i=1,360,math.floor(360/numbertroops)do
68350
68392
  local phead=((Heading+270+i)%360)
68351
68393
  local post=newcenter:Translate(Radius,phead)
@@ -83711,7 +83753,7 @@ timer.scheduleFunction(os.remove,filename,timer.getTime()+1)
83711
83753
  timer.scheduleFunction(os.remove,filenvbs,timer.getTime()+1)
83712
83754
  self:T("MSRS vbs and batch file removed")
83713
83755
  elseif self.UsePowerShell==true then
83714
- local pwsh=string.format('powershell.exe -ExecutionPolicy Unrestricted -WindowStyle Hidden -Command "%s"',filename)
83756
+ local pwsh=string.format('start /min "" powershell.exe -ExecutionPolicy Unrestricted -WindowStyle Hidden -Command "%s"',filename)
83715
83757
  if string.len(pwsh)>255 then
83716
83758
  self:E("[MSRS] - pwsh string too long")
83717
83759
  end
@@ -40,7 +40,7 @@ spencershepard (GRIMM):
40
40
 
41
41
  splash_damage_options = {
42
42
  ["static_damage_boost"] = 2000, --apply extra damage to Unit.Category.STRUCTUREs with wave explosions
43
- ["wave_explosions"] = true, --secondary explosions on top of game objects, radiating outward from the impact point and scaled based on size of object and distance from weapon impact point
43
+ ["wave_explosions"] = false, --secondary explosions on top of game objects, radiating outward from the impact point and scaled based on size of object and distance from weapon impact point
44
44
  ["larger_explosions"] = true, --secondary explosions on top of weapon impact points, dictated by the values in the explTable
45
45
  ["damage_model"] = false, --allow blast wave to affect ground unit movement and weapons
46
46
  ["blast_search_radius"] = 100, --this is the max size of any blast wave radius, since we will only find objects within this zone
@@ -1164,6 +1164,13 @@ for index, airbossconfig in ipairs(AirBossConfig) do
1164
1164
  launchDeck1SpawnLayout,
1165
1165
  objAirboss
1166
1166
  )
1167
+ MENU_COALITION_COMMAND:New(
1168
+ airbossconfig.coalition,
1169
+ "DeckLayout : Wipe All",
1170
+ objAirboss.deckLayoutmenuObject,
1171
+ wipeDeckLayout,
1172
+ objAirboss
1173
+ )
1167
1174
  end
1168
1175
  if (airbossconfig.recoveryops.mode == 'ondemand') then
1169
1176
  MENU_COALITION_COMMAND:New(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jtff/miztemplate-lib",
3
- "version": "3.5.2",
3
+ "version": "3.5.4",
4
4
  "description": "JTFF mission template library",
5
5
  "main": "index.js",
6
6
  "files": [