@jtff/miztemplate-lib 3.8.13 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- env.info('*** MOOSE GITHUB Commit Hash ID: 2025-08-14T17:17:34+02:00-b9cf1e46afcee679aa09b480d3451864da72a5e3 ***')
1
+ env.info('*** MOOSE GITHUB Commit Hash ID: 2025-09-24T19:16:14+02:00-b5524b9a69fec49c33cd0e623bf6874ef56fd370 ***')
2
2
  if not MOOSE_DEVELOPMENT_FOLDER then
3
3
  MOOSE_DEVELOPMENT_FOLDER='Scripts'
4
4
  end
@@ -2189,7 +2189,7 @@ local delta=UTILS.VecAngle(v1,v2)
2189
2189
  return math.abs(delta)
2190
2190
  end
2191
2191
  function UTILS.HdgTo(a,b)
2192
- local dz=b.z-a.z
2192
+ local dz=(b.z or b.y)-(a.z or a.y)
2193
2193
  local dx=b.x-a.x
2194
2194
  local heading=math.deg(math.atan2(dz,dx))
2195
2195
  if heading<0 then
@@ -4288,6 +4288,135 @@ qx=qx+shift_factor*norm_dx
4288
4288
  qy=qy+shift_factor*norm_dy
4289
4289
  return{x=qx,y=qy}
4290
4290
  end
