Module Scoring

Single-Player:Yes / Multi-Player:Yes / Core:Yes -- Administer the scoring of player achievements, and create a CSV file logging the scoring events for use at team or squadron websites.

-- Banner Image


1) Scoring#SCORING class, extends Base#BASE

The #SCORING class administers the scoring of player achievements, and creates a CSV file logging the scoring events for use at team or squadron websites.

The scores are calculated by scoring the hits and kills of objects that players make, which are Unit and Statics can be defined for which scores are also granted when a Scenery object is hit and killed within that Zone.

Scores are calculated based on the threat level of the objects involved. The threat level of a unit can be a value between 0 and 10. A calculated score takes the threat level of the target divided by the threat level of the player unit. This provides a value between 0.1 and 10. The stronger or the higher the threat of the player unit, the less score will be given in kills.

That value can then be multiplied by a multiplier. A multiplier can be set for enemies and friendlies kills.

Special scores can be given to specific units. These scores are added when player(s) kill that unit.

With a small change in MissionScripting.lua, the scoring can also be logged in a CSV file, that can then be uploaded to a database or a BI tool to publish the scoring results to the player community.

1.1) Set the kill score or penalty multiplier

Score multipliers can be set for scores granted when enemies or friendlies are killed. Use the method SCORING.SetMultiplierKillScore() to set the multiplier of enemy kills (positive kills). Use the method SCORING.SetMultiplierKillPenalty() to set the multiplier of friendly kills (negative kills).

1.2) Define special targets in the mission that will give extra scores.

Special targets can be set that will give extra scores to the players when these are killed. Use the method SCORING.SetScoreUnit() to specify a special additional score for a specific Unit. Use the method SCORING.SetScoreGroup() to specify a special additional score for a specific Group.


API CHANGE HISTORY

The underlying change log documents the API changes. Please read this carefully. The following notation is used:

  • Added parts are expressed in bold type face.
  • Removed parts are expressed in italic type face.

Hereby the change log:

2017-02-26: Initial class and API.


AUTHORS and CONTRIBUTIONS

Contributions:

  • Wingthor: Testing & Advice.
  • Dutch-Baron: Testing & Advice.
  • **Whisper: Testing.

Authors:

  • FlightControl: Concept, Design & Programming.

Global(s)

SCORING
nHours
nMins
nSecs

Type SCORING

SCORING.AllScoresMenu
SCORING.ClassID
SCORING.ClassName
SCORING:CloseCSV()
SCORING.Menu
SCORING.MultiplierKillPenalty
SCORING.MultiplierKillScore
SCORING:New(GameName)

Creates a new SCORING object to administer the scoring achieved by players.

SCORING:OpenCSV(ScoringCSV)

Opens a score CSV file to log the scores.

SCORING.Players

A collection of the current players that have joined the game.

SCORING:ReportScoreAll()
SCORING:ReportScorePlayer()
SCORING.RunTime
SCORING:ScoreCSV(PlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType)

Registers a score for a player.

SCORING:ScoreMenu()

Creates a score radio menu.

SCORING.ScoringCSV
SCORING:SecondsToClock(sSeconds)
SCORING:SetMultiplierKillPenalty(Multiplier)

Set the multiplier for scoring penalty kills (friendly kills).

SCORING:SetMultiplierKillScore(Multiplier)

Set the multiplier for scoring valid kills (enemy kills).

SCORING:SetScoreGroup(ScoreGroup, Score)

Specify a special additional score for a Group.

SCORING:SetScoreUnit(ScoreUnit, Score)

Specify a special additional score for a Unit.

SCORING:_AddMissionScore(Mission, PlayerUnit, Text, Score)

Registers Mission Scores for possible multiple players that contributed in the Mission.

SCORING:_AddMissionTaskScore(Mission, PlayerUnit, Text, Score)

Registers Scores the players completing a Mission Task.

SCORING:_AddPlayerFromUnit(UnitData)

Add a new player entering a Unit.

SCORING:_EventOnDeadOrCrash(Event)

Track DEAD or CRASH events for the scoring.

