@jtff/miztemplate-lib 3.1.6 → 3.1.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.
- package/lua/lib/Moose_.lua +197 -52
- package/package.json +1 -1
package/lua/lib/Moose_.lua
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
env.info('*** MOOSE GITHUB Commit Hash ID: 2023-11-
|
|
1
|
+
env.info('*** MOOSE GITHUB Commit Hash ID: 2023-11-19T12:40:22+01:00-522eb8b256f9edfbcb2c8ecfe66861f659c6403c ***')
|
|
2
2
|
env.info('*** MOOSE STATIC INCLUDE START *** ')
|
|
3
3
|
ENUMS={}
|
|
4
4
|
env.setErrorMessageBoxEnabled(false)
|
|
@@ -5888,6 +5888,14 @@ UnitDeleteTask=world.event.S_EVENT_UNIT_DELETE_TASK or-1,
|
|
|
5888
5888
|
SimulationStart=world.event.S_EVENT_SIMULATION_START or-1,
|
|
5889
5889
|
WeaponRearm=world.event.S_EVENT_WEAPON_REARM or-1,
|
|
5890
5890
|
WeaponDrop=world.event.S_EVENT_WEAPON_DROP or-1,
|
|
5891
|
+
UnitTaskTimeout=world.event.S_EVENT_UNIT_TASK_TIMEOUT or-1,
|
|
5892
|
+
UnitTaskStage=world.event.S_EVENT_UNIT_TASK_STAGE or-1,
|
|
5893
|
+
MacSubtaskScore=world.event.S_EVENT_MAC_SUBTASK_SCORE or-1,
|
|
5894
|
+
MacExtraScore=world.event.S_EVENT_MAC_EXTRA_SCORE or-1,
|
|
5895
|
+
MissionRestart=world.event.S_EVENT_MISSION_RESTART or-1,
|
|
5896
|
+
MissionWinner=world.event.S_EVENT_MISSION_WINNER or-1,
|
|
5897
|
+
PostponedTakeoff=world.event.S_EVENT_POSTPONED_TAKEOFF or-1,
|
|
5898
|
+
PostponedLand=world.event.S_EVENT_POSTPONED_LAND or-1,
|
|
5891
5899
|
}
|
|
5892
5900
|
local _EVENTMETA={
|
|
5893
5901
|
[world.event.S_EVENT_SHOT]={
|
|
@@ -6201,6 +6209,54 @@ Side="I",
|
|
|
6201
6209
|
Event="OnEventWeaponDrop",
|
|
6202
6210
|
Text="S_EVENT_WEAPON_DROP"
|
|
6203
6211
|
},
|
|
6212
|
+
[EVENTS.UnitTaskTimeout]={
|
|
6213
|
+
Order=1,
|
|
6214
|
+
Side="I",
|
|
6215
|
+
Event="OnEventUnitTaskTimeout",
|
|
6216
|
+
Text="S_EVENT_UNIT_TASK_TIMEOUT "
|
|
6217
|
+
},
|
|
6218
|
+
[EVENTS.UnitTaskStage]={
|
|
6219
|
+
Order=1,
|
|
6220
|
+
Side="I",
|
|
6221
|
+
Event="OnEventUnitTaskStage",
|
|
6222
|
+
Text="S_EVENT_UNIT_TASK_STAGE "
|
|
6223
|
+
},
|
|
6224
|
+
[EVENTS.MacSubtaskScore]={
|
|
6225
|
+
Order=1,
|
|
6226
|
+
Side="I",
|
|
6227
|
+
Event="OnEventMacSubtaskScore",
|
|
6228
|
+
Text="S_EVENT_MAC_SUBTASK_SCORE"
|
|
6229
|
+
},
|
|
6230
|
+
[EVENTS.MacExtraScore]={
|
|
6231
|
+
Order=1,
|
|
6232
|
+
Side="I",
|
|
6233
|
+
Event="OnEventMacExtraScore",
|
|
6234
|
+
Text="S_EVENT_MAC_EXTRA_SCOREP"
|
|
6235
|
+
},
|
|
6236
|
+
[EVENTS.MissionRestart]={
|
|
6237
|
+
Order=1,
|
|
6238
|
+
Side="I",
|
|
6239
|
+
Event="OnEventMissionRestart",
|
|
6240
|
+
Text="S_EVENT_MISSION_RESTART"
|
|
6241
|
+
},
|
|
6242
|
+
[EVENTS.MissionWinner]={
|
|
6243
|
+
Order=1,
|
|
6244
|
+
Side="I",
|
|
6245
|
+
Event="OnEventMissionWinner",
|
|
6246
|
+
Text="S_EVENT_MISSION_WINNER"
|
|
6247
|
+
},
|
|
6248
|
+
[EVENTS.PostponedTakeoff]={
|
|
6249
|
+
Order=1,
|
|
6250
|
+
Side="I",
|
|
6251
|
+
Event="OnEventPostponedTakeoff",
|
|
6252
|
+
Text="S_EVENT_POSTPONED_TAKEOFF"
|
|
6253
|
+
},
|
|
6254
|
+
[EVENTS.PostponedLand]={
|
|
6255
|
+
Order=1,
|
|
6256
|
+
Side="I",
|
|
6257
|
+
Event="OnEventPostponedLand",
|
|
6258
|
+
Text="S_EVENT_POSTPONED_LAND"
|
|
6259
|
+
},
|
|
6204
6260
|
}
|
|
6205
6261
|
function EVENT:New()
|
|
6206
6262
|
local self=BASE:Inherit(self,BASE:New())
|
|
@@ -6524,11 +6580,13 @@ elseif Event.TgtObjectCategory==Object.Category.STATIC then
|
|
|
6524
6580
|
Event.TgtDCSUnit=Event.target
|
|
6525
6581
|
if Event.target:isExist()and Event.id~=33 then
|
|
6526
6582
|
Event.TgtDCSUnitName=Event.TgtDCSUnit:getName()
|
|
6583
|
+
if Event.TgtDCSUnitName and Event.TgtDCSUnitName~=""then
|
|
6527
6584
|
Event.TgtUnitName=Event.TgtDCSUnitName
|
|
6528
6585
|
Event.TgtUnit=STATIC:FindByName(Event.TgtDCSUnitName,false)
|
|
6529
6586
|
Event.TgtCoalition=Event.TgtDCSUnit:getCoalition()
|
|
6530
6587
|
Event.TgtCategory=Event.TgtDCSUnit:getDesc().category
|
|
6531
6588
|
Event.TgtTypeName=Event.TgtDCSUnit:getTypeName()
|
|
6589
|
+
end
|
|
6532
6590
|
else
|
|
6533
6591
|
Event.TgtDCSUnitName=string.format("No target object for Event ID %s",tostring(Event.id))
|
|
6534
6592
|
Event.TgtUnitName=Event.TgtDCSUnitName
|
|
@@ -6568,7 +6626,7 @@ end
|
|
|
6568
6626
|
if Event.place then
|
|
6569
6627
|
if Event.id==EVENTS.LandingAfterEjection then
|
|
6570
6628
|
else
|
|
6571
|
-
if Event.place:isExist()and Event.place
|
|
6629
|
+
if Event.place:isExist()and Object.getCategory(Event.place)~=Object.Category.SCENERY then
|
|
6572
6630
|
Event.Place=AIRBASE:Find(Event.place)
|
|
6573
6631
|
Event.PlaceName=Event.Place:GetName()
|
|
6574
6632
|
end
|
|
@@ -8368,7 +8426,7 @@ radius=ZoneRadius,
|
|
|
8368
8426
|
}
|
|
8369
8427
|
local function EvaluateZone(ZoneObject)
|
|
8370
8428
|
if ZoneObject then
|
|
8371
|
-
local ObjectCategory=
|
|
8429
|
+
local ObjectCategory=Object.getCategory(ZoneObject)
|
|
8372
8430
|
if(ObjectCategory==Object.Category.UNIT and ZoneObject:isExist()and ZoneObject:isActive())or(ObjectCategory==Object.Category.STATIC and ZoneObject:isExist())then
|
|
8373
8431
|
local CoalitionDCSUnit=ZoneObject:getCoalition()
|
|
8374
8432
|
local Include=false
|
|
@@ -9212,7 +9270,7 @@ radius=ZoneRadius,
|
|
|
9212
9270
|
}
|
|
9213
9271
|
local function EvaluateZone(ZoneObject)
|
|
9214
9272
|
if ZoneObject then
|
|
9215
|
-
local ObjectCategory=
|
|
9273
|
+
local ObjectCategory=Object.getCategory(ZoneObject)
|
|
9216
9274
|
if(ObjectCategory==Object.Category.UNIT and ZoneObject:isExist()and ZoneObject:isActive())or(ObjectCategory==Object.Category.STATIC and ZoneObject:isExist())then
|
|
9217
9275
|
local CoalitionDCSUnit=ZoneObject:getCoalition()
|
|
9218
9276
|
local Include=false
|
|
@@ -11691,6 +11749,16 @@ end
|
|
|
11691
11749
|
end
|
|
11692
11750
|
return CountU
|
|
11693
11751
|
end
|
|
11752
|
+
function SET_UNIT:GetAliveSet()
|
|
11753
|
+
local AliveSet=SET_UNIT:New()
|
|
11754
|
+
for GroupName,GroupObject in pairs(self.Set)do
|
|
11755
|
+
local GroupObject=GroupObject
|
|
11756
|
+
if GroupObject and GroupObject:IsAlive()then
|
|
11757
|
+
AliveSet:Add(GroupName,GroupObject)
|
|
11758
|
+
end
|
|
11759
|
+
end
|
|
11760
|
+
return AliveSet.Set or{},AliveSet
|
|
11761
|
+
end
|
|
11694
11762
|
function SET_UNIT:_ContinousZoneFilter()
|
|
11695
11763
|
local Database=_DATABASE.UNITS
|
|
11696
11764
|
for ObjectName,Object in pairs(Database)do
|
|
@@ -11915,7 +11983,13 @@ self:F({MaxThreatLevelA2G=MaxThreatLevelA2G,MaxThreatText=MaxThreatText})
|
|
|
11915
11983
|
return MaxThreatLevelA2G,MaxThreatText
|
|
11916
11984
|
end
|
|
11917
11985
|
function SET_UNIT:GetCoordinate()
|
|
11918
|
-
local Coordinate=
|
|
11986
|
+
local Coordinate=nil
|
|
11987
|
+
local unit=self:GetRandom()
|
|
11988
|
+
if self:Count()==1 and unit then
|
|
11989
|
+
return unit:GetCoordinate()
|
|
11990
|
+
end
|
|
11991
|
+
if unit then
|
|
11992
|
+
local Coordinate=unit:GetCoordinate()
|
|
11919
11993
|
local x1=Coordinate.x
|
|
11920
11994
|
local x2=Coordinate.x
|
|
11921
11995
|
local y1=Coordinate.y
|
|
@@ -11925,7 +11999,7 @@ local z2=Coordinate.z
|
|
|
11925
11999
|
local MaxVelocity=0
|
|
11926
12000
|
local AvgHeading=nil
|
|
11927
12001
|
local MovingCount=0
|
|
11928
|
-
for UnitName,UnitData in pairs(self:
|
|
12002
|
+
for UnitName,UnitData in pairs(self:GetAliveSet())do
|
|
11929
12003
|
local Unit=UnitData
|
|
11930
12004
|
local Coordinate=Unit:GetCoordinate()
|
|
11931
12005
|
x1=(Coordinate.x<x1)and Coordinate.x or x1
|
|
@@ -11949,6 +12023,7 @@ Coordinate.z=(z2-z1)/2+z1
|
|
|
11949
12023
|
Coordinate:SetHeading(AvgHeading)
|
|
11950
12024
|
Coordinate:SetVelocity(MaxVelocity)
|
|
11951
12025
|
self:F({Coordinate=Coordinate})
|
|
12026
|
+
end
|
|
11952
12027
|
return Coordinate
|
|
11953
12028
|
end
|
|
11954
12029
|
function SET_UNIT:GetVelocity()
|
|
@@ -12805,6 +12880,31 @@ self:_FilterStart()
|
|
|
12805
12880
|
end
|
|
12806
12881
|
return self
|
|
12807
12882
|
end
|
|
12883
|
+
function SET_CLIENT:_EventPlayerEnterUnit(Event)
|
|
12884
|
+
self:I("_EventPlayerEnterUnit")
|
|
12885
|
+
if Event.IniDCSUnit then
|
|
12886
|
+
if Event.IniObjectCategory==1 and Event.IniGroup and Event.IniGroup:IsGround()then
|
|
12887
|
+
local ObjectName,Object=self:AddInDatabase(Event)
|
|
12888
|
+
self:I(ObjectName,UTILS.PrintTableToLog(Object))
|
|
12889
|
+
if Object and self:IsIncludeObject(Object)then
|
|
12890
|
+
self:Add(ObjectName,Object)
|
|
12891
|
+
end
|
|
12892
|
+
end
|
|
12893
|
+
end
|
|
12894
|
+
return self
|
|
12895
|
+
end
|
|
12896
|
+
function SET_CLIENT:_EventPlayerLeaveUnit(Event)
|
|
12897
|
+
self:I("_EventPlayerLeaveUnit")
|
|
12898
|
+
if Event.IniDCSUnit then
|
|
12899
|
+
if Event.IniObjectCategory==1 and Event.IniGroup and Event.IniGroup:IsGround()then
|
|
12900
|
+
local ObjectName,Object=self:FindInDatabase(Event)
|
|
12901
|
+
if ObjectName then
|
|
12902
|
+
self:Remove(ObjectName)
|
|
12903
|
+
end
|
|
12904
|
+
end
|
|
12905
|
+
end
|
|
12906
|
+
return self
|
|
12907
|
+
end
|
|
12808
12908
|
function SET_CLIENT:AddInDatabase(Event)
|
|
12809
12909
|
self:F3({Event})
|
|
12810
12910
|
return Event.IniDCSUnitName,self.Database[Event.IniDCSUnitName]
|
|
@@ -14886,7 +14986,7 @@ local gotunits=false
|
|
|
14886
14986
|
local gotscenery=false
|
|
14887
14987
|
local function EvaluateZone(ZoneObject)
|
|
14888
14988
|
if ZoneObject then
|
|
14889
|
-
local ObjectCategory=
|
|
14989
|
+
local ObjectCategory=Object.getCategory(ZoneObject)
|
|
14890
14990
|
if ObjectCategory==Object.Category.UNIT and ZoneObject:isExist()then
|
|
14891
14991
|
table.insert(Units,UNIT:Find(ZoneObject))
|
|
14892
14992
|
gotunits=true
|
|
@@ -16736,29 +16836,40 @@ return self
|
|
|
16736
16836
|
end
|
|
16737
16837
|
_MESSAGESRS={}
|
|
16738
16838
|
function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,Gender,Culture,Voice,Coalition,Volume,Label,Coordinate)
|
|
16739
|
-
_MESSAGESRS.MSRS=MSRS:New(PathToSRS,Frequency,Modulation,Volume)
|
|
16740
|
-
_MESSAGESRS.
|
|
16839
|
+
_MESSAGESRS.MSRS=MSRS:New(PathToSRS,Frequency or 243,Modulation or radio.modulation.AM,Volume)
|
|
16840
|
+
_MESSAGESRS.frequency=Frequency
|
|
16841
|
+
_MESSAGESRS.modulation=Modulation or radio.modulation.AM
|
|
16842
|
+
_MESSAGESRS.MSRS:SetCoalition(Coalition or coalition.side.NEUTRAL)
|
|
16843
|
+
_MESSAGESRS.coalition=Coalition or coalition.side.NEUTRAL
|
|
16844
|
+
_MESSAGESRS.coordinate=Coordinate
|
|
16741
16845
|
_MESSAGESRS.MSRS:SetCoordinate(Coordinate)
|
|
16742
16846
|
_MESSAGESRS.MSRS:SetCulture(Culture)
|
|
16743
|
-
_MESSAGESRS.Culture=Culture
|
|
16847
|
+
_MESSAGESRS.Culture=Culture or"en-GB"
|
|
16744
16848
|
_MESSAGESRS.MSRS:SetGender(Gender)
|
|
16745
|
-
_MESSAGESRS.Gender=Gender
|
|
16849
|
+
_MESSAGESRS.Gender=Gender or"female"
|
|
16746
16850
|
_MESSAGESRS.MSRS:SetGoogle(PathToCredentials)
|
|
16851
|
+
_MESSAGESRS.google=PathToCredentials
|
|
16747
16852
|
_MESSAGESRS.MSRS:SetLabel(Label or"MESSAGE")
|
|
16748
|
-
_MESSAGESRS.
|
|
16749
|
-
_MESSAGESRS.MSRS:
|
|
16750
|
-
_MESSAGESRS.
|
|
16853
|
+
_MESSAGESRS.label=Label or"MESSAGE"
|
|
16854
|
+
_MESSAGESRS.MSRS:SetPort(Port or 5002)
|
|
16855
|
+
_MESSAGESRS.port=Port or 5002
|
|
16856
|
+
_MESSAGESRS.volume=Volume or 1
|
|
16857
|
+
_MESSAGESRS.MSRS:SetVolume(_MESSAGESRS.volume)
|
|
16858
|
+
if Voice then _MESSAGESRS.MSRS:SetVoice(Voice)end
|
|
16859
|
+
_MESSAGESRS.voice=Voice
|
|
16751
16860
|
_MESSAGESRS.SRSQ=MSRSQUEUE:New(Label or"MESSAGE")
|
|
16752
|
-
env.info(_MESSAGESRS.MSRS.provider,false)
|
|
16753
16861
|
end
|
|
16754
16862
|
function MESSAGE:ToSRS(frequency,modulation,gender,culture,voice,coalition,volume,coordinate)
|
|
16863
|
+
local tgender=gender or _MESSAGESRS.Gender
|
|
16755
16864
|
if _MESSAGESRS.SRSQ then
|
|
16756
|
-
|
|
16865
|
+
if voice then
|
|
16866
|
+
_MESSAGESRS.MSRS:SetVoice(voice or _MESSAGESRS.voice)
|
|
16867
|
+
end
|
|
16757
16868
|
if coordinate then
|
|
16758
16869
|
_MESSAGESRS.MSRS:SetCoordinate(coordinate)
|
|
16759
16870
|
end
|
|
16760
16871
|
local category=string.gsub(self.MessageCategory,":","")
|
|
16761
|
-
_MESSAGESRS.SRSQ:NewTransmission(self.MessageText,nil,_MESSAGESRS.MSRS,nil,nil,nil,nil,nil,frequency,modulation,gender or _MESSAGESRS.Gender,culture or _MESSAGESRS.Culture,
|
|
16872
|
+
_MESSAGESRS.SRSQ:NewTransmission(self.MessageText,nil,_MESSAGESRS.MSRS,nil,nil,nil,nil,nil,frequency or _MESSAGESRS.frequency,modulation or _MESSAGESRS.modulation,gender or _MESSAGESRS.Gender,culture or _MESSAGESRS.Culture,nil,volume or _MESSAGESRS.volume,category,coordinate or _MESSAGESRS.coordinate)
|
|
16762
16873
|
end
|
|
16763
16874
|
return self
|
|
16764
16875
|
end
|
|
@@ -19437,11 +19548,11 @@ function SPOT:onafterLasing(From,Event,To)
|
|
|
19437
19548
|
self:T({From,Event,To})
|
|
19438
19549
|
if self.Lasing then
|
|
19439
19550
|
if self.Target and self.Target:IsAlive()then
|
|
19440
|
-
self.SpotIR:setPoint(self.Target:GetPointVec3():AddY(1):AddY(math.random(-100,100)/
|
|
19551
|
+
self.SpotIR:setPoint(self.Target:GetPointVec3():AddY(1):AddY(math.random(-100,100)/200):AddX(math.random(-100,100)/200):GetVec3())
|
|
19441
19552
|
self.SpotLaser:setPoint(self.Target:GetPointVec3():AddY(1):GetVec3())
|
|
19442
19553
|
self:__Lasing(0.2)
|
|
19443
19554
|
elseif self.TargetCoord then
|
|
19444
|
-
local irvec3={x=self.TargetCoord.x+math.random(-100,100)/
|
|
19555
|
+
local irvec3={x=self.TargetCoord.x+math.random(-100,100)/200,y=self.TargetCoord.y+math.random(-100,100)/200,z=self.TargetCoord.z}
|
|
19445
19556
|
local lsvec3={x=self.TargetCoord.x,y=self.TargetCoord.y,z=self.TargetCoord.z}
|
|
19446
19557
|
self.SpotIR:setPoint(irvec3)
|
|
19447
19558
|
self.SpotLaser:setPoint(lsvec3)
|
|
@@ -19824,7 +19935,7 @@ OBJECT={
|
|
|
19824
19935
|
ClassName="OBJECT",
|
|
19825
19936
|
ObjectName="",
|
|
19826
19937
|
}
|
|
19827
|
-
function OBJECT:New(ObjectName
|
|
19938
|
+
function OBJECT:New(ObjectName)
|
|
19828
19939
|
local self=BASE:Inherit(self,BASE:New())
|
|
19829
19940
|
self:F2(ObjectName)
|
|
19830
19941
|
self.ObjectName=ObjectName
|
|
@@ -19836,7 +19947,7 @@ if DCSObject then
|
|
|
19836
19947
|
local ObjectID=DCSObject:getID()
|
|
19837
19948
|
return ObjectID
|
|
19838
19949
|
end
|
|
19839
|
-
|
|
19950
|
+
self:E({"Cannot GetID",Name=self.ObjectName,Class=self:GetClassName()})
|
|
19840
19951
|
return nil
|
|
19841
19952
|
end
|
|
19842
19953
|
function OBJECT:Destroy()
|
|
@@ -19845,7 +19956,7 @@ if DCSObject then
|
|
|
19845
19956
|
DCSObject:destroy(false)
|
|
19846
19957
|
return true
|
|
19847
19958
|
end
|
|
19848
|
-
|
|
19959
|
+
self:E({"Cannot Destroy",Name=self.ObjectName,Class=self:GetClassName()})
|
|
19849
19960
|
return nil
|
|
19850
19961
|
end
|
|
19851
19962
|
IDENTIFIABLE={
|
|
@@ -27140,7 +27251,7 @@ end
|
|
|
27140
27251
|
function AIRBASE:GetWarehouse()
|
|
27141
27252
|
local warehouse=nil
|
|
27142
27253
|
local airbase=self:GetDCSObject()
|
|
27143
|
-
if airbase then
|
|
27254
|
+
if airbase and Airbase.getWarehouse then
|
|
27144
27255
|
warehouse=airbase:getWarehouse()
|
|
27145
27256
|
end
|
|
27146
27257
|
return warehouse
|
|
@@ -28445,7 +28556,7 @@ local target=nil
|
|
|
28445
28556
|
if self.weapon then
|
|
28446
28557
|
local object=self.weapon:getTarget()
|
|
28447
28558
|
if object then
|
|
28448
|
-
local category=
|
|
28559
|
+
local category=Object.getCategory(object)
|
|
28449
28560
|
local name=object:getName()
|
|
28450
28561
|
self:T(self.lid..string.format("Got Target Object %s, category=%d",object:getName(),category))
|
|
28451
28562
|
if category==Object.Category.UNIT then
|
|
@@ -29102,7 +29213,9 @@ STORAGE.version="0.0.1"
|
|
|
29102
29213
|
function STORAGE:New(AirbaseName)
|
|
29103
29214
|
local self=BASE:Inherit(self,BASE:New())
|
|
29104
29215
|
self.airbase=Airbase.getByName(AirbaseName)
|
|
29216
|
+
if Airbase.getWarehouse then
|
|
29105
29217
|
self.warehouse=self.airbase:getWarehouse()
|
|
29218
|
+
end
|
|
29106
29219
|
self.lid=string.format("STORAGE %s",AirbaseName)
|
|
29107
29220
|
return self
|
|
29108
29221
|
end
|
|
@@ -32248,7 +32361,7 @@ self:__CalculateHitZone(20,SEADWeapon,pos0,fheight,SEADGroup,SEADWeaponName)
|
|
|
32248
32361
|
end
|
|
32249
32362
|
return self
|
|
32250
32363
|
end
|
|
32251
|
-
local targetcat=
|
|
32364
|
+
local targetcat=Object.getCategory(_target)
|
|
32252
32365
|
local _targetUnit=nil
|
|
32253
32366
|
local _targetgroup=nil
|
|
32254
32367
|
self:T(string.format("*** Targetcat = %d",targetcat))
|
|
@@ -39511,6 +39624,7 @@ soundpath="Range Soundfiles/",
|
|
|
39511
39624
|
targetsheet=nil,
|
|
39512
39625
|
targetpath=nil,
|
|
39513
39626
|
targetprefix=nil,
|
|
39627
|
+
Coalition=nil,
|
|
39514
39628
|
}
|
|
39515
39629
|
RANGE.Defaults={
|
|
39516
39630
|
goodhitrange=25,
|
|
@@ -39580,10 +39694,11 @@ IRExitRange={filename="IR-ExitRange.ogg",duration=3.10},
|
|
|
39580
39694
|
RANGE.Names={}
|
|
39581
39695
|
RANGE.MenuF10={}
|
|
39582
39696
|
RANGE.MenuF10Root=nil
|
|
39583
|
-
RANGE.version="2.7.
|
|
39584
|
-
function RANGE:New(RangeName)
|
|
39697
|
+
RANGE.version="2.7.3"
|
|
39698
|
+
function RANGE:New(RangeName,Coalition)
|
|
39585
39699
|
local self=BASE:Inherit(self,FSM:New())
|
|
39586
39700
|
self.rangename=RangeName or"Practice Range"
|
|
39701
|
+
self.Coalition=Coalition
|
|
39587
39702
|
self.lid=string.format("RANGE %s | ",self.rangename)
|
|
39588
39703
|
local text=string.format("Script version %s - creating new RANGE object %s.",RANGE.version,self.rangename)
|
|
39589
39704
|
self:I(self.lid..text)
|
|
@@ -40118,7 +40233,13 @@ local _callsign=_unit:GetCallsign()
|
|
|
40118
40233
|
local text=string.format("Player %s, callsign %s entered unit %s (UID %d) of group %s (GID %d)",_playername,_callsign,_unitName,_uid,_group:GetName(),_gid)
|
|
40119
40234
|
self:T(self.lid..text)
|
|
40120
40235
|
self.strafeStatus[_uid]=nil
|
|
40236
|
+
if self.Coalition then
|
|
40237
|
+
if EventData.IniCoalition==self.Coalition then
|
|
40121
40238
|
self:ScheduleOnce(0.1,self._AddF10Commands,self,_unitName)
|
|
40239
|
+
end
|
|
40240
|
+
else
|
|
40241
|
+
self:ScheduleOnce(0.1,self._AddF10Commands,self,_unitName)
|
|
40242
|
+
end
|
|
40122
40243
|
self.PlayerSettings[_playername]={}
|
|
40123
40244
|
self.PlayerSettings[_playername].smokebombimpact=self.defaultsmokebomb
|
|
40124
40245
|
self.PlayerSettings[_playername].flaredirecthits=false
|
|
@@ -50089,7 +50210,9 @@ MANTIS.SamData={
|
|
|
50089
50210
|
["SA-20A"]={Range=150,Blindspot=5,Height=27,Type="Long",Radar="S-300PMU1"},
|
|
50090
50211
|
["SA-20B"]={Range=200,Blindspot=4,Height=27,Type="Long",Radar="S-300PMU2"},
|
|
50091
50212
|
["HQ-2"]={Range=50,Blindspot=6,Height=35,Type="Medium",Radar="HQ_2_Guideline_LN"},
|
|
50092
|
-
["SHORAD"]={Range=3,Blindspot=0,Height=3,Type="Short",Radar="Igla"}
|
|
50213
|
+
["SHORAD"]={Range=3,Blindspot=0,Height=3,Type="Short",Radar="Igla"},
|
|
50214
|
+
["TAMIR IDFA"]={Range=20,Blindspot=0.6,Height=12.3,Type="Short",Radar="IRON_DOME_LN"},
|
|
50215
|
+
["STUNNER IDFA"]={Range=250,Blindspot=1,Height=45,Type="Long",Radar="DAVID_SLING_LN"},
|
|
50093
50216
|
}
|
|
50094
50217
|
MANTIS.SamDataHDS={
|
|
50095
50218
|
["SA-2 HDS"]={Range=56,Blindspot=7,Height=30,Type="Medium",Radar="V759"},
|
|
@@ -50237,7 +50360,7 @@ end
|
|
|
50237
50360
|
if self.HQ_Template_CC then
|
|
50238
50361
|
self.HQ_CC=GROUP:FindByName(self.HQ_Template_CC)
|
|
50239
50362
|
end
|
|
50240
|
-
self.version="0.8.
|
|
50363
|
+
self.version="0.8.15"
|
|
50241
50364
|
self:I(string.format("***** Starting MANTIS Version %s *****",self.version))
|
|
50242
50365
|
self:SetStartState("Stopped")
|
|
50243
50366
|
self:AddTransition("Stopped","Start","Running")
|
|
@@ -50268,11 +50391,13 @@ local radius=radius or 5000
|
|
|
50268
50391
|
self.grouping=radius
|
|
50269
50392
|
return self
|
|
50270
50393
|
end
|
|
50271
|
-
function MANTIS:AddScootZones(ZoneSet,Number)
|
|
50394
|
+
function MANTIS:AddScootZones(ZoneSet,Number,Random,Formation)
|
|
50272
50395
|
self:T(self.lid.." AddScootZones")
|
|
50273
50396
|
self.SkateZones=ZoneSet
|
|
50274
50397
|
self.SkateNumber=Number or 3
|
|
50275
50398
|
self.shootandscoot=true
|
|
50399
|
+
self.ScootRandom=Random
|
|
50400
|
+
self.ScootFormation=Formation or"Cone"
|
|
50276
50401
|
return self
|
|
50277
50402
|
end
|
|
50278
50403
|
function MANTIS:AddZones(AcceptZones,RejectZones,ConflictZones)
|
|
@@ -50972,8 +51097,8 @@ self.ShoradLink=true
|
|
|
50972
51097
|
self.Shorad.Groupset=self.ShoradGroupSet
|
|
50973
51098
|
self.Shorad.debug=self.debug
|
|
50974
51099
|
end
|
|
50975
|
-
if self.shootandscoot and self.SkateZones then
|
|
50976
|
-
self.Shorad:AddScootZones(self.SkateZones,self.SkateNumber or 3)
|
|
51100
|
+
if self.shootandscoot and self.SkateZones and self.Shorad then
|
|
51101
|
+
self.Shorad:AddScootZones(self.SkateZones,self.SkateNumber or 3,self.ScootRandom,self.ScootFormation)
|
|
50977
51102
|
end
|
|
50978
51103
|
self:__Status(-math.random(1,10))
|
|
50979
51104
|
return self
|
|
@@ -51080,6 +51205,9 @@ UseEmOnOff=true,
|
|
|
51080
51205
|
shootandscoot=false,
|
|
51081
51206
|
SkateNumber=3,
|
|
51082
51207
|
SkateZones=nil,
|
|
51208
|
+
minscootdist=100,
|
|
51209
|
+
minscootdist=3000,
|
|
51210
|
+
scootrandomcoord=false,
|
|
51083
51211
|
}
|
|
51084
51212
|
do
|
|
51085
51213
|
SHORAD.Harms={
|
|
@@ -51123,7 +51251,7 @@ self.DefenseLowProb=70
|
|
|
51123
51251
|
self.DefenseHighProb=90
|
|
51124
51252
|
self.UseEmOnOff=true
|
|
51125
51253
|
if UseEmOnOff==false then self.UseEmOnOff=UseEmOnOff end
|
|
51126
|
-
self:I("*** SHORAD - Started Version 0.3.
|
|
51254
|
+
self:I("*** SHORAD - Started Version 0.3.4")
|
|
51127
51255
|
self.lid=string.format("SHORAD %s | ",self.name)
|
|
51128
51256
|
self:_InitState()
|
|
51129
51257
|
self:HandleEvent(EVENTS.Shot,self.HandleEventShot)
|
|
@@ -51153,11 +51281,13 @@ math.random()
|
|
|
51153
51281
|
end
|
|
51154
51282
|
return self
|
|
51155
51283
|
end
|
|
51156
|
-
function SHORAD:AddScootZones(ZoneSet,Number)
|
|
51284
|
+
function SHORAD:AddScootZones(ZoneSet,Number,Random,Formation)
|
|
51157
51285
|
self:T(self.lid.." AddScootZones")
|
|
51158
51286
|
self.SkateZones=ZoneSet
|
|
51159
51287
|
self.SkateNumber=Number or 3
|
|
51160
51288
|
self.shootandscoot=true
|
|
51289
|
+
self.scootrandomcoord=Random
|
|
51290
|
+
self.scootformation=Formation or"Cone"
|
|
51161
51291
|
return self
|
|
51162
51292
|
end
|
|
51163
51293
|
function SHORAD:SwitchDebug(onoff)
|
|
@@ -51421,8 +51551,8 @@ end
|
|
|
51421
51551
|
function SHORAD:onafterShootAndScoot(From,Event,To,Shorad)
|
|
51422
51552
|
self:T({From,Event,To})
|
|
51423
51553
|
local possibleZones={}
|
|
51424
|
-
local mindist=100
|
|
51425
|
-
local maxdist=3000
|
|
51554
|
+
local mindist=self.minscootdist or 100
|
|
51555
|
+
local maxdist=self.maxscootdist or 3000
|
|
51426
51556
|
if Shorad and Shorad:IsAlive()then
|
|
51427
51557
|
local NowCoord=Shorad:GetCoordinate()
|
|
51428
51558
|
for _,_zone in pairs(self.SkateZones.Set)do
|
|
@@ -51438,7 +51568,11 @@ local rand=math.floor(math.random(1,#possibleZones*1000)/1000+0.5)
|
|
|
51438
51568
|
if rand==0 then rand=1 end
|
|
51439
51569
|
self:T(self.lid.." ShootAndScoot to zone "..rand)
|
|
51440
51570
|
local ToCoordinate=possibleZones[rand]:GetCoordinate()
|
|
51441
|
-
|
|
51571
|
+
if self.scootrandomcoord then
|
|
51572
|
+
ToCoordinate=possibleZones[rand]:GetRandomCoordinate(nil,nil,{land.SurfaceType.LAND,land.SurfaceType.ROAD})
|
|
51573
|
+
end
|
|
51574
|
+
local formation=self.scootformation or"Cone"
|
|
51575
|
+
Shorad:RouteGroundTo(ToCoordinate,20,formation,1)
|
|
51442
51576
|
end
|
|
51443
51577
|
end
|
|
51444
51578
|
return self
|
|
@@ -51469,7 +51603,7 @@ self:__CalculateHitZone(20,ShootingWeapon,pos0,fheight,EventData.IniGroup)
|
|
|
51469
51603
|
end
|
|
51470
51604
|
return self
|
|
51471
51605
|
end
|
|
51472
|
-
local targetcat=
|
|
51606
|
+
local targetcat=Object.getCategory(targetdata)
|
|
51473
51607
|
self:T(string.format("Target Category (3=STATIC, 1=UNIT)= %s",tostring(targetcat)))
|
|
51474
51608
|
self:T({targetdata})
|
|
51475
51609
|
local targetunit=nil
|
|
@@ -62457,7 +62591,7 @@ end
|
|
|
62457
62591
|
alltext=alltext..";\n"..subtitle
|
|
62458
62592
|
local _RUNACT
|
|
62459
62593
|
if not self.ATISforFARPs then
|
|
62460
|
-
local subtitle
|
|
62594
|
+
local subtitle=""
|
|
62461
62595
|
if runwayLanding then
|
|
62462
62596
|
local actrun=self.gettext:GetEntry("ACTIVELANDING",self.locale)
|
|
62463
62597
|
subtitle=string.format("%s %s",actrun,runwayLanding)
|
|
@@ -63192,7 +63326,7 @@ MOVE="move",
|
|
|
63192
63326
|
SHIP="ship",
|
|
63193
63327
|
BEACON="beacon",
|
|
63194
63328
|
}
|
|
63195
|
-
CTLD.
|
|
63329
|
+
CTLD.UnitTypeCapabilities={
|
|
63196
63330
|
["SA342Mistral"]={type="SA342Mistral",crates=false,troops=true,cratelimit=0,trooplimit=4,length=12,cargoweightlimit=400},
|
|
63197
63331
|
["SA342L"]={type="SA342L",crates=false,troops=true,cratelimit=0,trooplimit=2,length=12,cargoweightlimit=400},
|
|
63198
63332
|
["SA342M"]={type="SA342M",crates=false,troops=true,cratelimit=0,trooplimit=4,length=12,cargoweightlimit=400},
|
|
@@ -63209,7 +63343,7 @@ CTLD.UnitTypes={
|
|
|
63209
63343
|
["AH-64D_BLK_II"]={type="AH-64D_BLK_II",crates=false,troops=true,cratelimit=0,trooplimit=2,length=17,cargoweightlimit=200},
|
|
63210
63344
|
["Bronco-OV-10A"]={type="Bronco-OV-10A",crates=false,troops=true,cratelimit=0,trooplimit=5,length=13,cargoweightlimit=1450},
|
|
63211
63345
|
}
|
|
63212
|
-
CTLD.version="1.0.
|
|
63346
|
+
CTLD.version="1.0.42"
|
|
63213
63347
|
function CTLD:New(Coalition,Prefixes,Alias)
|
|
63214
63348
|
local self=BASE:Inherit(self,FSM:New())
|
|
63215
63349
|
BASE:T({Coalition,Prefixes,Alias})
|
|
@@ -63349,7 +63483,7 @@ function CTLD:_GetUnitCapabilities(Unit)
|
|
|
63349
63483
|
self:T(self.lid.." _GetUnitCapabilities")
|
|
63350
63484
|
local _unit=Unit
|
|
63351
63485
|
local unittype=_unit:GetTypeName()
|
|
63352
|
-
local capabilities=self.
|
|
63486
|
+
local capabilities=self.UnitTypeCapabilities[unittype]
|
|
63353
63487
|
if not capabilities or capabilities=={}then
|
|
63354
63488
|
capabilities={}
|
|
63355
63489
|
capabilities.troops=false
|
|
@@ -64825,8 +64959,14 @@ local capabilities=self:_GetUnitCapabilities(_unit)
|
|
|
64825
64959
|
local cantroops=capabilities.troops
|
|
64826
64960
|
local cancrates=capabilities.crates
|
|
64827
64961
|
local topmenu=MENU_GROUP:New(_group,"CTLD",nil)
|
|
64828
|
-
local toptroops=
|
|
64829
|
-
local topcrates=
|
|
64962
|
+
local toptroops=nil
|
|
64963
|
+
local topcrates=nil
|
|
64964
|
+
if cantroops then
|
|
64965
|
+
toptroops=MENU_GROUP:New(_group,"Manage Troops",topmenu)
|
|
64966
|
+
end
|
|
64967
|
+
if cancrates then
|
|
64968
|
+
topcrates=MENU_GROUP:New(_group,"Manage Crates",topmenu)
|
|
64969
|
+
end
|
|
64830
64970
|
local listmenu=MENU_GROUP_COMMAND:New(_group,"List boarded cargo",topmenu,self._ListCargo,self,_group,_unit)
|
|
64831
64971
|
local invtry=MENU_GROUP_COMMAND:New(_group,"Inventory",topmenu,self._ListInventory,self,_group,_unit)
|
|
64832
64972
|
local rbcns=MENU_GROUP_COMMAND:New(_group,"List active zone beacons",topmenu,self._ListRadioBeacons,self,_group,_unit)
|
|
@@ -65402,7 +65542,7 @@ self:_SendMessage(string.format("Negative, need to be closer than %dnm to a zone
|
|
|
65402
65542
|
end
|
|
65403
65543
|
return self
|
|
65404
65544
|
end
|
|
65405
|
-
function CTLD:
|
|
65545
|
+
function CTLD:SetUnitCapabilities(Unittype,Cancrates,Cantroops,Cratelimit,Trooplimit,Length,Maxcargoweight)
|
|
65406
65546
|
self:T(self.lid.." UnitCapabilities")
|
|
65407
65547
|
local unittype=nil
|
|
65408
65548
|
local unit=nil
|
|
@@ -65416,7 +65556,7 @@ return self
|
|
|
65416
65556
|
end
|
|
65417
65557
|
local length=20
|
|
65418
65558
|
local maxcargo=500
|
|
65419
|
-
local existingcaps=self.
|
|
65559
|
+
local existingcaps=self.UnitTypeCapabilities[unittype]
|
|
65420
65560
|
if existingcaps then
|
|
65421
65561
|
length=existingcaps.length or 20
|
|
65422
65562
|
maxcargo=existingcaps.cargoweightlimit or 500
|
|
@@ -65429,7 +65569,12 @@ capabilities.cratelimit=Cratelimit or 0
|
|
|
65429
65569
|
capabilities.trooplimit=Trooplimit or 0
|
|
65430
65570
|
capabilities.length=Length or length
|
|
65431
65571
|
capabilities.cargoweightlimit=Maxcargoweight or maxcargo
|
|
65432
|
-
self.
|
|
65572
|
+
self.UnitTypeCapabilities[unittype]=capabilities
|
|
65573
|
+
return self
|
|
65574
|
+
end
|
|
65575
|
+
function CTLD:UnitCapabilities(Unittype,Cancrates,Cantroops,Cratelimit,Trooplimit,Length,Maxcargoweight)
|
|
65576
|
+
self:I(self.lid.."This function been replaced with `SetUnitCapabilities()` - pls use the new one going forward!")
|
|
65577
|
+
self:SetUnitCapabilities(Unittype,Cancrates,Cantroops,Cratelimit,Trooplimit,Length,Maxcargoweight)
|
|
65433
65578
|
return self
|
|
65434
65579
|
end
|
|
65435
65580
|
function CTLD:IsCorrectHover(Unit)
|
|
@@ -78272,7 +78417,7 @@ end
|
|
|
78272
78417
|
if self.google then
|
|
78273
78418
|
command=command..string.format(' --ssml -G "%s"',self.google)
|
|
78274
78419
|
end
|
|
78275
|
-
self:
|
|
78420
|
+
self:I("MSRS command="..command)
|
|
78276
78421
|
return command
|
|
78277
78422
|
end
|
|
78278
78423
|
function MSRS:LoadConfigFile(Path,Filename,ConfigLoaded)
|
|
@@ -78294,7 +78439,7 @@ self.culture=MSRS_Config.Culture or"en-GB"
|
|
|
78294
78439
|
self.gender=MSRS_Config.Gender or"male"
|
|
78295
78440
|
self.google=MSRS_Config.Google
|
|
78296
78441
|
self.Label=MSRS_Config.Label or"MSRS"
|
|
78297
|
-
self.voice=MSRS_Config.Voice
|
|
78442
|
+
self.voice=MSRS_Config.Voice
|
|
78298
78443
|
if MSRS_Config.GRPC then
|
|
78299
78444
|
self.provider=MSRS_Config.GRPC.DefaultProvider
|
|
78300
78445
|
if MSRS_Config.GRPC[MSRS_Config.GRPC.DefaultProvider]then
|
|
@@ -78318,7 +78463,7 @@ MSRS.culture=MSRS_Config.Culture or"en-GB"
|
|
|
78318
78463
|
MSRS.gender=MSRS_Config.Gender or"male"
|
|
78319
78464
|
MSRS.google=MSRS_Config.Google
|
|
78320
78465
|
MSRS.Label=MSRS_Config.Label or"MSRS"
|
|
78321
|
-
MSRS.voice=MSRS_Config.Voice
|
|
78466
|
+
MSRS.voice=MSRS_Config.Voice
|
|
78322
78467
|
if MSRS_Config.GRPC then
|
|
78323
78468
|
MSRS.provider=MSRS_Config.GRPC.DefaultProvider
|
|
78324
78469
|
if MSRS_Config.GRPC[MSRS_Config.GRPC.DefaultProvider]then
|
|
@@ -78502,7 +78647,7 @@ self.lid=string.format("MSRSQUEUE %s | ",self.alias)
|
|
|
78502
78647
|
return self
|
|
78503
78648
|
end
|
|
78504
78649
|
function MSRSQUEUE:Clear()
|
|
78505
|
-
self:I(self.lid.."
|
|
78650
|
+
self:I(self.lid.."Clearing MSRSQUEUE")
|
|
78506
78651
|
self.queue={}
|
|
78507
78652
|
return self
|
|
78508
78653
|
end
|
|
@@ -78559,7 +78704,7 @@ end
|
|
|
78559
78704
|
transmission.gender=gender
|
|
78560
78705
|
transmission.culture=culture
|
|
78561
78706
|
transmission.voice=voice
|
|
78562
|
-
transmission.
|
|
78707
|
+
transmission.volume=volume
|
|
78563
78708
|
transmission.label=label
|
|
78564
78709
|
transmission.coordinate=coordinate
|
|
78565
78710
|
self:AddTransmission(transmission)
|