Module Scoring
Scoring system for MOOSE.
This scoring class calculates the hits and kills that players make within a simulation session. Scoring is calculated using a defined algorithm. 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.
Global(s)
| ClientGroup | |
| 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:_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
-
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 ...