SCORING:_EventOnHit(Event)

Handles the OnHit event for the scoring.

SCORING:_FollowPlayersScheduled()

Follows new players entering Clients within the DCSRTE.

Global(s)

#SCORING SCORING
nHours
nMins
nSecs

Type Scoring

Type SCORING

The Scoring class

Field(s)

SCORING.AllScoresMenu
#number SCORING.ClassID
#string SCORING.ClassName
SCORING:CloseCSV()
SCORING.Menu
SCORING.MultiplierKillPenalty
SCORING.MultiplierKillScore
SCORING:New(GameName)

Creates a new SCORING object to administer the scoring achieved by players.

Parameter

  • #string GameName : The name of the game. This name is also logged in the CSV score file.

Return value

#SCORING: self

Usage:

-- Define a new scoring object for the mission Gori Valley.
ScoringObject = SCORING:New( "Gori Valley" )
SCORING:OpenCSV(ScoringCSV)

Opens a score CSV file to log the scores.

Parameter

  • #string ScoringCSV :

Return value

#SCORING: self

Usage:

-- Open a new CSV file to log the scores of the game Gori Valley. Let the name of the CSV file begin with "Player Scores".
ScoringObject = SCORING:New( "Gori Valley" )
ScoringObject:OpenCSV( "Player Scores" )
SCORING.Players

A collection of the current players that have joined the game.

SCORING:ReportScoreAll()
SCORING:ReportScorePlayer()
SCORING.RunTime
SCORING:ScoreCSV(PlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType)

Registers a score for a player.

Parameters

  • #string PlayerName : The name of the player.

  • #string ScoreType : The type of the score.

  • #string ScoreTimes : The amount of scores achieved.

  • #string ScoreAmount : The score given.

  • #string PlayerUnitName : The unit name of the player.

  • #string PlayerUnitCoalition : The coalition of the player unit.

  • #string PlayerUnitCategory : The category of the player unit.

  • #string PlayerUnitType : The type of the player unit.

  • #string TargetUnitName : The name of the target unit.

  • #string TargetUnitCoalition : The coalition of the target unit.

  • #string TargetUnitCategory : The category of the target unit.

  • #string TargetUnitType : The type of the target unit.

Return value

#SCORING: self

SCORING:ScoreMenu()

Creates a score radio menu.

Can be accessed using Radio -> F10.

Return value

#SCORING: self

SCORING.ScoringCSV
SCORING:SecondsToClock(sSeconds)

Parameter

  • sSeconds :

SCORING:SetMultiplierKillPenalty(Multiplier)

Set the multiplier for scoring penalty kills (friendly kills).

A calculated score is a value between 0.1 and 10. The multiplier magnifies the scores given to the players.

Parameter

  • #number Multiplier : The multiplier of the score given.

SCORING:SetMultiplierKillScore(Multiplier)

Set the multiplier for scoring valid kills (enemy kills).

A calculated score is a value between 0.1 and 10. The multiplier magnifies the scores given to the players.

Parameter

  • #number Multiplier : The multiplier of the score given.

SCORING:SetScoreGroup(ScoreGroup, Score)

Specify a special additional score for a Group.

Parameters

SCORING:SetScoreUnit(ScoreUnit, Score)

Specify a special additional score for a Unit.

Parameters

SCORING:_AddMissionScore(Mission, PlayerUnit, Text, Score)

Registers Mission Scores for possible multiple players that contributed in the Mission.

Parameters

SCORING:_AddMissionTaskScore(Mission, PlayerUnit, Text, Score)

Registers Scores the players completing a Mission Task.

Parameters

SCORING:_AddPlayerFromUnit(UnitData)

Add a new player entering a Unit.

Parameter

SCORING:_EventOnDeadOrCrash(Event)

Track DEAD or CRASH events for the scoring.

Parameter

SCORING:_EventOnHit(Event)

Handles the OnHit event for the scoring.

Parameter

SCORING:_FollowPlayersScheduled()

Follows new players entering Clients within the DCSRTE.

TODO: Need to see if i can catch this also with an event. It will eliminate the schedule ...