4291
+ function UTILS.ValidateAndRepositionGroundUnits(Positions,Anchor,MaxRadius,Spacing)
4292
+ local units=Positions
4293
+ Anchor=Anchor or UTILS.GetCenterPoint(units)
4294
+ local gPos={x=Anchor.x,y=Anchor.z or Anchor.y}
4295
+ local maxRadius=0
4296
+ local unitCount=0
4297
+ for _,unit in pairs(units)do
4298
+ local pos={x=unit.x,y=unit.z or unit.y}
4299
+ local dist=UTILS.VecDist2D(pos,gPos)
4300
+ if dist>maxRadius then
4301
+ maxRadius=dist
4302
+ end
4303
+ unitCount=unitCount+1
4304
+ end
4305
+ maxRadius=MaxRadius or math.max(maxRadius*2,10)
4306
+ local spacing=Spacing or math.max(maxRadius*0.05,5)
4307
+ if unitCount>0 and maxRadius>5 then
4308
+ local spots=UTILS.GetSimpleZones(UTILS.Vec2toVec3(gPos),maxRadius,spacing,1000)
4309
+ if spots and#spots>0 then
4310
+ local validSpots={}
4311
+ for _,spot in pairs(spots)do
4312
+ if land.getSurfaceType(spot)==land.SurfaceType.LAND then
4313
+ table.insert(validSpots,spot)
4314
+ end
4315
+ end
4316
+ spots=validSpots
4317
+ end
4318
+ local step=spacing
4319
+ for _,unit in pairs(units)do
4320
+ local pos={x=unit.x,y=unit.z or unit.y}
4321
+ local isOnLand=land.getSurfaceType(pos)==land.SurfaceType.LAND
4322
+ local isValid=false
4323
+ if spots and#spots>0 then
4324
+ local si=1
4325
+ local sid=0
4326
+ local closestDist=100000000
4327
+ local closestSpot
4328
+ for _,spot in pairs(spots)do
4329
+ local dist=UTILS.VecDist2D(pos,spot)
4330
+ if dist<closestDist then
4331
+ closestDist=dist
4332
+ closestSpot=spot
4333
+ sid=si
4334
+ end
4335
+ si=si+1
4336
+ end
4337
+ if closestSpot then
4338
+ if closestDist>=spacing then
4339
+ pos=closestSpot
4340
+ end
4341
+ isValid=true
4342
+ table.remove(spots,sid)
4343
+ end
4344
+ end
4345
+ if not isValid and not isOnLand then
4346
+ local h=UTILS.HdgTo(pos,gPos)
4347
+ local retries=0
4348
+ while not isValid and retries<500 do
4349
+ local dist=UTILS.VecDist2D(pos,gPos)
4350
+ pos=UTILS.Vec2Translate(pos,step,h)
4351
+ local skip=false
4352
+ for _,unit2 in pairs(units)do
4353
+ if unit~=unit2 then
4354
+ local pos2={x=unit2.x,y=unit2.z or unit2.y}
4355
+ local dist2=UTILS.VecDist2D(pos,pos2)
4356
+ if dist2<12 then
4357
+ isValid=false
4358
+ skip=true
4359
+ break
4360
+ end
4361
+ end
4362
+ end
4363
+ if not skip and dist>step and land.getSurfaceType(pos)==land.SurfaceType.LAND then
4364
+ isValid=true
4365
+ break
4366
+ elseif dist<=step then
4367
+ break
4368
+ end
4369
+ retries=retries+1
4370
+ end
4371
+ end
4372
+ if isValid then
4373
+ unit.x=pos.x
4374
+ if unit.z then
4375
+ unit.z=pos.y
4376
+ else
4377
+ unit.y=pos.y
4378
+ end
4379
+ end
4380
+ end
4381
+ end
4382
+ end
4383
+ function UTILS.ValidateAndRepositionStatic(Country,Category,Type,Position,ShapeName,MaxRadius)
4384
+ local coord=COORDINATE:NewFromVec2(Position)
4385
+ local st=SPAWNSTATIC:NewFromType(Type,Category,Country)
4386
+ if ShapeName then
4387
+ st:InitShape(ShapeName)
4388
+ end
4389
+ local sName="s-"..timer.getTime().."-"..math.random(1,10000)
4390
+ local tempStatic=st:SpawnFromCoordinate(coord,0,sName)
4391
+ if tempStatic then
4392
+ local sRadius=tempStatic:GetBoundingRadius(2)or 3
4393
+ tempStatic:Destroy()
4394
+ sRadius=sRadius*0.5
4395
+ MaxRadius=MaxRadius or math.max(sRadius*10,100)
4396
+ local positions=UTILS.GetSimpleZones(coord:GetVec3(),MaxRadius,sRadius,20)
4397
+ if positions and#positions>0 then
4398
+ local closestSpot
4399
+ local closestDist=math.huge
4400
+ for _,spot in pairs(positions)do
4401
+ if land.getSurfaceType(spot)==land.SurfaceType.LAND then
4402
+ local dist=UTILS.VecDist2D(Position,spot)
4403
+ if dist<closestDist then
4404
+ closestDist=dist
4405
+ closestSpot=spot
4406
+ end
4407
+ end
4408
+ end
4409
+ if closestSpot then
4410
+ if closestDist>=sRadius then
4411
+ return closestSpot
4412
+ else
4413
+ return Position
4414
+ end
4415
+ end
4416
+ end
4417
+ end
4418
+ return nil
4419
+ end
4291
4420
  PROFILER={
4292
4421
  ClassName="PROFILER",
4293
4422
  Counters={},
@@ -7597,10 +7726,12 @@ if Event.id==EVENTS.LandingAfterEjection then
7597
7726
  else
7598
7727
  if Event.place:isExist()and Object.getCategory(Event.place)~=Object.Category.SCENERY then
7599
7728
  Event.Place=AIRBASE:Find(Event.place)
7729
+ if Event.Place then
7600
7730
  Event.PlaceName=Event.Place:GetName()
7601
7731
  end
7602
7732
  end
7603
7733
  end
7734
+ end
7604
7735
  if Event.idx then
7605
7736
  Event.MarkID=Event.idx
7606
7737
  Event.MarkVec3=Event.pos
@@ -9424,10 +9555,9 @@ radius=ZoneRadius,
9424
9555
  }
9425
9556
  }
9426
9557
  local function EvaluateZone(ZoneObject)
9427
- if ZoneObject then
9558
+ if ZoneObject and self:IsVec3InZone(ZoneObject:getPoint())then
9428
9559
  local ObjectCategory=Object.getCategory(ZoneObject)
9429
9560
  if(ObjectCategory==Object.Category.UNIT and ZoneObject:isExist()and ZoneObject:isActive())or(ObjectCategory==Object.Category.STATIC and ZoneObject:isExist())then
9430
- local CoalitionDCSUnit=ZoneObject:getCoalition()
9431
9561
  local Include=false
9432
9562
  if not UnitCategories then
9433
9563
  Include=true
@@ -10478,10 +10608,9 @@ radius=ZoneRadius,
10478
10608
  }
10479
10609
  }
10480
10610
  local function EvaluateZone(ZoneObject)
