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.
--
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
Global(s)
Type Scoring
Type SCORING
The Scoring class
Field(s)
- #number SCORING.ClassID
- #string SCORING.ClassName
- 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: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: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
-
Wrapper.Group#GROUP ScoreGroup: The Group for which each Unit a Score is given. -
#number Score: The Score value.
-
- SCORING:SetScoreUnit(ScoreUnit, Score)
-
Specify a special additional score for a Unit.
Parameters
-
Wrapper.Unit#UNIT ScoreUnit: The Unit for which the Score is given. -
#number Score: The Score value.
-
- SCORING:_AddMissionScore(Mission, PlayerUnit, Text, Score)
-
Registers Mission Scores for possible multiple players that contributed in the Mission.
Parameters
-
Tasking.Mission#MISSION Mission: -
Wrapper.Unit#UNIT PlayerUnit: -
#string Text: -
#number Score:
-
- SCORING:_AddMissionTaskScore(Mission, PlayerUnit, Text, Score)
-
Registers Scores the players completing a Mission Task.
Parameters
-
Tasking.Mission#MISSION Mission: -
Wrapper.Unit#UNIT PlayerUnit: -
#string Text: -
#number Score:
-
- SCORING:_AddPlayerFromUnit(UnitData)
-
Add a new player entering a Unit.
Parameter
-
Wrapper.Unit#UNIT UnitData:
-
- SCORING:_EventOnDeadOrCrash(Event)
-
Track DEAD or CRASH events for the scoring.
Parameter
-
Core.Event#EVENTDATA Event:
-
- SCORING:_EventOnHit(Event)
-
Handles the OnHit event for the scoring.
Parameter
-
Core.Event#EVENTDATA Event:
-
- 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 ...