diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index 15d23ba84..c4a0c8e20 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -229,7 +229,7 @@ SCORING = { ClassID = 0, Players = {}, AutoSave = true, - version = "1.18.2" + version = "1.18.4" } local _SCORINGCoalition = { @@ -248,13 +248,15 @@ local _SCORINGCategory = { --- Creates a new SCORING object to administer the scoring achieved by players. -- @param #SCORING self -- @param #string GameName The name of the game. This name is also logged in the CSV score file. +-- @param #string SavePath (Optional) Path where to save the CSV file, defaults to your **\\Saved Games\\DCS\\Logs** folder. +-- @param #boolean AutoSave (Optional) If passed as `false`, then swith autosave off. -- @return #SCORING self -- @usage -- -- -- Define a new scoring object for the mission Gori Valley. -- ScoringObject = SCORING:New( "Gori Valley" ) -- -function SCORING:New( GameName ) +function SCORING:New( GameName, SavePath, AutoSave ) -- Inherits from BASE local self = BASE:Inherit( self, BASE:New() ) -- #SCORING @@ -317,7 +319,8 @@ function SCORING:New( GameName ) end ) -- Create the CSV file. - self.AutoSave = true + self.AutoSavePath = SavePath + self.AutoSave = AutoSave or true self:OpenCSV( GameName ) return self @@ -1062,7 +1065,7 @@ function SCORING:_EventOnHit( Event ) if PlayerHit.UNIT.ThreatType == nil then PlayerHit.ThreatLevel, PlayerHit.ThreatType = PlayerHit.UNIT:GetThreatLevel() -- if this fails for some reason, set a good default value - if PlayerHit.ThreatType == nil then + if PlayerHit.ThreatType == nil or PlayerHit.ThreatType == "" then PlayerHit.ThreatLevel = 1 PlayerHit.ThreatType = "Unknown" end @@ -1839,10 +1842,11 @@ end function SCORING:OpenCSV( ScoringCSV ) self:F( ScoringCSV ) - if lfs and io and os and self.AutoSave then + if lfs and io and os and self.AutoSave == true then if ScoringCSV then self.ScoringCSV = ScoringCSV - local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. " " .. os.date( "%Y-%m-%d %H-%M-%S" ) .. ".csv" + local path = self.AutoSavePath or lfs.writedir() .. [[Logs\]] + local fdir = path .. self.ScoringCSV .. " " .. os.date( "%Y-%m-%d %H-%M-%S" ) .. ".csv" self.CSVFile, self.err = io.open( fdir, "w+" ) if not self.CSVFile then diff --git a/Moose Development/Moose/Ops/Awacs.lua b/Moose Development/Moose/Ops/Awacs.lua index 1fd51026b..4ddabce63 100644 --- a/Moose Development/Moose/Ops/Awacs.lua +++ b/Moose Development/Moose/Ops/Awacs.lua @@ -508,7 +508,7 @@ do -- @field #AWACS AWACS = { ClassName = "AWACS", -- #string - version = "0.2.63", -- #string + version = "0.2.64", -- #string lid = "", -- #string coalition = coalition.side.BLUE, -- #number coalitiontxt = "blue", -- #string @@ -4639,7 +4639,7 @@ function AWACS:_CheckTaskQueue() -- Check ranges for TAC and MELD -- postions relative to CAP position - + --[[ local targetgrp = entry.Contact.group local position = entry.Contact.position or entry.Cluster.coordinate if targetgrp and targetgrp:IsAlive() and managedgroup then @@ -4664,6 +4664,7 @@ function AWACS:_CheckTaskQueue() end end end + --]] local auftrag = entry.Auftrag -- Ops.Auftrag#AUFTRAG local auftragstatus = "Not Known" @@ -4862,6 +4863,7 @@ function AWACS:_CheckTaskQueue() elseif entry.Status == AWACS.TaskStatus.ASSIGNED then self:T("Open Tasks VID ASSIGNED for GroupID "..entry.AssignedGroupID) -- check TAC/MELD ranges + --[[ local targetgrp = entry.Contact.group local position = entry.Contact.position or entry.Cluster.coordinate if targetgrp and targetgrp:IsAlive() and managedgroup then @@ -4886,6 +4888,7 @@ function AWACS:_CheckTaskQueue() end end end + --]] elseif entry.Status == AWACS.TaskStatus.SUCCESS then self:T("Open Tasks VID success for GroupID "..entry.AssignedGroupID) -- outcomes - player ID'd @@ -5486,6 +5489,7 @@ function AWACS:_TACRangeCall(GID,Contact) local managedgroup = self.ManagedGrps[GID] -- #AWACS.ManagedGroup local contact = Contact.Contact -- Ops.Intel#INTEL.Contact local contacttag = Contact.TargetGroupNaming + local name = managedgroup.GroupName if contact then --and not Contact.TACCallDone then local position = contact.position -- Core.Point#COORDINATE if position then @@ -5494,12 +5498,13 @@ function AWACS:_TACRangeCall(GID,Contact) local grptxt = self.gettext:GetEntry("GROUP",self.locale) local miles = self.gettext:GetEntry("MILES",self.locale) local text = string.format("%s. %s. %s %s, %d %s.",self.callsigntxt,pilotcallsign,contacttag,grptxt,distance,miles) - self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true) + if not self.TacticalSubscribers[name] then + self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true) + end self:_UpdateContactEngagementTag(Contact.CID,Contact.EngagementTag,true,false,AWACS.TaskStatus.EXECUTING) if GID and GID ~= 0 then --local managedgroup = self.ManagedGrps[GID] -- #AWACS.ManagedGroup if managedgroup and managedgroup.Group and managedgroup.Group:IsAlive() then - local name = managedgroup.GroupName if self.TacticalSubscribers[name] then self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true,true) end @@ -5524,6 +5529,7 @@ function AWACS:_MeldRangeCall(GID,Contact) local flightpos = managedgroup.Group:GetCoordinate() local contact = Contact.Contact -- Ops.Intel#INTEL.Contact local contacttag = Contact.TargetGroupNaming or "Bogey" + local name = managedgroup.GroupName if contact then --and not Contact.MeldCallDone then local position = contact.position -- Core.Point#COORDINATE if position then @@ -5535,7 +5541,9 @@ function AWACS:_MeldRangeCall(GID,Contact) end local grptxt = self.gettext:GetEntry("GROUP",self.locale) local text = string.format("%s. %s. %s %s, %s",self.callsigntxt,pilotcallsign,contacttag,grptxt,BRATExt) - self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true) + if not self.TacticalSubscribers[name] then + self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true) + end self:_UpdateContactEngagementTag(Contact.CID,Contact.EngagementTag,true,true,AWACS.TaskStatus.EXECUTING) if GID and GID ~= 0 then --local managedgroup = self.ManagedGrps[GID] -- #AWACS.ManagedGroup @@ -5563,6 +5571,8 @@ function AWACS:_ThreatRangeCall(GID,Contact) local flightpos = managedgroup.Group:GetCoordinate() or managedgroup.LastKnownPosition local contact = Contact.Contact -- Ops.Intel#INTEL.Contact local contacttag = Contact.TargetGroupNaming or "Bogey" + local name = managedgroup.GroupName + local IsSub = self.TacticalSubscribers[name] and true or false if contact then local position = contact.position or contact.group:GetCoordinate() -- Core.Point#COORDINATE if position then @@ -5575,7 +5585,9 @@ function AWACS:_ThreatRangeCall(GID,Contact) local grptxt = self.gettext:GetEntry("GROUP",self.locale) local thrt = self.gettext:GetEntry("THREAT",self.locale) local text = string.format("%s. %s. %s %s, %s. %s",self.callsigntxt,pilotcallsign,contacttag,grptxt, thrt, BRATExt) - self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true) + if IsSub == false then + self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true) + end if GID and GID ~= 0 then --local managedgroup = self.ManagedGrps[GID] -- #AWACS.ManagedGroup if managedgroup and managedgroup.Group and managedgroup.Group:IsAlive() then @@ -5600,11 +5612,17 @@ function AWACS:_MergedCall(GID) local pilotcallsign = self:_GetCallSign(nil,GID) local merge = self.gettext:GetEntry("MERGED",self.locale) local text = string.format("%s. %s. %s.",self.callsigntxt,pilotcallsign,merge) - self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true) + local managedgroup = self.ManagedGrps[GID] -- #AWACS.ManagedGroup + local name + if managedgroup then + name = managedgroup.GroupName or "none" + end + if not self.TacticalSubscribers[name] then + self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true) + end if GID and GID ~= 0 then local managedgroup = self.ManagedGrps[GID] -- #AWACS.ManagedGroup - if managedgroup and managedgroup.Group and managedgroup.Group:IsAlive() then - local name = managedgroup.GroupName + if managedgroup and managedgroup.Group and managedgroup.Group:IsAlive() then if self.TacticalSubscribers[name] then self:_NewRadioEntry(text,text,GID,true,self.debug,true,false,true,true) end diff --git a/Moose Development/Moose/Sound/SRS.lua b/Moose Development/Moose/Sound/SRS.lua index 0d3315dcc..b27564a62 100644 --- a/Moose Development/Moose/Sound/SRS.lua +++ b/Moose Development/Moose/Sound/SRS.lua @@ -824,7 +824,7 @@ function MSRS:SetVoiceProvider(Voice, Provider) self:F( {Voice=Voice, Provider=Provider} ) self.poptions=self.poptions or {} - self.poptions[Provider or self:GetProvider()]=Voice + self.poptions[Provider or self:GetProvider()].voice=Voice return self end