diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index c77a3088a..c143fa7ba 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -553,6 +553,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) self.Players[PlayerName] = {} self.Players[PlayerName].Hit = {} self.Players[PlayerName].Destroy = {} + self.Players[PlayerName].Goals = {} self.Players[PlayerName].Mission = {} -- for CategoryID, CategoryName in pairs( SCORINGCategory ) do @@ -944,7 +945,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) if Event.IniDCSUnit then - TargetUnit = Event.IniDCSUnit + TargetUnit = Event.IniUnit TargetUnitName = Event.IniDCSUnitName TargetGroup = Event.IniDCSGroup TargetGroupName = Event.IniDCSGroupName @@ -990,11 +991,10 @@ function SCORING:_EventOnDeadOrCrash( Event ) TargetDestroy.ScoreDestroy = TargetDestroy.ScoreDestroy or 0 TargetDestroy.Penalty = TargetDestroy.Penalty or 0 TargetDestroy.PenaltyDestroy = TargetDestroy.PenaltyDestroy or 0 - TargetDestroy.UNIT = TargetDestroy.UNIT or Player.Hit[TargetCategory][TargetUnitName].UNIT if TargetCoalition then if InitCoalition == TargetCoalition then - local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel() + local ThreatLevelTarget, ThreatTypeTarget = TargetUnit:GetThreatLevel() local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1 local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 ) self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } ) @@ -1025,7 +1025,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:ScoreCSV( PlayerName, "DESTROY_PENALTY", 1, ThreatPenalty, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else - local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel() + local ThreatLevelTarget, ThreatTypeTarget = TargetUnit:GetThreatLevel() local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1 local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 ) @@ -1055,7 +1055,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) end self:ScoreCSV( PlayerName, "DESTROY_SCORE", 1, ThreatScore, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) - local UnitName = TargetDestroy.UNIT:GetName() + local UnitName = TargetUnit:GetName() local Score = self.ScoringObjects[UnitName] if Score then Player.Score = Player.Score + Score @@ -1075,7 +1075,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:E( { ScoringZone = ScoreZoneData } ) local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE local Score = ScoreZoneData.Score - if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then + if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then Player.Score = Player.Score + Score TargetDestroy.Score = TargetDestroy.Score + Score MESSAGE @@ -1096,7 +1096,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:E( { ScoringZone = ScoreZoneData } ) local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE local Score = ScoreZoneData.Score - if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then + if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then Player.Score = Player.Score + Score TargetDestroy.Score = TargetDestroy.Score + Score MESSAGE @@ -1264,7 +1264,7 @@ end -- @param #SCORING self -- @param #string PlayerName The name of the player. -- @return #string The report. -function SCORING:ReportDetailedPlayerMissions( PlayerName ) +function SCORING:ReportDetailedPlayerGoals( PlayerName ) local ScoreMessage = "" local PlayerScore = 0 diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua index 565435c5b..b7791702e 100644 --- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua +++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20170303_1333' ) +env.info( 'Moose Generation Timestamp: 20170304_1458' ) local base = _G Include = {} @@ -18564,6 +18564,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) self.Players[PlayerName] = {} self.Players[PlayerName].Hit = {} self.Players[PlayerName].Destroy = {} + self.Players[PlayerName].Goals = {} self.Players[PlayerName].Mission = {} -- for CategoryID, CategoryName in pairs( SCORINGCategory ) do @@ -18955,7 +18956,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) if Event.IniDCSUnit then - TargetUnit = Event.IniDCSUnit + TargetUnit = Event.IniUnit TargetUnitName = Event.IniDCSUnitName TargetGroup = Event.IniDCSGroup TargetGroupName = Event.IniDCSGroupName @@ -19001,11 +19002,10 @@ function SCORING:_EventOnDeadOrCrash( Event ) TargetDestroy.ScoreDestroy = TargetDestroy.ScoreDestroy or 0 TargetDestroy.Penalty = TargetDestroy.Penalty or 0 TargetDestroy.PenaltyDestroy = TargetDestroy.PenaltyDestroy or 0 - TargetDestroy.UNIT = TargetDestroy.UNIT or Player.Hit[TargetCategory][TargetUnitName].UNIT if TargetCoalition then if InitCoalition == TargetCoalition then - local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel() + local ThreatLevelTarget, ThreatTypeTarget = TargetUnit:GetThreatLevel() local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1 local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 ) self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } ) @@ -19036,7 +19036,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:ScoreCSV( PlayerName, "DESTROY_PENALTY", 1, ThreatPenalty, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else - local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel() + local ThreatLevelTarget, ThreatTypeTarget = TargetUnit:GetThreatLevel() local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1 local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 ) @@ -19066,7 +19066,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) end self:ScoreCSV( PlayerName, "DESTROY_SCORE", 1, ThreatScore, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) - local UnitName = TargetDestroy.UNIT:GetName() + local UnitName = TargetUnit:GetName() local Score = self.ScoringObjects[UnitName] if Score then Player.Score = Player.Score + Score @@ -19086,7 +19086,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:E( { ScoringZone = ScoreZoneData } ) local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE local Score = ScoreZoneData.Score - if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then + if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then Player.Score = Player.Score + Score TargetDestroy.Score = TargetDestroy.Score + Score MESSAGE @@ -19107,7 +19107,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:E( { ScoringZone = ScoreZoneData } ) local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE local Score = ScoreZoneData.Score - if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then + if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then Player.Score = Player.Score + Score TargetDestroy.Score = TargetDestroy.Score + Score MESSAGE @@ -19275,7 +19275,7 @@ end -- @param #SCORING self -- @param #string PlayerName The name of the player. -- @return #string The report. -function SCORING:ReportDetailedPlayerMissions( PlayerName ) +function SCORING:ReportDetailedPlayerGoals( PlayerName ) local ScoreMessage = "" local PlayerScore = 0 diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 565435c5b..b7791702e 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20170303_1333' ) +env.info( 'Moose Generation Timestamp: 20170304_1458' ) local base = _G Include = {} @@ -18564,6 +18564,7 @@ function SCORING:_AddPlayerFromUnit( UnitData ) self.Players[PlayerName] = {} self.Players[PlayerName].Hit = {} self.Players[PlayerName].Destroy = {} + self.Players[PlayerName].Goals = {} self.Players[PlayerName].Mission = {} -- for CategoryID, CategoryName in pairs( SCORINGCategory ) do @@ -18955,7 +18956,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) if Event.IniDCSUnit then - TargetUnit = Event.IniDCSUnit + TargetUnit = Event.IniUnit TargetUnitName = Event.IniDCSUnitName TargetGroup = Event.IniDCSGroup TargetGroupName = Event.IniDCSGroupName @@ -19001,11 +19002,10 @@ function SCORING:_EventOnDeadOrCrash( Event ) TargetDestroy.ScoreDestroy = TargetDestroy.ScoreDestroy or 0 TargetDestroy.Penalty = TargetDestroy.Penalty or 0 TargetDestroy.PenaltyDestroy = TargetDestroy.PenaltyDestroy or 0 - TargetDestroy.UNIT = TargetDestroy.UNIT or Player.Hit[TargetCategory][TargetUnitName].UNIT if TargetCoalition then if InitCoalition == TargetCoalition then - local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel() + local ThreatLevelTarget, ThreatTypeTarget = TargetUnit:GetThreatLevel() local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1 local ThreatPenalty = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyPenalty / 10 ) self:E( { ThreatLevel = ThreatPenalty, ThreatLevelTarget = ThreatLevelTarget, ThreatTypeTarget = ThreatTypeTarget, ThreatLevelPlayer = ThreatLevelPlayer } ) @@ -19036,7 +19036,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:ScoreCSV( PlayerName, "DESTROY_PENALTY", 1, ThreatPenalty, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) else - local ThreatLevelTarget, ThreatTypeTarget = TargetDestroy.UNIT:GetThreatLevel() + local ThreatLevelTarget, ThreatTypeTarget = TargetUnit:GetThreatLevel() local ThreatLevelPlayer = Player.UNIT:GetThreatLevel() / 10 + 1 local ThreatScore = math.ceil( ( ThreatLevelTarget / ThreatLevelPlayer ) * self.ScaleDestroyScore / 10 ) @@ -19066,7 +19066,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) end self:ScoreCSV( PlayerName, "DESTROY_SCORE", 1, ThreatScore, InitUnitName, InitUnitCoalition, InitUnitCategory, InitUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType ) - local UnitName = TargetDestroy.UNIT:GetName() + local UnitName = TargetUnit:GetName() local Score = self.ScoringObjects[UnitName] if Score then Player.Score = Player.Score + Score @@ -19086,7 +19086,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:E( { ScoringZone = ScoreZoneData } ) local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE local Score = ScoreZoneData.Score - if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then + if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then Player.Score = Player.Score + Score TargetDestroy.Score = TargetDestroy.Score + Score MESSAGE @@ -19107,7 +19107,7 @@ function SCORING:_EventOnDeadOrCrash( Event ) self:E( { ScoringZone = ScoreZoneData } ) local ScoreZone = ScoreZoneData.ScoreZone -- Core.Zone#ZONE_BASE local Score = ScoreZoneData.Score - if ScoreZone:IsVec2InZone( TargetDestroy.UNIT:GetVec2() ) then + if ScoreZone:IsVec2InZone( TargetUnit:GetVec2() ) then Player.Score = Player.Score + Score TargetDestroy.Score = TargetDestroy.Score + Score MESSAGE @@ -19275,7 +19275,7 @@ end -- @param #SCORING self -- @param #string PlayerName The name of the player. -- @return #string The report. -function SCORING:ReportDetailedPlayerMissions( PlayerName ) +function SCORING:ReportDetailedPlayerGoals( PlayerName ) local ScoreMessage = "" local PlayerScore = 0 diff --git a/Moose Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100 - Scoring of Statics.miz b/Moose Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100 - Scoring of Statics.miz index e9c7b30ee..07d3ee53e 100644 Binary files a/Moose Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100 - Scoring of Statics.miz and b/Moose Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100 - Scoring of Statics.miz differ diff --git a/Moose Test Missions/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.miz b/Moose Test Missions/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.miz index 034819401..a729ae25e 100644 Binary files a/Moose Test Missions/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.miz and b/Moose Test Missions/SCO - Scoring/SCO-101 - Scoring Client to Client/SCO-101 - Scoring Client to Client.miz differ