From 7865be43bb4098df0a03e5665e02fd36a246baf3 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 1 Dec 2022 13:27:58 +0100 Subject: [PATCH 1/4] * Minor fixes --- Moose Development/Moose/Core/Set.lua | 2 +- Moose Development/Moose/Functional/RAT.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index d70bc20e5..f3b227e24 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -179,7 +179,7 @@ do -- SET_BASE return Names end - --- Gets a list of the Objects in the Set. + --- Return a table of the Objects in the Set. -- @param #SET_BASE self -- @return #SET_BASE self function SET_BASE:GetSetObjects() -- R2.3 diff --git a/Moose Development/Moose/Functional/RAT.lua b/Moose Development/Moose/Functional/RAT.lua index a54533eeb..081132413 100644 --- a/Moose Development/Moose/Functional/RAT.lua +++ b/Moose Development/Moose/Functional/RAT.lua @@ -3492,7 +3492,7 @@ function RAT:Status(message, forID) local fuel=group:GetFuel()*100.0 local airborne=group:InAir() local coords=group:GetCoordinate() - local alt=coords.y + local alt=coords.y or 1000 --local vel=group:GetVelocityKMH() local departure=ratcraft.departure:GetName() local destination=ratcraft.destination:GetName() From b29b9f1b2c71caef118ded5eaf9e56828379a7a3 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Thu, 1 Dec 2022 21:32:19 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 69ab8403a..aec3cbd3a 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Pene has kindly created a [tutorial series for MOOSE](https://youtube.com/playli -## [MOOSE on Discord](https://discord.gg/yBPfxC6) +## [MOOSE on Discord](https://discord.gg/aQtjcR94Qf) MOOSE has a living (chat and video) community of users, beta testers and contributors. The gathering point is a service provided by discord.com. If you want to join this community, just click Discord and you'll be on board in no time. From 37b1e7366c1f1a7e4003e2bedcc4e59ba91d1255 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 2 Dec 2022 16:39:05 +0100 Subject: [PATCH 3/4] *smaller fixes --- Moose Development/Moose/Core/Message.lua | 29 ++++++++++++++------ Moose Development/Moose/Core/SpawnStatic.lua | 2 +- Moose Development/Moose/Ops/CTLD.lua | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Moose Development/Moose/Core/Message.lua b/Moose Development/Moose/Core/Message.lua index 780446109..45c9cd968 100644 --- a/Moose Development/Moose/Core/Message.lua +++ b/Moose Development/Moose/Core/Message.lua @@ -98,7 +98,7 @@ function MESSAGE:New( MessageText, MessageDuration, MessageCategory, ClearScreen self.MessageType = nil - -- When no MessageCategory is given, we don't show it as a title... + -- When no MessageCategory is given, we don't show it as a title... if MessageCategory and MessageCategory ~= "" then if MessageCategory:sub( -1 ) ~= "\n" then self.MessageCategory = MessageCategory .. ": " @@ -204,14 +204,14 @@ function MESSAGE:ToClient( Client, Settings ) local Unit = Client:GetClient() if self.MessageDuration ~= 0 then - local ClientGroupID = Client:GetClientGroupID() - self:T( self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$","") .. " / " .. self.MessageDuration ) - --trigger.action.outTextForGroup( ClientGroupID, self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration , self.ClearScreen) - trigger.action.outTextForUnit( Unit:GetID(), self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration , self.ClearScreen) - end - end - - return self + local ClientGroupID = Client:GetClientGroupID() + self:T( self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$","") .. " / " .. self.MessageDuration ) + --trigger.action.outTextForGroup( ClientGroupID, self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration , self.ClearScreen) + trigger.action.outTextForUnit( Unit:GetID(), self.MessageCategory .. self.MessageText:gsub("\n$",""):gsub("\n$",""), self.MessageDuration , self.ClearScreen) + end + end + + return self end --- Sends a MESSAGE to a Group. @@ -443,3 +443,14 @@ function MESSAGE:ToLog() return self end + +--- Sends a MESSAGE to DCS log file if the given Condition is true. +-- @param #MESSAGE self +-- @return #MESSAGE self +function MESSAGE:ToLogIf( Condition ) + + if Condition and Condition == true then + env.info(self.MessageCategory .. self.MessageText:gsub( "\n$", "" ):gsub( "\n$", "" )) + end + return self +end diff --git a/Moose Development/Moose/Core/SpawnStatic.lua b/Moose Development/Moose/Core/SpawnStatic.lua index d73336464..4420f70ed 100644 --- a/Moose Development/Moose/Core/SpawnStatic.lua +++ b/Moose Development/Moose/Core/SpawnStatic.lua @@ -275,7 +275,7 @@ end --- Initialize as dead. -- @param #SPAWNSTATIC self --- @param #boolean IsCargo If true, this static is dead. +-- @param #boolean IsDead If true, this static is dead. -- @return #SPAWNSTATIC self function SPAWNSTATIC:InitDead(IsDead) self.InitStaticDead=IsDead diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index e370b430e..145c2c9e0 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -3690,7 +3690,7 @@ function CTLD:_AddRadioBeacon(Name, Sound, Mhz, Modulation, IsShip, IsDropped) local Sound = "l10n/DEFAULT/"..Sound trigger.action.radioTransmission(Sound, ZoneVec3, Modulation, false, Frequency, 1000) -- Beacon in MP only runs for 30secs straight elseif Zone then - local ZoneCoord = Zone:GetCoordinate() + local ZoneCoord = Zone:GetCoordinate(2) local ZoneVec3 = ZoneCoord:GetVec3() local Frequency = Mhz * 1000000 -- Freq in Hertz local Sound = "l10n/DEFAULT/"..Sound From 508e36d3274a8478aa6a72321777d155ff3eb8ea Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 3 Dec 2022 14:37:01 +0100 Subject: [PATCH 4/4] #CTLD Fix for Beacon Zone disappearing too fast --- Moose Development/Moose/Ops/CTLD.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 145c2c9e0..e36752b3f 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -3522,7 +3522,12 @@ function CTLD:AddCTLDZone(Name, Type, Color, Active, HasBeacon, Shiplength, Ship ctldzone.name = Name or "NONE" ctldzone.type = Type or CTLD.CargoZoneType.MOVE -- #CTLD.CargoZoneType ctldzone.hasbeacon = HasBeacon or false - + + if Type == CTLD.CargoZoneType.BEACON then + self.droppedbeaconref[ctldzone.name] = zone:GetCoordinate() + ctldzone.timestamp = timer.getTime() + end + if HasBeacon then ctldzone.fmbeacon = self:_GetFMBeacon(Name) ctldzone.uhfbeacon = self:_GetUHFBeacon(Name) @@ -3611,7 +3616,7 @@ function CTLD:CheckDroppedBeacons() for _,_beacon in pairs (self.droppedBeacons) do local beacon = _beacon -- #CTLD.CargoZone - if not beacon.timestamp then beacon.timestamp = timer.getTime() end + if not beacon.timestamp then beacon.timestamp = timer.getTime() + timeout end local T0 = beacon.timestamp if timer.getTime() - T0 > timeout then local name = beacon.name @@ -3686,15 +3691,19 @@ function CTLD:_AddRadioBeacon(Name, Sound, Mhz, Modulation, IsShip, IsDropped) if IsDropped and Zone then local ZoneCoord = Zone local ZoneVec3 = ZoneCoord:GetVec3() - local Frequency = Mhz * 1000000 -- Freq in Hertz + local Frequency = string.format("%09d",Mhz * 1000000) -- Freq in Hertz local Sound = "l10n/DEFAULT/"..Sound trigger.action.radioTransmission(Sound, ZoneVec3, Modulation, false, Frequency, 1000) -- Beacon in MP only runs for 30secs straight + --local status = string.format("***** Beacon added Freq %s Mod %s", Mhz, UTILS.GetModulationName(Modulation)) + --MESSAGE:New(status,10,"Debug"):ToLogIf(self.debug) elseif Zone then local ZoneCoord = Zone:GetCoordinate(2) local ZoneVec3 = ZoneCoord:GetVec3() - local Frequency = Mhz * 1000000 -- Freq in Hertz + local Frequency = string.format("%09d",Mhz * 1000000) -- Freq in Hertz local Sound = "l10n/DEFAULT/"..Sound trigger.action.radioTransmission(Sound, ZoneVec3, Modulation, false, Frequency, 1000) -- Beacon in MP only runs for 30secs straight + --local status = string.format("***** Beacon added Freq %s Mod %s", Mhz, UTILS.GetModulationName(Modulation)) + --MESSAGE:New(status,10,"Debug"):ToLogIf(self.debug) end return self end