10481
- if ZoneObject then
10611
+ if ZoneObject and self:IsVec3InZone(ZoneObject:getPoint())then
10482
10612
  local ObjectCategory=Object.getCategory(ZoneObject)
10483
10613
  if(ObjectCategory==Object.Category.UNIT and ZoneObject:isExist()and ZoneObject:isActive())or(ObjectCategory==Object.Category.STATIC and ZoneObject:isExist())then
10484
- local CoalitionDCSUnit=ZoneObject:getCoalition()
10485
10614
  local Include=false
10486
10615
  if not UnitCategories then
10487
10616
  Include=true
@@ -10500,7 +10629,7 @@ self.ScanData.Coalitions[CoalitionDCSUnit]=true
10500
10629
  self.ScanData.Units[ZoneObject]=ZoneObject
10501
10630
  end
10502
10631
  end
10503
- if ObjectCategory==Object.Category.SCENERY and self:IsVec3InZone(ZoneObject:getPoint())then
10632
+ if ObjectCategory==Object.Category.SCENERY then
10504
10633
  local SceneryType=ZoneObject:getTypeName()
10505
10634
  local SceneryName=ZoneObject:getName()
10506
10635
  self.ScanData.Scenery[SceneryType]=self.ScanData.Scenery[SceneryType]or{}
@@ -19737,6 +19866,12 @@ self.SpawnUnitsWithAbsolutePositions=true
19737
19866
  self.UnitsAbsolutePositions=Positions
19738
19867
  return self
19739
19868
  end
19869
+ function SPAWN:InitValidateAndRepositionGroundUnits(OnOff,MaxRadius,Spacing)
19870
+ self.SpawnValidateAndRepositionGroundUnits=OnOff
19871
+ self.SpawnValidateAndRepositionGroundUnitsRadius=MaxRadius
19872
+ self.SpawnValidateAndRepositionGroundUnitsSpacing=Spacing
19873
+ return self
19874
+ end
19740
19875
  function SPAWN:InitRandomizeTemplate(SpawnTemplatePrefixTable)
19741
19876
  local temptable={}
19742
19877
  for _,_temp in pairs(SpawnTemplatePrefixTable)do
@@ -20106,6 +20241,11 @@ end
20106
20241
  if self.SpawnHiddenOnMap then
20107
20242
  SpawnTemplate.hidden=self.SpawnHiddenOnMap
20108
20243
  end
20244
+ if self.SpawnValidateAndRepositionGroundUnits then
20245
+ local units=SpawnTemplate.units
20246
+ local gPos={x=SpawnTemplate.x,y=SpawnTemplate.y}
20247
+ UTILS.ValidateAndRepositionGroundUnits(units,gPos,self.SpawnValidateAndRepositionGroundUnitsRadius,self.SpawnValidateAndRepositionGroundUnitsSpacing)
20248
+ end
20109
20249
  SpawnTemplate.CategoryID=self.SpawnInitCategory or SpawnTemplate.CategoryID
20110
20250
  SpawnTemplate.CountryID=self.SpawnInitCountry or SpawnTemplate.CountryID
20111
20251
  SpawnTemplate.CoalitionID=self.SpawnInitCoalition or SpawnTemplate.CoalitionID
@@ -21426,6 +21566,11 @@ self.InitOffsetY=OffsetY or 0
21426
21566
  self.InitOffsetAngle=OffsetAngle or 0
21427
21567
  return self
21428
21568
  end
21569
+ function SPAWNSTATIC:InitValidateAndRepositionStatic(OnOff,MaxRadius)
21570
+ self.ValidateAndRepositionStatic=OnOff
21571
+ self.ValidateAndRepositionStaticMaxRadius=MaxRadius
21572
+ return self
21573
+ end
21429
21574
  function SPAWNSTATIC:OnSpawnStatic(SpawnCallBackFunction,...)
21430
21575
  self:F("OnSpawnStatic")
21431
21576
  self.SpawnFunctionHook=SpawnCallBackFunction
@@ -21512,6 +21657,13 @@ end
21512
21657
  self.SpawnIndex=self.SpawnIndex+1
21513
21658
  Template.name=self.InitStaticName or string.format("%s#%05d",self.SpawnTemplatePrefix,self.SpawnIndex)
21514
21659
  local Static=nil
