diff --git a/Moose Development/Moose/Core/ScheduleDispatcher.lua b/Moose Development/Moose/Core/ScheduleDispatcher.lua index 5eb58e731..8459d3c66 100644 --- a/Moose Development/Moose/Core/ScheduleDispatcher.lua +++ b/Moose Development/Moose/Core/ScheduleDispatcher.lua @@ -326,7 +326,7 @@ function SCHEDULEDISPATCHER:Stop( Scheduler, CallID ) local Schedule = self.Schedule[Scheduler][CallID] -- #SCHEDULEDISPATCHER.ScheduleData -- Only stop when there is a ScheduleID defined for the CallID. So, when the scheduler was stopped before, do nothing. - if Schedule.ScheduleID then + if Schedule and Schedule.ScheduleID then self:T( string.format( "SCHEDULEDISPATCHER stopping scheduler CallID=%s, ScheduleID=%s", tostring( CallID ), tostring( Schedule.ScheduleID ) ) ) diff --git a/Moose Development/Moose/Core/SpawnStatic.lua b/Moose Development/Moose/Core/SpawnStatic.lua index f603450d7..38f3b0f87 100644 --- a/Moose Development/Moose/Core/SpawnStatic.lua +++ b/Moose Development/Moose/Core/SpawnStatic.lua @@ -459,8 +459,9 @@ end function SPAWNSTATIC:SpawnFromZone(Zone, Heading, NewName) -- Spawn the new static at the center of the zone. - local Static = self:SpawnFromPointVec2( Zone:GetPointVec2(), Heading, NewName ) - + --local Static = self:SpawnFromPointVec2( Zone:GetPointVec2(), Heading, NewName ) + local Static = self:SpawnFromCoordinate(Zone:GetCoordinate(), Heading, NewName) + return Static end diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index c6df7238c..ba5582a7e 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -1403,8 +1403,6 @@ function AUFTRAG:NewINTERCEPT(Target) end --- **[AIR]** Create a CAP mission. --- Assinged groups are tasked to execute a CAP mission. This consists of a DCS orbit task combined with an enroute "search and engage in zone" task. --- **Note** that currently DCS only supports *circular* zones for the task. -- @param #AUFTRAG self -- @param Core.Zone#ZONE_RADIUS ZoneCAP Circular CAP zone. Detected targets in this zone will be engaged. -- @param #number Altitude Altitude at which to orbit in feet. Default is 10,000 ft. @@ -1430,7 +1428,7 @@ function AUFTRAG:NewCAP(ZoneCAP, Altitude, Speed, Coordinate, Heading, Leg, Targ mission:_SetLogID() -- DCS task parameters: - mission.engageZone=ZoneCAP + mission.engageZone=ZoneCAP or Coordinate mission.engageTargetTypes=TargetTypes or {"Air"} -- Mission options: @@ -4824,6 +4822,11 @@ function AUFTRAG:CheckGroupsDone() self:T(self.lid..string.format("CheckGroupsDone: Mission is STARTED state %s [FSM=%s] but count of alive OPSGROUP is zero. Mission DONE!", self.status, self:GetState())) return true end + + if (self:IsStarted() or self:IsExecuting()) and self:CountOpsGroups()>0 then + self:T(self.lid..string.format("CheckGroupsDone: Mission is STARTED state %s [FSM=%s] and count of alive OPSGROUP > zero. Mission NOT DONE!", self.status, self:GetState())) + return true + end return true end @@ -6152,8 +6155,16 @@ function AUFTRAG:GetDCSMissionTask() ----------------- -- CAP Mission -- ----------------- - - local DCStask=CONTROLLABLE.EnRouteTaskEngageTargetsInZone(nil, self.engageZone:GetVec2(), self.engageZone:GetRadius(), self.engageTargetTypes, Priority) + + local Vec2 = self.engageZone:GetVec2() + local Radius + if self.engageZone:IsInstanceOf("COORDINATE") then + Radius = UTILS.NMToMeters(20) + else + Radius = self.engageZone:GetRadius() + end + + local DCStask=CONTROLLABLE.EnRouteTaskEngageTargetsInZone(nil, Vec2, Radius, self.engageTargetTypes, Priority) table.insert(self.enrouteTasks, DCStask) @@ -6307,9 +6318,35 @@ function AUFTRAG:GetDCSMissionTask() -- Add enroute task SEAD. Disabled that here because the group enganges everything on its route. --local DCStask=CONTROLLABLE.EnRouteTaskSEAD(nil, self.TargetType) --table.insert(self.enrouteTasks, DCStask) - - self:_GetDCSAttackTask(self.engageTarget, DCStasks) - + + if self.engageZone then + + --local DCStask=CONTROLLABLE.EnRouteTaskSEAD(nil, self.engageTargetTypes) + --table.insert(self.enrouteTasks, DCStask) + self.engageZone:Scan({Object.Category.UNIT},{Unit.Category.GROUND_UNIT}) + local ScanUnitSet = self.engageZone:GetScannedSetUnit() + local SeadUnitSet = SET_UNIT:New() + for _,_unit in pairs (ScanUnitSet.Set) do + local unit = _unit -- Wrapper.Unit#UNTI + if unit and unit:IsAlive() and unit:HasSEAD() then + self:T("Adding UNIT for SEAD: "..unit:GetName()) + local task = CONTROLLABLE.TaskAttackUnit(nil,unit,GroupAttack,AI.Task.WeaponExpend.ALL,1,Direction,self.engageAltitude,4161536) + table.insert(DCStasks, task) + SeadUnitSet:AddUnit(unit) + end + end + self.engageTarget = TARGET:New(SeadUnitSet) + --local OrbitTask = CONTROLLABLE.TaskOrbitCircle(nil,self.engageAltitude,self.missionSpeed,self.engageZone:GetCoordinate()) + --local Point = self.engageZone:GetVec2() + --local OrbitTask = CONTROLLABLE.TaskOrbitCircleAtVec2(nil,Point,self.engageAltitude,self.missionSpeed) + --table.insert(DCStasks, OrbitTask) + + else + + self:_GetDCSAttackTask(self.engageTarget, DCStasks) + + end + elseif self.type==AUFTRAG.Type.STRIKE then -------------------- diff --git a/Moose Development/Moose/Ops/CSAR.lua b/Moose Development/Moose/Ops/CSAR.lua index 09af31eb5..817cd19b9 100644 --- a/Moose Development/Moose/Ops/CSAR.lua +++ b/Moose Development/Moose/Ops/CSAR.lua @@ -2488,8 +2488,8 @@ function CSAR:onafterStart(From, Event, To) self.mash = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterStart() - self.staticmashes = SET_STATIC:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterOnce() - self.zonemashes = SET_ZONE:New():FilterPrefixes(self.mashprefix):FilterOnce() + self.staticmashes = SET_STATIC:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterStart() + self.zonemashes = SET_ZONE:New():FilterPrefixes(self.mashprefix):FilterStart() --[[ if staticmashes:Count() > 0 then diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 5b2ecc4ef..04f090672 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -1414,7 +1414,7 @@ CTLD.FixedWingTypes = { --- CTLD class version. -- @field #string version -CTLD.version="1.3.34" +CTLD.version="1.3.35" --- Instantiate a new CTLD. -- @param #CTLD self @@ -2075,6 +2075,9 @@ function CTLD:_EventHandler(EventData) local _group = event.IniGroup local _unit = event.IniUnit self:_RefreshLoadCratesMenu(_group, _unit) + if self:IsFixedWing(_unit) and self.enableFixedWing then + self:_RefreshDropCratesMenu(_group, _unit) + end end elseif event.id == EVENTS.PlayerLeaveUnit or event.id == EVENTS.UnitLost then -- remove from pilot table @@ -4888,7 +4891,17 @@ function CTLD:_UnloadSingleCrateSet(Group, Unit, setIndex) cObj:SetWasDropped(true) cObj:SetHasMoved(true) end - +local cname = crateObj:GetName() or "Unknown" +local count = #chunk +if needed > 1 then +if count == needed then + self:_SendMessage(string.format("Dropped %d %s.", 1, cname), 10, false, Group) +else + self:_SendMessage(string.format("Dropped %d/%d crate(s) of %s.", count, needed, cname), 15, false, Group) +end +else +self:_SendMessage(string.format("Dropped %d %s(s).", count, cname), 10, false, Group) +end -- Rebuild the cargo list to remove the dropped crates local loadedData = self.Loaded_Cargo[unitName] if loadedData and loadedData.Cargo then @@ -5007,8 +5020,10 @@ function CTLD:_RefreshDropCratesMenu(Group, Unit) -------------------------------------------------------------------- local mAll=MENU_GROUP:New(Group,"Drop ALL crates",dropCratesMenu) MENU_GROUP_COMMAND:New(Group,"Drop",mAll,self._UnloadCrates,self,Group,Unit) - MENU_GROUP_COMMAND:New(Group,"Drop and build",mAll,self._DropAndBuild,self,Group,Unit) - + if not ( self:IsUnitInAir(Unit) and self:IsFixedWing(Unit) ) then + MENU_GROUP_COMMAND:New(Group,"Drop and build",mAll,self._DropAndBuild,self,Group,Unit) + end + self.CrateGroupList=self.CrateGroupList or{} self.CrateGroupList[Unit:GetName()]={} @@ -5029,7 +5044,9 @@ function CTLD:_RefreshDropCratesMenu(Group, Unit) local setIndex=#self.CrateGroupList[Unit:GetName()] local mSet=MENU_GROUP:New(Group,label,dropCratesMenu) MENU_GROUP_COMMAND:New(Group,"Drop",mSet,self._UnloadSingleCrateSet,self,Group,Unit,setIndex) + if not ( self:IsUnitInAir(Unit) and self:IsFixedWing(Unit) ) then MENU_GROUP_COMMAND:New(Group,"Drop and build",mSet,self._DropSingleAndBuild,self,Group,Unit,setIndex) + end i=i+needed else local chunk={} @@ -5156,6 +5173,8 @@ function CTLD:_UnloadSingleTroopByID(Group, Unit, chunkID) foundCargo:SetWasDropped(true) if cType == CTLD_CARGO.Enum.ENGINEERS then self.Engineers = self.Engineers + 1 + local grpname = self.DroppedTroops[self.TroopCounter]:GetName() + self.EngineersInField[self.Engineers] = CTLD_ENGINEERING:New(name, grpname) self:_SendMessage(string.format("Dropped Engineers %s into action!", name), 10, false, Group) else self:_SendMessage(string.format("Dropped Troops %s into action!", name), 10, false, Group) @@ -5971,16 +5990,22 @@ function CTLD:SmokeZoneNearBy(Unit, Flare) for index,cargozone in pairs(zones[i]) do local CZone = cargozone --#CTLD.CargoZone local zonename = CZone.name - local zone = nil + local zone = nil -- Core.Zone#ZONE_RADIUS + local airbasezone = false if i == 4 then zone = UNIT:FindByName(zonename) else zone = ZONE:FindByName(zonename) if not zone then zone = AIRBASE:FindByName(zonename):GetZone() + airbasezone = true end end local zonecoord = zone:GetCoordinate() + -- Avoid smoke/flares on runways + if (i==1 or 1==3) and airbasezone==true and zone:IsInstanceOf("ZONE_BASE") then + zonecoord = zone:GetRandomCoordinate(inner,outer,{land.SurfaceType.LAND}) + end if zonecoord then local active = CZone.active local color = CZone.color diff --git a/Moose Development/Moose/Ops/EasyGCICAP.lua b/Moose Development/Moose/Ops/EasyGCICAP.lua index 89a3198d2..f8def0685 100644 --- a/Moose Development/Moose/Ops/EasyGCICAP.lua +++ b/Moose Development/Moose/Ops/EasyGCICAP.lua @@ -261,7 +261,7 @@ EASYGCICAP = { --- EASYGCICAP class version. -- @field #string version -EASYGCICAP.version="0.1.22" +EASYGCICAP.version="0.1.23" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -785,6 +785,11 @@ function EASYGCICAP:_SetTankerPatrolPoints() self:T(self.lid.."_SetTankerPatrolPoints") for _,_data in pairs(self.ManagedTK) do local data = _data --#EASYGCICAP.CapPoint + self:T("Airbasename = "..data.AirbaseName) + if not self.wings[data.AirbaseName] then + MESSAGE:New(self.lid.."You are trying to create a TANKER point for which there is no wing! "..tostring(data.AirbaseName),30,"CHECK"):ToAllIf(self.debug):ToLog() + return + end local Wing = self.wings[data.AirbaseName][1] -- Ops.Airwing#AIRWING local Coordinate = data.Coordinate local Altitude = data.Altitude @@ -804,6 +809,11 @@ function EASYGCICAP:_SetAwacsPatrolPoints() self:T(self.lid.."_SetAwacsPatrolPoints") for _,_data in pairs(self.ManagedEWR) do local data = _data --#EASYGCICAP.CapPoint + self:T("Airbasename = "..data.AirbaseName) + if not self.wings[data.AirbaseName] then + MESSAGE:New(self.lid.."You are trying to create an AWACS point for which there is no wing! "..tostring(data.AirbaseName),30,"CHECK"):ToAllIf(self.debug):ToLog() + return + end local Wing = self.wings[data.AirbaseName][1] -- Ops.Airwing#AIRWING local Coordinate = data.Coordinate local Altitude = data.Altitude @@ -847,6 +857,11 @@ function EASYGCICAP:_SetReconPatrolPoints() self:T(self.lid.."_SetReconPatrolPoints") for _,_data in pairs(self.ManagedREC) do local data = _data --#EASYGCICAP.CapPoint + self:T("Airbasename = "..data.AirbaseName) + if not self.wings[data.AirbaseName] then + MESSAGE:New(self.lid.."You are trying to create a RECON point for which there is no wing! "..tostring(data.AirbaseName),30,"CHECK"):ToAllIf(self.debug):ToLog() + return + end local Wing = self.wings[data.AirbaseName][1] -- Ops.Airwing#AIRWING local Coordinate = data.Coordinate local Altitude = data.Altitude diff --git a/Moose Development/Moose/Sound/SRS.lua b/Moose Development/Moose/Sound/SRS.lua index c2e9cf152..526094f5a 100644 --- a/Moose Development/Moose/Sound/SRS.lua +++ b/Moose Development/Moose/Sound/SRS.lua @@ -513,7 +513,7 @@ MSRS.Voices = { ["en_GB_Wavenet_F"] = 'en-GB-Wavenet-N', -- [13] FEMALE ["en_GB_Wavenet_O"] = 'en-GB-Wavenet-O', -- [12] MALE ["en_GB_Wavenet_N"] = 'en-GB-Wavenet-N', -- [13] FEMALE - ["en_US_Wavenet_A"] = 'en-US-Wavenet-N', -- [14] MALE + ["en_US_Wavenet_A"] = 'en-US-Wavenet-A', -- [14] MALE ["en_US_Wavenet_B"] = 'en-US-Wavenet-B', -- [15] MALE ["en_US_Wavenet_C"] = 'en-US-Wavenet-C', -- [16] FEMALE ["en_US_Wavenet_D"] = 'en-US-Wavenet-D', -- [17] MALE diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index aaab918bd..c716f72e9 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -449,7 +449,6 @@ AIRBASE.TheChannel = { -- * AIRBASE.Syria.Al_Dumayr -- * AIRBASE.Syria.Al_Qusayr -- * AIRBASE.Syria.Aleppo --- * AIRBASE.Syria.Amman -- * AIRBASE.Syria.An_Nasiriyah -- * AIRBASE.Syria.At_Tanf -- * AIRBASE.Syria.Bassel_Al_Assad @@ -511,7 +510,7 @@ AIRBASE.TheChannel = { -- * AIRBASE.Syria.Wujah_Al_Hajar -- * AIRBASE.Syria.Ben_Gurion -- * AIRBASE.Syria.Hatzor --- * AIRBASE.Syria.Palmashim +-- * AIRBASE.Syria.Palmachim -- * AIRBASE.Syria.Tel_Nof -- * AIRBASE.Syria.Marka -- @@ -523,7 +522,6 @@ AIRBASE.Syria={ ["Al_Dumayr"] = "Al-Dumayr", ["Al_Qusayr"] = "Al Qusayr", ["Aleppo"] = "Aleppo", - ["Amman"] = "Amman", ["An_Nasiriyah"] = "An Nasiriyah", ["At_Tanf"] = "At Tanf", ["Bassel_Al_Assad"] = "Bassel Al-Assad", @@ -555,6 +553,7 @@ AIRBASE.Syria={ ["Kuweires"] = "Kuweires", ["Lakatamia"] = "Lakatamia", ["Larnaca"] = "Larnaca", + ["Marka"] = "Marka", ["Marj_Ruhayyil"] = "Marj Ruhayyil", ["Marj_as_Sultan_North"] = "Marj as Sultan North", ["Marj_as_Sultan_South"] = "Marj as Sultan South", @@ -585,9 +584,8 @@ AIRBASE.Syria={ ["Wujah_Al_Hajar"] = "Wujah Al Hajar", ["Ben_Gurion"] = "Ben Gurion", ["Hatzor"] = "Hatzor", - ["Palmashim"] = "Palmashim", + ["Palmachim"] = "Palmachim", ["Tel_Nof"] = "Tel Nof", - ["Marka"] = "Marka", } --- Airbases of the Mariana Islands map: @@ -691,7 +689,7 @@ AIRBASE.SouthAtlantic={ -- * AIRBASE.Sinai.Bilbeis_Air_Base -- * AIRBASE.Sinai.Bir_Hasanah -- * AIRBASE.Sinai.Birma_Air_Base --- * AIRBASE.Sinai.Borj_El_Arab_International_Airport +-- * AIRBASE.Sinai.Borg_El_Arab_International_Airport -- * AIRBASE.Sinai.Cairo_International_Airport -- * AIRBASE.Sinai.Cairo_West -- * AIRBASE.Sinai.Difarsuwar_Airfield @@ -739,7 +737,7 @@ AIRBASE.Sinai = { ["Bilbeis_Air_Base"] = "Bilbeis Air Base", ["Bir_Hasanah"] = "Bir Hasanah", ["Birma_Air_Base"] = "Birma Air Base", - ["Borj_El_Arab_International_Airport"] = "Borj El Arab International Airport", + ["Borg_El_Arab_International_Airport"] = "Borg El Arab International Airport", ["Cairo_International_Airport"] = "Cairo International Airport", ["Cairo_West"] = "Cairo West", ["Difarsuwar_Airfield"] = "Difarsuwar Airfield", @@ -830,6 +828,12 @@ AIRBASE.Kola = { ["Enontekio"] = "Enontekio", ["Evenes"] = "Evenes", ["Hosio"] = "Hosio", + ["Kilpyavr"] = "Kilpyavr", + ["Afrikanda"] = "Afrikanda", + ["Kalevala"] = "Kalevala", + ["Koshka_Yavr"] = "Koshka Yavr", + ["Poduzhemye"] = "Poduzhemye", + ["Luostari_Pechenga"] = "Luostari Pechenga", } --- Airbases of the Afghanistan map