From 7983621f8eb1ff619741480f9e5b8419ea861445 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 6 Nov 2022 11:27:59 +0100 Subject: [PATCH 1/3] #SCORING * Added option to switch AutoSave --- .../Moose/Functional/Scoring.lua | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index 70e5de975..2a7ef471a 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -12,7 +12,7 @@ -- * Score the hits and destroys of units. -- * Score the hits and destroys of statics. -- * Score the hits and destroys of scenery. --- * Log scores into a CSV file. +-- * (optional) Log scores into a CSV file. -- * Connect to a remote server using JSON and IP. -- -- === @@ -225,6 +225,7 @@ SCORING = { ClassName = "SCORING", ClassID = 0, Players = {}, + AutoSave = true, } local _SCORINGCoalition = { @@ -306,6 +307,7 @@ function SCORING:New( GameName ) end ) -- Create the CSV file. + self.AutoSave = true self:OpenCSV( GameName ) return self @@ -1748,7 +1750,7 @@ end function SCORING:OpenCSV( ScoringCSV ) self:F( ScoringCSV ) - if lfs and io and os then + if lfs and io and os and self.AutoSave then if ScoringCSV then self.ScoringCSV = ScoringCSV local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. " " .. os.date( "%Y-%m-%d %H-%M-%S" ) .. ".csv" @@ -1828,7 +1830,7 @@ function SCORING:ScoreCSV( PlayerName, TargetPlayerName, ScoreType, ScoreTimes, TargetUnitType = TargetUnitType or "" TargetUnitName = TargetUnitName or "" - if lfs and io and os then + if lfs and io and os and self.AutoSave then self.CSVFile:write( '"' .. self.GameName .. '"' .. ',' .. '"' .. self.RunTime .. '"' .. ',' .. @@ -1852,9 +1854,20 @@ function SCORING:ScoreCSV( PlayerName, TargetPlayerName, ScoreType, ScoreTimes, end end +--- Close CSV file +-- @param #SCORING self +-- @return #SCORING self function SCORING:CloseCSV() - if lfs and io and os then + if lfs and io and os and self.AutoSave then self.CSVFile:close() end end +--- Registers a score for a player. +-- @param #SCORING self +-- @param #boolean OnOff Switch saving to CSV on = true or off = false +-- @return #SCORING self +function SCORING:SwitchAutoSave(OnOff) + self.AutoSave = OnOff + return self +end From 88fc501c248666fabe8d812eef5476ee024e73c0 Mon Sep 17 00:00:00 2001 From: TommyC81 Date: Sun, 6 Nov 2022 22:33:44 +0400 Subject: [PATCH 2/3] Update Range.lua (#1825) Add meter text to RANGE bombing result. --- Moose Development/Moose/Functional/Range.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Functional/Range.lua b/Moose Development/Moose/Functional/Range.lua index 1826185b3..20d879ee0 100644 --- a/Moose Development/Moose/Functional/Range.lua +++ b/Moose Development/Moose/Functional/Range.lua @@ -2259,7 +2259,7 @@ function RANGE:onafterImpact( From, Event, To, result, player ) end -- Send message to player. - local text = string.format( "%s, impact %03d° for %d ft", player.playername, result.radial, UTILS.MetersToFeet( result.distance ) ) + local text = string.format( "%s, impact %03d° for %d ft (%d m)", player.playername, result.radial, UTILS.MetersToFeet( result.distance ), result.distance ) if targetname then text = text .. string.format( " from bulls of target %s.", targetname ) else From be01567a1be746ac8b4e7ba7579af3c75e472bf9 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 7 Nov 2022 11:19:52 +0100 Subject: [PATCH 3/3] CTLD - added Bronco (#1828) Added data for the Bronco-OV-10A - needs further additions to ensure to work, as this is a plane, not a chopper #1827 --- Moose Development/Moose/Ops/CTLD.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index bd52b2742..d18e4d32f 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -1072,11 +1072,12 @@ CTLD.UnitTypes = { --Actually it's longer, but the center coord is off-center of the model. ["UH-60L"] = {type="UH-60L", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats ["AH-64D_BLK_II"] = {type="AH-64D_BLK_II", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 17, cargoweightlimit = 200}, -- 2 ppl **outside** the helo -} + ["Bronco-OV-10A"] = {type="Bronco-OV-10A", crates= false, troops=true, cratelimit = 0, trooplimit = 5, length = 13, cargoweightlimit = 1450}, + } --- CTLD class version. -- @field #string version -CTLD.version="1.0.17" +CTLD.version="1.0.18" --- Instantiate a new CTLD. -- @param #CTLD self