21660
+ if self.ValidateAndRepositionStatic then
21661
+ local validPos=UTILS.ValidateAndRepositionStatic(CountryID,Template.category,Template.type,Template,Template.shape_name,self.ValidateAndRepositionStaticMaxRadius)
21662
+ if validPos then
21663
+ Template.x=validPos.x
21664
+ Template.y=validPos.y
21665
+ end
21666
+ end
21515
21667
  if self.InitFarp then
21516
21668
  local TemplateGroup={}
21517
21669
  TemplateGroup.units={}
@@ -26744,6 +26896,7 @@ GROUND_EWR="Ground_EWR",
26744
26896
  GROUND_AAA="Ground_AAA",
26745
26897
  GROUND_SAM="Ground_SAM",
26746
26898
  GROUND_SHORAD="Ground_SHORAD",
26899
+ GROUND_BALLISTICMISSILE="Ground_BallisticMissile",
26747
26900
  GROUND_OTHER="Ground_OtherGround",
26748
26901
  NAVAL_AIRCRAFTCARRIER="Naval_AircraftCarrier",
26749
26902
  NAVAL_WARSHIP="Naval_WarShip",
@@ -27794,6 +27947,9 @@ if self.InitRespawnModu then
27794
27947
  Template.modulation=self.InitRespawnModu
27795
27948
  end
27796
27949
  self:Destroy(false)
27950
+ if self.ValidateAndRepositionGroundUnits then
27951
+ UTILS.ValidateAndRepositionGroundUnits(Template.units)
27952
+ end
27797
27953
  self:ScheduleOnce(0.1,_DATABASE.Spawn,_DATABASE,Template)
27798
27954
  self:ResetEvents()
27799
27955
  return self
@@ -27998,6 +28154,8 @@ local infantry=self:HasAttribute("Infantry")
27998
28154
  local artillery=self:HasAttribute("Artillery")
27999
28155
  local tank=self:HasAttribute("Old Tanks")or self:HasAttribute("Modern Tanks")or self:HasAttribute("Tanks")
28000
28156
  local aaa=self:HasAttribute("AAA")and(not self:HasAttribute("SAM elements"))
28157
+ local ballisticMissile=artillery and self:HasAttribute("SS_missile")
28158
+ local shorad=self:HasAttribute("SR SAM")
28001
28159
  local ewr=self:HasAttribute("EWR")
28002
28160
  local ifv=self:HasAttribute("IFV")
28003
28161
  local sam=self:HasAttribute("SAM elements")or self:HasAttribute("Optical Tracker")
@@ -28028,6 +28186,8 @@ elseif sam then
28028
28186
  attribute=GROUP.Attribute.GROUND_SAM
28029
28187
  elseif aaa then
28030
28188
  attribute=GROUP.Attribute.GROUND_AAA
28189
+ elseif artillery and ballisticMissile then
28190
+ attribute=GROUP.Attribute.GROUND_BALLISTICMISSILE
28031
28191
  elseif artillery then
28032
28192
  attribute=GROUP.Attribute.GROUND_ARTILLERY
28033
28193
  elseif tank then
@@ -28307,6 +28467,44 @@ end
28307
28467
  end
28308
28468
  return isAAA
28309
28469
  end
28470
+ function GROUP:SetValidateAndRepositionGroundUnits(Enabled)
28471
+ self.ValidateAndRepositionGroundUnits=Enabled
28472
+ end
28473
+ function GROUP:GetBoundingBox()
28474
+ local bbox={min={x=math.huge,y=math.huge,z=math.huge},
28475
+ max={x=-math.huge,y=-math.huge,z=-math.huge}
28476
+ }
28477
+ local Units=self:GetUnits()or{}
28478
+ if#Units==0 then
28479
+ return nil
28480
+ end
28481
+ for _,unit in pairs(Units)do
28482
+ if unit and unit:IsAlive()then
28483
+ local ubox=unit:GetBoundingBox()
28484
+ if ubox then
28485
+ if ubox.min.x<bbox.min.x then
28486
+ bbox.min.x=ubox.min.x
28487
+ end
28488
+ if ubox.min.y<bbox.min.y then
28489
+ bbox.min.y=ubox.min.y
28490
+ end
28491
+ if ubox.min.z<bbox.min.z then
28492
+ bbox.min.z=ubox.min.z
28493
+ end
28494
+ if ubox.max.x>bbox.max.x then
28495
+ bbox.max.x=ubox.max.x
28496
+ end
28497
+ if ubox.max.y>bbox.max.y then
28498
+ bbox.max.y=ubox.max.y
28499
+ end
28500
+ if ubox.max.z>bbox.max.z then
28501
+ bbox.max.z=ubox.max.z
28502
+ end
28503
+ end
28504
+ end
28505
+ end
28506
+ return bbox
28507
+ end
28310
28508
  UNIT={
28311
28509
  ClassName="UNIT",
28312
28510
  UnitName=nil,
@@ -28444,6 +28642,9 @@ i=i+1
28444
28642
  end
28445
28643
  end
28446
28644
  SpawnGroupTemplate.groupId=nil
28645
+ if self.ValidateAndRepositionGroundUnits then
28646
+ UTILS.ValidateAndRepositionGroundUnits(SpawnGroupTemplate.units)
28647
+ end
28447
28648
  _DATABASE:Spawn(SpawnGroupTemplate)
28448
28649
  end
28449
28650
  function UNIT:IsActive()
@@ -29227,6 +29428,9 @@ end
29227
29428
  function UNIT:SetCarrierIlluminationMode(Mode)
29228
29429
  UTILS.SetCarrierIlluminationMode(self:GetID(),Mode)
29229
29430
  end
29431
+ function UNIT:SetValidateAndRepositionGroundUnits(Enabled)
29432
+ self.ValidateAndRepositionGroundUnits=Enabled
29433
+ end
29230
29434
  CLIENT={
29231
29435
  ClassName="CLIENT",
29232
29436
  ClientName=nil,
@@ -29991,6 +30195,7 @@ AIRBASE.Sinai={
29991
30195
  ["Borg_El_Arab_International_Airport"]="Borg El Arab International Airport",
29992
30196
  ["Cairo_International_Airport"]="Cairo International Airport",
29993
30197
  ["Cairo_West"]="Cairo West",
30198
+ ["Damascus_Intl"]="Damascus Intl",
29994
30199
  ["Difarsuwar_Airfield"]="Difarsuwar Airfield",
29995
30200
  ["El_Arish"]="El Arish",
29996
30201
  ["El_Gora"]="El Gora",
@@ -30086,19 +30291,25 @@ AIRBASE.Afghanistan={
30086
30291
  ["Urgoon_Heliport"]="Urgoon Heliport",
30087
30292
  }
30088
30293
  AIRBASE.Iraq={
30089
- ["Baghdad_International_Airport"]="Baghdad International Airport",
30090
- ["Sulaimaniyah_International_Airport"]="Sulaimaniyah International Airport",
30091
- ["Al_Sahra_Airport"]="Al-Sahra Airport",
30092
- ["Erbil_International_Airport"]="Erbil International Airport",
30093
- ["Al_Taji_Airport"]="Al-Taji Airport",
30094
30294
  ["Al_Asad_Airbase"]="Al-Asad Airbase",
30295
+ ["Al_Kut_Airport"]="Al-Kut Airport",
30296
+ ["Al_Sahra_Airport"]="Al-Sahra Airport",
30095
30297
  ["Al_Salam_Airbase"]="Al-Salam Airbase",
30298
+ ["Al_Taji_Airport"]="Al-Taji Airport",
30299
+ ["Al_Taquddum_Airport"]="Al-Taquddum Airport",
30300
+ ["Baghdad_International_Airport"]="Baghdad International Airport",
30096
30301
  ["Balad_Airbase"]="Balad Airbase",
30097
- ["Kirkuk_International_Airport"]="Kirkuk International Airport",
30098
30302
  ["Bashur_Airport"]="Bashur Airport",
30099
- ["Al_Taquddum_Airport"]="Al-Taquddum Airport",
30100
- ["Qayyarah_Airfield_West"]="Qayyarah Airfield West",
30303
+ ["Erbil_International_Airport"]="Erbil International Airport",
30304
+ ["H2_Airbase"]="H-2 Airbase",
30305
+ ["H3_Main_Airbase"]="H-3 Main Airbase",
30306
+ ["H3_Northwest_Airbase"]="H-3 Northwest Airbase",
30307
+ ["H3_Southwest_Airbase"]="H-3 Southwest Airbase",
30101
30308
  ["K1_Base"]="K1 Base",
30309
+ ["Kirkuk_International_Airport"]="Kirkuk International Airport",
30310
+ ["Mosul_International_Airport"]="Mosul International Airport",
30311
+ ["Qayyarah_Airfield_West"]="Qayyarah Airfield West",
30312
+ ["Sulaimaniyah_International_Airport"]="Sulaimaniyah International Airport",
30102
30313
  }
30103
30314
  AIRBASE.GermanyCW={
30104
30315
  ["Airracing_Frankfurt"]="Airracing Frankfurt",
@@ -32780,7 +32991,7 @@ self:SetLiquid(lqno,lqam)
32780
32991
  end
32781
32992
  end
32782
32993
  else
32783
- self:E("File for Liquids could not be found: "..tostring(Path).."\\"..tostring(Filename"_Liquids.csv"))
32994
+ self:E("File for Liquids could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Liquids.csv")
32784
32995
  end
32785
32996
  end
32786
32997
  if self:IsLimitedAircraft()then
@@ -32798,7 +33009,7 @@ self:SetAmount(acname,acnumber)
32798
33009
  end
32799
33010
  end
32800
33011
  else
32801
- self:E("File for Aircraft could not be found: "..tostring(Path).."\\"..tostring(Filename"_Aircraft.csv"))
33012
+ self:E("File for Aircraft could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Aircraft.csv")
32802
33013
  end
32803
33014
  end
32804
33015
  if self:IsLimitedWeapons()then
@@ -32827,7 +33038,7 @@ end
32827
33038
  end
32828
33039
  end
32829
33040
  else
32830
- self:E("File for Weapons could not be found: "..tostring(Path).."\\"..tostring(Filename"_Weapons.csv"))
33041
+ self:E("File for Weapons could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Weapons.csv")
32831
33042
  end
32832
33043
  end
32833
33044
  return self
@@ -50813,6 +51024,9 @@ self:I(self.lid..text)
50813
51024
  self:T({DCSdesc=asset.DCSdesc})
50814
51025
  self:T3({Template=asset.template})
50815
51026
  end
51027
+ function WAREHOUSE:SetValidateAndRepositionGroundUnits(Enabled)
51028
+ self.ValidateAndRepositionGroundUnits=Enabled
51029
+ end
50816
51030
  function WAREHOUSE:onafterNewAsset(From,Event,To,asset,assignment)
50817
51031
  self:T(self.lid..string.format("New asset %s id=%d with assignment %s.",tostring(asset.templatename),asset.uid,tostring(assignment)))
50818
51032
  end
@@ -51628,6 +51842,9 @@ template.route.points[1].y=coord.z
51628
51842
  template.x=coord.x
51629
51843
  template.y=coord.z
51630
51844
  template.alt=coord.y
51845
+ if self.ValidateAndRepositionGroundUnits then
51846
+ UTILS.ValidateAndRepositionGroundUnits(template.units)
51847
+ end
51631
51848
  local group=_DATABASE:Spawn(template)
51632
51849
  return group
51633
51850
  end
@@ -56559,8 +56776,12 @@ WASHINGTON="CVN_73",
56559
56776
  TRUMAN="CVN_75",
56560
56777
  STENNIS="Stennis",
56561
56778
  FORRESTAL="Forrestal",
56779
+ ENTERPRISE66="USS Enterprise 1966",
56780
+ ENTERPRISEMODERN="cvn-65",
56562
56781
  VINSON="VINSON",
56563
56782
  ESSEX="Essex",
56783
+ BONHOMMERICHARD="USS Bon Homme Richard",
56784
+ ESSEXSCB125="essex_scb125",
56564
56785
  HERMES="HERMES81",
56565
56786
  INVINCIBLE="hms_invincible",
56566
56787
  TARAWA="LHA_Tarawa",
@@ -56618,7 +56839,7 @@ HARD="TOPGUN Graduate",
56618
56839
  }
56619
56840
  AIRBOSS.MenuF10={}
56620
56841
  AIRBOSS.MenuF10Root=nil
56621
- AIRBOSS.version="1.4.1"
56842
+ AIRBOSS.version="1.4.2"
56622
56843
  function AIRBOSS:New(carriername,alias)
56623
56844
  local self=BASE:Inherit(self,FSM:New())
56624
56845
  self:F2({carriername=carriername,alias=alias})
@@ -56697,10 +56918,18 @@ elseif self.carriertype==AIRBOSS.CarrierType.TRUMAN then
56697
56918
  self:_InitNimitz()
56698
56919
  elseif self.carriertype==AIRBOSS.CarrierType.FORRESTAL then
56699
56920
  self:_InitForrestal()
56921
+ elseif self.carriertype==AIRBOSS.CarrierType.ENTERPRISE66 then
56922
+ self:_InitEnterprise()
56923
+ elseif self.carriertype==AIRBOSS.CarrierType.ENTERPRISEMODERN then
56924
+ self:_InitEnterprise()
56700
56925
  elseif self.carriertype==AIRBOSS.CarrierType.VINSON then
56701
56926
  self:_InitStennis()
56702
56927
  elseif self.carriertype==AIRBOSS.CarrierType.ESSEX then
56703
56928
  self:_InitEssex()
56929
+ elseif self.carriertype==AIRBOSS.CarrierType.BONHOMMERICHARD then
56930
+ self:_InitBonHommeRichard()
56931
+ elseif self.carriertype==AIRBOSS.CarrierType.ESSEXSCB125 then
56932
+ self:_InitEssexSCB125()
56704
56933
  elseif self.carriertype==AIRBOSS.CarrierType.HERMES then
56705
56934
  self:_InitHermes()
56706
56935
  elseif self.carriertype==AIRBOSS.CarrierType.INVINCIBLE then
@@ -57153,8 +57382,7 @@ self.SRS:SetCoalition(self:GetCoalition())
57153
57382
  self.SRS:SetCoordinate(self:GetCoordinate())
57154
57383
  self.SRS:SetCulture(Culture or"en-US")
57155
57384
  self.SRS:SetGender(Gender or"male")
57156
- self.SRS:SetPath(PathToSRS)
57157
- self.SRS:SetPort(Port or 5002)
57385
+ self.SRS:SetPort(Port or MSRS.port or 5002)
57158
57386
  self.SRS:SetLabel(self.AirbossRadio.alias or"AIRBOSS")
57159
57387
  self.SRS:SetCoordinate(self.carrier:GetCoordinate())
57160
57388
  self.SRS:SetVolume(Volume or 1)
@@ -57164,7 +57392,9 @@ end
57164
57392
  if Voice then
57165
57393
  self.SRS:SetVoice(Voice)
57166
57394
  end
57167
- self.SRS:SetVolume(Volume or 1.0)
57395
+ if(not Voice)and self.SRS and self.SRS:GetProvider()==MSRS.Provider.GOOGLE then
57396
+ self.SRS.voice=MSRS.poptions["gcloud"].voice or MSRS.Voices.Google.Standard.en_US_Standard_B
57397
+ end
57168
57398
  self.SRSQ=MSRSQUEUE:New("AIRBOSS")
57169
57399
  self.SRSQ:SetTransmitOnlyWithPlayers(true)
57170
57400
  if not self.PilotRadio then
@@ -57933,6 +58163,17 @@ self.carrierparam.wire3=64
57933
58163
  self.carrierparam.wire4=74
57934
58164
  self.carrierparam.landingdist=self.carrierparam.sterndist+self.carrierparam.wire3
57935
58165
  end
58166
+ function AIRBOSS:_InitEnterprise()
58167
+ self:_InitForrestal()
58168
+ self.carrierparam.sterndist=-164.30
58169
+ self.carrierparam.deckheight=19.52
58170
+ self.carrierparam.totlength=335
58171
+ self.carrierparam.rwylength=223
58172
+ self.carrierparam.wire1=57.7
58173
+ self.carrierparam.wire2=69.6
58174
+ self.carrierparam.wire3=79.5
58175
+ self.carrierparam.wire4=90.0
58176
+ end
57936
58177
  function AIRBOSS:_InitEssex()
57937
58178
  self:_InitNimitz()
57938
58179
  self.carrierparam.sterndist=-126
@@ -57960,6 +58201,20 @@ self.carrierparam.wire14=121.0
57960
58201
  self.carrierparam.wire15=128.5
57961
58202
  self.carrierparam.landingdist=self.carrierparam.sterndist+self.carrierparam.wire3
57962
58203
  end
58204
+ function AIRBOSS:_InitBonHommeRichard()
58205
+ self:_InitEssex()
58206
+ self.carrierparam.deckheight=16.95
58207
+ self.carrierparam.rwyangle=-11.4
58208
+ self.carrierparam.rwylength=97
58209
+ self.carrierparam.rwywidth=20
58210
+ self.carrierparam.wire1=40.4
58211
+ self.carrierparam.wire2=45
58212
+ self.carrierparam.wire3=51
58213
+ self.carrierparam.wire4=58.1
58214
+ end
58215
+ function AIRBOSS:_InitEssexSCB125()
58216
+ self:_InitBonHommeRichard()
58217
+ end
57963
58218
  function AIRBOSS:_InitHermes()
57964
58219
  self:_InitStennis()
57965
58220
  self.carrierparam.sterndist=-105
@@ -69008,6 +69263,7 @@ self.enableFixedWing=false
69008
69263
  self.FixedMinAngels=165
69009
69264
  self.FixedMaxAngels=2000
69010
69265
  self.FixedMaxSpeed=77
69266
+ self.validateAndRepositionUnits=false
69011
69267
  self.suppressmessages=false
69012
69268
  self.repairtime=300
69013
69269
  self.buildtime=300
@@ -70427,6 +70683,7 @@ local Positions=self:_GetUnitPositions(randomcoord,rad,heading,_template)
70427
70683
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
70428
70684
  :InitDelayOff()
70429
70685
  :InitSetUnitAbsolutePositions(Positions)
70686
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
70430
70687
  :OnSpawnGroup(function(grp)grp.spawntime=timer.getTime()end)
70431
70688
  :SpawnFromVec2(randomcoord:GetVec2())
70432
70689
  self:__TroopsDeployed(1,Group,Unit,self.DroppedTroops[self.TroopCounter],type)
@@ -70800,11 +71057,13 @@ local alias=string.format("%s-%d",_template,math.random(1,100000))
70800
71057
  if canmove then
70801
71058
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
70802
71059
  :InitDelayOff()
71060
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
70803
71061
  :OnSpawnGroup(function(grp)grp.spawntime=timer.getTime()end)
70804
71062
  :SpawnFromVec2(randomcoord)
70805
71063
  else
70806
71064
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
70807
71065
  :InitDelayOff()
71066
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
70808
71067
  :OnSpawnGroup(function(grp)grp.spawntime=timer.getTime()end)
70809
71068
  :SpawnFromVec2(randomcoord)
70810
71069
  end
@@ -71634,6 +71893,7 @@ local Positions=self:_GetUnitPositions(randomcoord,rad,heading,_template)
71634
71893
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
71635
71894
  :InitDelayOff()
71636
71895
  :InitSetUnitAbsolutePositions(Positions)
71896
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
71637
71897
  :OnSpawnGroup(function(grp)grp.spawntime=timer.getTime()end)
71638
71898
  :SpawnFromVec2(randomcoord:GetVec2())
71639
71899
  self:__TroopsDeployed(1,Group,Unit,self.DroppedTroops[self.TroopCounter],cType)
@@ -72872,6 +73132,7 @@ self.TroopCounter=self.TroopCounter+1
72872
73132
  local alias=string.format("%s-%d",_template,math.random(1,100000))
72873
73133
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
72874
73134
  :InitRandomizeUnits(randompositions,20,2)
73135
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
72875
73136
  :InitDelayOff()
72876
73137
  :OnSpawnGroup(function(grp,TimeStamp)grp.spawntime=TimeStamp or timer.getTime()end,TimeStamp)
72877
73138
  :SpawnFromVec2(randomcoord)
@@ -72989,12 +73250,14 @@ local alias=string.format("%s-%d",_template,math.random(1,100000))
72989
73250
  if canmove then
72990
73251
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
72991
73252
  :InitRandomizeUnits(true,20,2)
73253
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
72992
73254
  :InitDelayOff()
72993
73255
  :OnSpawnGroup(function(grp,TimeStamp)grp.spawntime=TimeStamp or timer.getTime()end,TimeStamp)
72994
73256
  :SpawnFromVec2(randomcoord)
72995
73257
  else
72996
73258
  self.DroppedTroops[self.TroopCounter]=SPAWN:NewWithAlias(_template,alias)
72997
73259
  :InitDelayOff()
73260
+ :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits)
72998
73261
  :OnSpawnGroup(function(grp,TimeStamp)grp.spawntime=TimeStamp or timer.getTime()end,TimeStamp)
72999
73262
  :SpawnFromVec2(randomcoord)
73000
73263
  end