Banner Image

Module Functional.Scoring

Functional - Administer the scoring of player achievements, file and log the scoring events for use at websites.


Features:

  • Set the scoring scales based on threat level.
  • Positive scores and negative scores.
  • A contribution model to score achievements.
  • Score goals.
  • Score specific achievements.
  • Score the hits and destroys of units.
  • Score the hits and destroys of statics.
  • Score the hits and destroys of scenery.
  • (optional) Log scores into a CSV file.
  • Connect to a remote server using JSON and IP.

Missions:

SCO - Scoring


Administers the scoring of player achievements, and creates a CSV file logging the scoring events and results for use at team or squadron websites.

SCORING automatically calculates the threat level of the objects hit and destroyed by players, which can be Wrapper.Unit, Wrapper.Static objects.

Positive score points are granted when enemy or neutral targets are destroyed. Negative score points or penalties are given when a friendly target is hit or destroyed. This brings a lot of dynamism in the scoring, where players need to take care to inflict damage on the right target. By default, penalties weight heavier in the scoring, to ensure that players don't commit fratricide. The total score of the player is calculated by adding the scores minus the penalties.

Banner Image

The score value is calculated based on the threat level of the player and the threat level of the target. A calculated score takes the threat level of the target divided by a balanced threat level of the player unit. As such, if the threat level of the target is high, and the player threat level is low, a higher score will be given than if the threat level of the player would be high too.

Banner Image

When multiple players hit the same target, and finally succeed in destroying the target, then each player who contributed to the target destruction, will receive a score. This is important for targets that require significant damage before it can be destroyed, like ships or heavy planes.

Banner Image

Optionally, the score values can be scaled by a scale. Specific scales can be set for positive cores or negative penalties. The default range of the scores granted is a value between 0 and 10. The default range of penalties given is a value between 0 and 30.

Banner Image

Additional scores can be granted to specific objects, when the player(s) destroy these objects.

Banner Image

Various Core.Zones can be defined for which scores are also granted when objects in that Core.Zone are destroyed. This is specifically useful to designate scenery targets on the map that will generate points when destroyed.

With a small change in MissionScripting.lua, the scoring results can also be logged in a CSV file. These CSV files can be used to:

  • Upload scoring to a database or a BI tool to publish the scoring results to the player community.
  • Upload scoring in an (online) Excel like tool, using pivot tables and pivot charts to show mission results.
  • Share scoring among players after the mission to discuss mission results.

Scores can be reported. Menu options are automatically added to each player group when a player joins a client slot or a CA unit. Use the radio menu F10 to consult the scores while running the mission. Scores can be reported for your user, or an overall score can be reported of all players currently active in the mission.


Authors: FlightControl

Contributions:

  • Applevangelist: Additional functionality, fixes.
  • Wingthor (TAW): Testing & Advice.
  • Dutch-Baron (TAW): Testing & Advice.
  • Whisper: Testing and Advice.

Global(s)

Global SCORING

SCORING class

Constructor:

 local Scoring = SCORING:New( "Scoring File" )

Set the destroy score or penalty scale:

Score scales can be set for scores granted when enemies or friendlies are destroyed.

#SCORING SCORING

SCORING class

Constructor:

 local Scoring = SCORING:New( "Scoring File" )

Set the destroy score or penalty scale:

Score scales can be set for scores granted when enemies or friendlies are destroyed.

Use the method SCORING.SetScaleDestroyScore() to set the scale of enemy destroys (positive destroys). Use the method SCORING.SetScaleDestroyPenalty() to set the scale of friendly destroys (negative destroys).

 local Scoring = SCORING:New( "Scoring File" )
 Scoring:SetScaleDestroyScore( 10 )
 Scoring:SetScaleDestroyPenalty( 40 )

The above sets the scale for valid scores to 10. So scores will be given in a scale from 0 to 10. The penalties will be given in a scale from 0 to 40.

Define special targets that will give extra scores:

Special targets can be set that will give extra scores to the players when these are destroyed. Use the methods SCORING.AddUnitScore() and SCORING.RemoveUnitScore() to specify a special additional score for a specific Wrapper.Units. Use the methods SCORING.AddStaticScore() and SCORING.RemoveStaticScore() to specify a special additional score for a specific Wrapper.Statics. Use the method SCORING.AddScoreSetGroup() to specify a special additional score for a specific Wrapper.Groups gathered in a Core.Set#SET_GROUP.

 local Scoring = SCORING:New( "Scoring File" )
 Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
 Scoring:AddStaticScore( STATIC:FindByName( "Static #1" ), 100 )
 local GroupSet = SET_GROUP:New():FilterPrefixes("RAT"):FilterStart()
 Scoring:AddScoreSetGroup( GroupSet, 100)

The above grants an additional score of 200 points for Unit #001 and an additional 100 points of Static #1 if these are destroyed. Note that later in the mission, one can remove these scores set, for example, when the a goal achievement time limit is over. For example, this can be done as follows:

 Scoring:RemoveUnitScore( UNIT:FindByName( "Unit #001" ) )

Define destruction zones that will give extra scores:

Define zones of destruction. Any object destroyed within the zone of the given category will give extra points. Use the method SCORING.AddZoneScore() to add a Core.Zone for additional scoring. Use the method SCORING.RemoveZoneScore() to remove a Core.Zone for additional scoring. There are interesting variations that can be achieved with this functionality. For example, if the Core.Zone is a Core.Zone#ZONE_UNIT, then the zone is a moving zone, and anything destroyed within that Core.Zone will generate points. The other implementation could be to designate a scenery target (a building) in the mission editor surrounded by a Core.Zone, just large enough around that building.

Add extra Goal scores upon an event or a condition:

A mission has goals and achievements. The scoring system provides an API to set additional scores when a goal or achievement event happens. Use the method SCORING.AddGoalScore() to add a score for a Player at any time in your mission.

(Decommissioned) Configure fratricide level.

This functionality is decommissioned until the DCS bug concerning Unit:destroy() not being functional in multi player for player units has been fixed by ED.

When a player commits too much damage to friendlies, his penalty score will reach a certain level. Use the method SCORING.SetFratricide() to define the level when a player gets kicked. By default, the fratricide level is the default penalty multiplier * 2 for the penalty score.

Penalty score when a player changes the coalition.

When a player changes the coalition, he can receive a penalty score. Use the method SCORING.SetCoalitionChangePenalty() to define the penalty when a player changes coalition. By default, the penalty for changing coalition is the default penalty scale.

Define output CSV files.

The CSV file is given the name of the string given in the SCORING.New{} constructor, followed by the .csv extension. The file is incrementally saved in the **\Saved Games\DCS\Logs** folder, and has a time stamp indicating each mission run. See the following example:

local ScoringFirstMission = SCORING:New( "FirstMission" )
local ScoringSecondMission = SCORING:New( "SecondMission" )

The above documents that 2 Scoring objects are created, ScoringFirstMission and ScoringSecondMission.

*IMPORTANT!!!

In order to allow DCS world to write CSV files, you need to adapt a configuration file in your DCS world installation on the server. For this, browse to the missionscripting.lua file in your DCS world installation folder. For me, this installation folder is in D:\Program Files\Eagle Dynamics\DCS World\Scripts.

Edit a few code lines in the MissionScripting.lua file. Comment out the lines os, io and lfs:

   do
     --sanitizeModule('os')
     --sanitizeModule('io')
     --sanitizeModule('lfs')
     require = nil
     loadlib = nil
   end

When these lines are not sanitized, functions become available to check the time, and to write files to your system at the above specified location. Note that the MissionScripting.lua file provides a warning. So please beware of this warning as outlined by Eagle Dynamics!

   --Sanitize Mission Scripting environment
   --This makes unavailable some unsecure functions.
   --Mission downloaded from server to client may contain potentially harmful lua code that may use these functions.
   --You can remove the code below and make available these functions at your own risk.

The MOOSE designer cannot take any responsibility of any damage inflicted as a result of the de-sanitization. That being said, I hope that the SCORING class provides you with a great add-on to score your squad mates achievements.

Configure messages.

When players hit or destroy targets, messages are sent. Various methods exist to configure:

  • Which messages are sent upon the event.
  • Which audience receives the message.

Configure the messages sent upon the event.

Use the following methods to configure when to send messages. By default, all messages are sent.

Configure the audience of the messages.

Use the following methods to configure the audience of the messages. By default, the messages are sent to all players in the mission.


Type(s)

Fields and Methods inherited from SCORING Description

SCORING:AddGoalScore(PlayerUnit, GoalTag, Text, Score)

Add a goal score for a player.

SCORING:AddGoalScorePlayer(PlayerName, GoalTag, Text, Score)

Add a goal score for a player.

SCORING:AddScoreGroup(ScoreGroup, Score)

Specify a special additional score for a Wrapper.Group.

SCORING:AddScoreSetGroup(Set, Score)

Specify a special additional score for a Core.Set#SET_GROUP.

SCORING:AddStaticScore(ScoreStatic, Score)

Add a Wrapper.Static for additional scoring when the Wrapper.Static is destroyed.

SCORING:AddUnitScore(ScoreUnit, Score)

Add a Wrapper.Unit for additional scoring when the Wrapper.Unit is destroyed.

SCORING:AddZoneScore(ScoreZone, Score)

Add a Core.Zone to define additional scoring when any object is destroyed in that zone.

SCORING.AutoSave

SCORING.AutoSavePath

SCORING:CloseCSV()

Close CSV file

SCORING.CoalitionChangePenalty

SCORING.DisplayMessagePrefix

SCORING.Fratricide

SCORING.GameName

SCORING:IfMessagesDestroy()

If to send messages after a target has been destroyed.

SCORING:IfMessagesHit()

If to send messages after a target has been hit.

SCORING:IfMessagesScore()

If to send messages after a target has been destroyed and receives additional scores.

SCORING:IfMessagesToAll()

If to send messages to all players.

SCORING:IfMessagesToCoalition()

If to send messages to only those players within the same coalition as the player.

SCORING:IfMessagesZone()

If to send messages after a target has been hit in a zone, and additional score is received.

SCORING.MessagesAudience

SCORING.MessagesDestroy

SCORING.MessagesHit

SCORING.MessagesScore

SCORING.MessagesZone

SCORING:New(GameName, SavePath, AutoSave)

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

SCORING:OnEventBirth(Event)

Handles the OnBirth event for the scoring.

SCORING:OnEventPlayerLeaveUnit(Event)

Handles the OnPlayerLeaveUnit event for the scoring.

SCORING:OnKillPvE(PlayerName, TargetUnitName, IsTeamKill, TargetThreatLevel, PlayerThreatLevel, Score)

Handles the event when one player kill another player

SCORING:OnKillPvP(PlayerName, TargetPlayerName, IsTeamKill, TargetThreatLevel, PlayerThreatLevel, Score)

Handles the event when one player kill another player

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:RemoveStaticScore(ScoreStatic)

Removes a Wrapper.Static for additional scoring when the Wrapper.Static is destroyed.

SCORING:RemoveUnitScore(ScoreUnit)

Removes a Wrapper.Unit for additional scoring when the Wrapper.Unit is destroyed.

SCORING:RemoveZoneScore(ScoreZone)

Remove a Core.Zone for additional scoring.

SCORING:ReportDetailedPlayerCoalitionChanges(PlayerName)

Produce detailed report of player penalty scores because of changing the coalition.

SCORING:ReportDetailedPlayerDestroys(PlayerName)

Produce detailed report of player destroy scores.

SCORING:ReportDetailedPlayerGoals(PlayerName)

Produce detailed report of player goal scores.

SCORING:ReportDetailedPlayerHits(PlayerName)

Produce detailed report of player hit scores.

SCORING:ReportDetailedPlayerMissions(PlayerName)

Produce detailed report of player penalty scores because of changing the coalition.

SCORING:ReportScoreAllSummary(PlayerGroup)

Report all players score

SCORING:ReportScoreGroupDetailed(PlayerGroup)

Report Group Score Detailed

SCORING:ReportScoreGroupSummary(PlayerGroup)

Report Group Score Summary

SCORING.RunTime

SCORING.ScaleDestroyPenalty

SCORING.ScaleDestroyScore

SCORING:ScoreCSV(PlayerName, TargetPlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType)

Registers a score for a player.

SCORING.ScoreIncrementOnHit

SCORING.ScoringCSV

SCORING.ScoringObjects

SCORING.ScoringPlayerScan

SCORING.ScoringZones

SCORING:SecondsToClock(sSeconds)

SCORING:SetCoalitionChangePenalty(CoalitionChangePenalty)

When a player changes the coalition, he can receive a penalty score.

SCORING:SetDisplayMessagePrefix(DisplayMessagePrefix)

Set a prefix string that will be displayed at each scoring message sent.

SCORING:SetFratricide(Fratricide)

When a player commits too much damage to friendlies, his penalty score will reach a certain level.

SCORING:SetMessagesDestroy(OnOff)

Configure to send messages after a target has been destroyed.

SCORING:SetMessagesHit(OnOff)

Configure to send messages after a target has been hit.

SCORING:SetMessagesScore(OnOff)

Configure to send messages after a target has been destroyed and receives additional scores.

SCORING:SetMessagesToAll()

Configure to send messages to all players.

SCORING:SetMessagesToCoalition()

Configure to send messages to only those players within the same coalition as the player.

SCORING:SetMessagesZone(OnOff)

Configure to send messages after a target has been hit in a zone, and additional score is received.

SCORING:SetScaleDestroyPenalty(Scale)

Set the scale for scoring penalty destroys (friendly destroys).

SCORING:SetScaleDestroyScore(Scale)

Set the scale for scoring valid destroys (enemy destroys).

SCORING:SetScoreIncrementOnHit(score)

Configure to increment score after a target has been hit.

SCORING:SetScoringMenu(ScoringGroup)

Sets the scoring menu.

SCORING:SwitchAutoSave(OnOff)

Registers a score for a player.

SCORING:SwitchFratricide(OnOff)

Decide if fratricide is leading to penalties (true) or not (false)

SCORING:SwitchTreason(OnOff)

Decide if a change of coalition is leading to penalties (true) or not (false)

SCORING:_AddMissionGoalScore(Mission, PlayerName, Text, Score)

Registers Scores the players completing a Mission Task.

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.penaltyoncoalitionchange

SCORING.penaltyonfratricide

Fields and Methods inherited from BASE Description

SCORING.ClassID

The ID number of the class.

SCORING.ClassName

The name of the class.

SCORING.ClassNameAndID

The name of the class concatenated with the ID number of the class.

SCORING:ClearState(Object, StateName)

Clear the state of an object.

SCORING:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace)

Creation of a Birth Event.

SCORING:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

SCORING:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

SCORING:CreateEventDynamicCargoLoaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

SCORING:CreateEventDynamicCargoRemoved(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

SCORING:CreateEventDynamicCargoUnloaded(DynamicCargo)

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

SCORING:CreateEventNewDynamicCargo(DynamicCargo)

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

SCORING:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

SCORING:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

SCORING:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

SCORING:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

SCORING:E(Arguments)

Log an exception which will be traced always.

SCORING:EventDispatcher()

Returns the event dispatcher

SCORING:EventRemoveAll()

Remove all subscribed events

SCORING:F(Arguments)

Trace a function call.

SCORING:F2(Arguments)

Trace a function call level 2.

SCORING:F3(Arguments)

Trace a function call level 3.

SCORING:GetClassID()

Get the ClassID of the class instance.

SCORING:GetClassName()

Get the ClassName of the class instance.

SCORING:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

SCORING:GetEventPriority()

Get the Class Core.Event processing Priority.

SCORING:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

SCORING:GetState(Object, Key)

Get a Value given a Key from the Object.

SCORING:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

SCORING:I(Arguments)

Log an information which will be traced always.

SCORING:Inherit(Child, Parent)

This is the worker method to inherit from a parent class.

SCORING:IsInstanceOf(ClassName)

This is the worker method to check if an object is an (sub)instance of a class.

SCORING:IsTrace()

Enquires if tracing is on (for the class).

SCORING:New()

BASE constructor.

SCORING:OnEvent(EventData)

Occurs when an Event for an object is triggered.

SCORING:OnEventBDA(EventData)

BDA.

SCORING:OnEventBaseCaptured(EventData)

Occurs when a ground unit captures either an airbase or a farp.

SCORING:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

SCORING:OnEventCrash(EventData)

Occurs when any aircraft crashes into the ground and is completely destroyed.

SCORING:OnEventDead(EventData)

Occurs when an object is dead.

SCORING:OnEventDetailedFailure(EventData)

Unknown precisely what creates this event, likely tied into newer damage model.

SCORING:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

SCORING:OnEventDynamicCargoLoaded(EventData)

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

SCORING:OnEventDynamicCargoRemoved(EventData)

Occurs when a dynamic cargo crate is removed.

SCORING:OnEventDynamicCargoUnloaded(EventData)

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

SCORING:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

SCORING:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

SCORING:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

SCORING:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

SCORING:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

SCORING:OnEventKill(EventData)

Occurs on the death of a unit.

SCORING:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.

SCORING:OnEventLandingAfterEjection(EventData)

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

SCORING:OnEventLandingQualityMark(EventData)

Landing quality mark.

SCORING:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

SCORING:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

SCORING:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

SCORING:OnEventMissionEnd(EventData)

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

SCORING:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

SCORING:OnEventNewDynamicCargo(EventData)

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

SCORING:OnEventParatrooperLanding(EventData)

Weapon add.

SCORING:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

SCORING:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

SCORING:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

SCORING:OnEventPlayerLeaveUnit(EventData)

Occurs when any player relieves control of a unit to the AI.

SCORING:OnEventRefueling(EventData)

Occurs when an aircraft connects with a tanker and begins taking on fuel.

SCORING:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

SCORING:OnEventScore(EventData)

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

SCORING:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

SCORING:OnEventShootingStart(EventData)

Occurs when any unit begins firing a weapon that has a high rate of fire.

SCORING:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

SCORING:OnEventTakeoff(EventData)

Occurs when an aircraft takes off from an airbase, farp, or ship.

SCORING:OnEventTriggerZone(EventData)

Trigger zone.

SCORING:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

SCORING:ScheduleOnce(Start, SchedulerFunction, ...)

Schedule a new time event.

SCORING:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...)

Schedule a new time event.

SCORING:ScheduleStop(SchedulerID)

Stops the Schedule.

SCORING.Scheduler

SCORING:SetEventPriority(EventPriority)

Set the Class Core.Event processing Priority.

SCORING:SetState(Object, Key, Value)

Set a state or property of the Object given a Key and a Value.

SCORING:T(Arguments)

Trace a function logic level 1.

SCORING:T2(Arguments)

Trace a function logic level 2.

SCORING:T3(Arguments)

Trace a function logic level 3.

SCORING:TraceAll(TraceAll)

Trace all methods in MOOSE

SCORING:TraceClass(Class)

Set tracing for a class

SCORING:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

SCORING:TraceLevel(Level)

Set trace level

SCORING:TraceOff()

Set trace off.

SCORING:TraceOn()

Set trace on.

SCORING:TraceOnOff(TraceOnOff)

Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.

SCORING:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

SCORING._

SCORING:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

SCORING:_Serialize(Arguments)

(Internal) Serialize arguments

SCORING:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

SCORING.__

SCORING:onEvent(event)

The main event handling function...

Field(s)

SCORING.AutoSavePath

Create the CSV file.

#table SCORING.ScoringObjects

Additional Object scores

SCORING.ScoringPlayerScan

During mission startup, especially for single player, iterate the database for the player that has joined, and add him to the scoring, and set the menu. But this can only be started one second after the mission has started, so i need to schedule this ...

#table SCORING.ScoringZones

Additional Zone scores.

Function(s)

Add a goal score for a player.

The method takes the PlayerUnit for which the Goal score needs to be set. The GoalTag is a string or identifier that is taken into the CSV file scoring log to identify the goal. A free text can be given that is shown to the players. The Score can be both positive and negative.

Defined in:

SCORING

Parameters:

Wrapper.Unit#UNIT PlayerUnit

The Wrapper.Unit of the Player. Other Properties for the scoring are taken from this PlayerUnit, like coalition, type etc.

#string GoalTag

The string or identifier that is used in the CSV file to identify the goal (sort or group later in Excel).

#string Text

A free text that is shown to the players.

#number Score

The score can be both positive or negative ( Penalty ).

Add a goal score for a player.

The method takes the Player name for which the Goal score needs to be set. The GoalTag is a string or identifier that is taken into the CSV file scoring log to identify the goal. A free text can be given that is shown to the players. The Score can be both positive and negative.

Defined in:

SCORING

Parameters:

#string PlayerName

The name of the Player.

#string GoalTag

The string or identifier that is used in the CSV file to identify the goal (sort or group later in Excel).

#string Text

A free text that is shown to the players.

#number Score

The score can be both positive or negative ( Penalty ).

Specify a special additional score for a Wrapper.Group.

Defined in:

SCORING

Parameters:

Wrapper.Group#GROUP ScoreGroup

The Wrapper.Group for which each Wrapper.Unit a Score is given.

#number Score

The Score value.

Return value:

Specify a special additional score for a Core.Set#SET_GROUP.

Defined in:

SCORING

Parameters:

The Core.Set#SET_GROUP for which each Wrapper.Unit in each Group a Score is given.

#number Score

The Score value.

Return value:

Add a Wrapper.Static for additional scoring when the Wrapper.Static is destroyed.

Note that if there was already a Wrapper.Static declared within the scoring with the same name, then the old Wrapper.Static will be replaced with the new Wrapper.Static.

Defined in:

SCORING

Parameters:

Wrapper.Static#UNIT ScoreStatic

The Wrapper.Static for which the Score needs to be given.

#number Score

The Score value.

Return value:

Add a Wrapper.Unit for additional scoring when the Wrapper.Unit is destroyed.

Note that if there was already a Wrapper.Unit declared within the scoring with the same name, then the old Wrapper.Unit will be replaced with the new Wrapper.Unit.

Defined in:

SCORING

Parameters:

Wrapper.Unit#UNIT ScoreUnit

The Wrapper.Unit for which the Score needs to be given.

#number Score

The Score value.

Return value:

Add a Core.Zone to define additional scoring when any object is destroyed in that zone.

Note that if a Core.Zone with the same name is already within the scoring added, the Core.Zone (type) and Score will be replaced! This allows for a dynamic destruction zone evolution within your mission.

Defined in:

SCORING

Parameters:

The Core.Zone which defines the destruction score perimeters. Note that a zone can be a polygon or a moving zone.

#number Score

The Score value.

Return value:

Close CSV file

Defined in:

SCORING

Return value:

self

If to send messages after a target has been destroyed.

Defined in:

SCORING

Return value:

#boolean:

If to send messages after a target has been hit.

Defined in:

SCORING

Return value:

#boolean:

If to send messages after a target has been destroyed and receives additional scores.

Defined in:

SCORING

Return value:

#boolean:

If to send messages to all players.

Defined in:

SCORING

Return value:

#boolean:

If to send messages to only those players within the same coalition as the player.

Defined in:

SCORING

Return value:

#boolean:

If to send messages after a target has been hit in a zone, and additional score is received.

Defined in:

SCORING

Return value:

#boolean:

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

Defined in:

SCORING

Parameters:

#string GameName

The name of the game. This name is also logged in the CSV score file.

#string SavePath

(Optional) Path where to save the CSV file, defaults to your **\Saved Games\DCS\Logs** folder.

#boolean AutoSave

(Optional) If passed as false, then swith autosave off.

Return value:

self

Usage:


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

Handles the OnBirth event for the scoring.

Defined in:

SCORING

Parameter:

Handles the OnPlayerLeaveUnit event for the scoring.

Defined in:

SCORING

Parameter:

Handles the event when one player kill another player

Defined in:

SCORING

Parameters:

#string PlayerName

The attacking player

#string TargetUnitName

the name of the killed unit

#boolean IsTeamKill

true if this kill was a team kill

#number TargetThreatLevel

Threat level of the target

#number PlayerThreatLevel

Threat level of the player

#number Score

The score based on both threat levels

Handles the event when one player kill another player

Defined in:

SCORING

Parameters:

#string PlayerName

The attacking player

#string TargetPlayerName

The name of the killed player

#boolean IsTeamKill

true if this kill was a team kill

#number TargetThreatLevel

Threat level of the target

#number PlayerThreatLevel

Threat level of the player

#number Score

The score based on both threat levels

Opens a score CSV file to log the scores.

Defined in:

SCORING

Parameter:

#string ScoringCSV

Return value:

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" )

Removes a Wrapper.Static for additional scoring when the Wrapper.Static is destroyed.

Defined in:

SCORING

Parameter:

Wrapper.Static#UNIT ScoreStatic

The Wrapper.Static for which the Score needs to be given.

Return value:

Removes a Wrapper.Unit for additional scoring when the Wrapper.Unit is destroyed.

Defined in:

SCORING

Parameter:

Wrapper.Unit#UNIT ScoreUnit

The Wrapper.Unit for which the Score needs to be given.

Return value:

Remove a Core.Zone for additional scoring.

The scoring will search if any Core.Zone is added with the given name, and will remove that zone from the scoring. This allows for a dynamic destruction zone evolution within your mission.

Defined in:

SCORING

Parameter:

The Core.Zone which defines the destruction score perimeters. Note that a zone can be a polygon or a moving zone.

Return value:

Produce detailed report of player penalty scores because of changing the coalition.

Defined in:

SCORING

Parameter:

#string PlayerName

The name of the player.

Return value:

#string:

The report.

Produce detailed report of player destroy scores.

Defined in:

SCORING

Parameter:

#string PlayerName

The name of the player.

Return value:

#string:

The report.

Produce detailed report of player goal scores.

Defined in:

SCORING

Parameter:

#string PlayerName

The name of the player.

Return value:

#string:

The report.

Produce detailed report of player hit scores.

Defined in:

SCORING

Parameter:

#string PlayerName

The name of the player.

Return value:

#string:

The report.

Produce detailed report of player penalty scores because of changing the coalition.

Defined in:

SCORING

Parameter:

#string PlayerName

The name of the player.

Return value:

#string:

The report.

Report all players score

Defined in:

SCORING

Parameter:

Wrapper.Group#GROUP PlayerGroup

The player group.

Report Group Score Detailed

Defined in:

SCORING

Parameter:

Wrapper.Group#GROUP PlayerGroup

The player group.

Report Group Score Summary

Defined in:

SCORING

Parameter:

Wrapper.Group#GROUP PlayerGroup

The player group.

Registers a score for a player.

Defined in:

SCORING

Parameters:

#string PlayerName

The name of the player.

#string TargetPlayerName

The name of the target 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:

self

Defined in:

SCORING

Parameter:

sSeconds

When a player changes the coalition, he can receive a penalty score.

Use the method SCORING.SetCoalitionChangePenalty() to define the penalty when a player changes coalition. By default, the penalty for changing coalition is the default penalty scale.

Defined in:

SCORING

Parameter:

#number CoalitionChangePenalty

The amount of penalty that is given.

Return value:

Set a prefix string that will be displayed at each scoring message sent.

Defined in:

SCORING

Parameter:

#string DisplayMessagePrefix

(Default="Scoring: ") The scoring prefix string.

Return value:

When a player commits too much damage to friendlies, his penalty score will reach a certain level.

Use this method to define the level when a player gets kicked. By default, the fratricide level is the default penalty multiplier * 2 for the penalty score.

Defined in:

SCORING

Parameter:

#number Fratricide

The amount of maximum penalty that may be inflicted by a friendly player before he gets kicked.

Return value:

Configure to send messages after a target has been destroyed.

Defined in:

SCORING

Parameter:

#boolean OnOff

If true is given, the messages are sent.

Return value:

Configure to send messages after a target has been hit.

Defined in:

SCORING

Parameter:

#boolean OnOff

If true is given, the messages are sent.

Return value:

Configure to send messages after a target has been destroyed and receives additional scores.

Defined in:

SCORING

Parameter:

#boolean OnOff

If true is given, the messages are sent.

Return value:

Configure to send messages to all players.

Defined in:

SCORING

Return value:

Configure to send messages to only those players within the same coalition as the player.

Defined in:

SCORING

Return value:

Configure to send messages after a target has been hit in a zone, and additional score is received.

Defined in:

SCORING

Parameter:

#boolean OnOff

If true is given, the messages are sent.

Return value:

Set the scale for scoring penalty destroys (friendly destroys).

A default calculated penalty is a value between 1 and 10. The scale magnifies the scores given to the players.

Defined in:

SCORING

Parameter:

#number Scale

The scale of the score given.

Return value:

Set the scale for scoring valid destroys (enemy destroys).

A default calculated score is a value between 1 and 10. The scale magnifies the scores given to the players.

Defined in:

SCORING

Parameter:

#number Scale

The scale of the score given.

Configure to increment score after a target has been hit.

Defined in:

SCORING

Parameter:

#number score

amount of point to inclement score on each hit

Return value:

Sets the scoring menu.

Defined in:

SCORING

Parameter:

ScoringGroup

Return value:

Registers a score for a player.

Defined in:

SCORING

Parameter:

#boolean OnOff

Switch saving to CSV on = true or off = false

Return value:

self

Decide if fratricide is leading to penalties (true) or not (false)

Defined in:

SCORING

Parameter:

#boolean OnOff

Switch for Fratricide

Return value:

Decide if a change of coalition is leading to penalties (true) or not (false)

Defined in:

SCORING

Parameter:

#boolean OnOff

Switch for Coalition Changes.

Return value:

Registers Scores the players completing a Mission Task.

Defined in:

SCORING

Parameters:

#string PlayerName

#string Text

#number Score

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

Defined in:

SCORING

Parameters:

Wrapper.Unit#UNIT PlayerUnit

#string Text

#number Score

Registers Scores the players completing a Mission Task.

Defined in:

SCORING

Parameters:

Wrapper.Unit#UNIT PlayerUnit

#string Text

#number Score

Add a new player entering a Unit.

Defined in:

SCORING

Parameter:

Track DEAD or CRASH events for the scoring.

Defined in:

SCORING

Parameter:

Handles the OnHit event for the scoring.

Defined in:

SCORING

Parameter:

Field(s)

SCORING.AutoSavePath

Create the CSV file.

#table SCORING.ScoringObjects

Additional Object scores

SCORING.ScoringPlayerScan

During mission startup, especially for single player, iterate the database for the player that has joined, and add him to the scoring, and set the menu. But this can only be started one second after the mission has started, so i need to schedule this ...

#table SCORING.ScoringZones

Additional Zone scores.

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.

Defined in:

Parameter:

the dynamic cargo object

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

Creation of a Remove Unit Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Takeoff Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Log an exception which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#string:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

The ClassName + ClassID is formatted as '%s#%09d'.

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the Class Core.Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Return value:

#number:

The Core.Event processing Priority.

This is the worker method to retrieve the Parent class.

Note that the Parent class must be passed to call the parent class method.

self:GetParent(self):ParentMethod()

Defined in:

Parameters:

#BASE Child

This is the Child class from which the Parent class needs to be retrieved.

#BASE FromClass

(Optional) The class from which to get the parent.

Return value:

Get a Value given a Key from the Object.

Note that if the Object is destroyed, set to nil, or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

The key that is used to retrieve the value. Note that the key can be a #string, but it can also be any other type!

Return value:

The Value retrieved or nil if the Key was not found and thus the Value could not be retrieved.

Subscribe to a DCS Event.

Defined in:

Parameters:

Event ID.

#function EventFunction

(optional) The function to be called when the event occurs for the unit.

Return value:

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

This is the worker method to inherit from a parent class.

Defined in:

Parameters:

Child

is the Child class that inherits.

#BASE Parent

is the Parent class that the Child inherits from.

Return value:

Child

This is the worker method to check if an object is an (sub)instance of a class.

Examples:

  • ZONE:New( 'some zone' ):IsInstanceOf( ZONE ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'ZONE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'zone' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'BASE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'GROUP' ) will return false

Defined in:

Parameter:

ClassName

is the name of the class or the class itself to run the check against

Return value:

#boolean:

Enquires if tracing is on (for the class).

Defined in:

Return value:

#boolean:

BASE constructor.

This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.

function EVENT:New()
  local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
  return self
end

Defined in:

Return value:

Occurs when an Event for an object is triggered.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a ground unit captures either an airbase or a farp.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that captured the base place: The airbase that was captured, can be a FARP or Airbase. When calling place:getCoalition() the faction will already be the new owning faction.

Defined in:

Parameter:

The EventData structure.

Occurs when any object is spawned into the mission.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft crashes into the ground and is completely destroyed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

Unknown precisely what creates this event, likely tied into newer damage model.

Will update this page when new information become available.

  • initiator: The unit that had the failure.

Defined in:

Parameter:

The EventData structure.

Discard chair after ejection.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a dynamic cargo crate is removed.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.

initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.

Defined in:

Parameter:

The EventData structure.

Occurs when any system fails on a human controlled aircraft.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs on the death of a unit.

Contains more and different information. Similar to unit_lost it will occur for aircraft before the aircraft crash event occurs. Have a look at the class Core.Event#EVENT as these are just the prototypes.

  • initiator: The unit that killed the target
  • target: Target Object
  • weapon: Weapon Object

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.

initiator : The unit that has landed place: Object that the unit landed on. Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

Event does not occur if the pilot lands in the water and sub combs to Davey Jones Locker. Have a look at the class Core.Event#EVENT as these are just the prototypes.

  • initiator: Static object representing the ejected pilot. Place : Aircraft that the pilot ejected from.
  • place: may not return as a valid object if the aircraft has crashed into the ground and no longer exists.
  • subplace: is always 0 for unknown reasons.

Defined in:

Parameter:

The EventData structure.

Landing quality mark.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.

* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.

Defined in:

Parameter:

The EventData structure.

Weapon add.

Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when the pilot of an aircraft is killed.

Can occur either if the player is alive and crashes or if a weapon kills the pilot without completely destroying the plane. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when a player enters a slot and takes control of an aircraft.

Have a look at the class Core.Event#EVENT as these are just the prototypes. NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player relieves control of a unit to the AI.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the player left.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft connects with a tanker and begins taking on fuel.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

There is no information on what values the score was changed to. Event is likely similar to player_comment in this regard. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was doing the shooting.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit begins firing a weapon that has a high rate of fire.

Most common with aircraft cannons (GAU-8), autocannons, and machine guns. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is doing the shooting. target: The unit that is being targeted.

Defined in:

Parameter:

The EventData structure.

Occurs whenever any unit in a mission fires a weapon.

But not any machine gun or autocannon based weapon, those are handled by EVENT.ShootingStart. Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft takes off from an airbase, farp, or ship.

Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Trigger zone.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

Have a look at the class Core.Event#EVENT as these are just the prototypes.

  • initiator: The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Schedule a new time event.

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

#table ...

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#string:

The Schedule ID of the planned schedule.

Schedule a new time event.

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

#number Repeat

Specifies the interval in seconds when the scheduler will call the event function.

#number RandomizeFactor

Specifies a randomization factor between 0 and 1 to randomize the Repeat.

#number Stop

Specifies the amount of seconds when the scheduler will be stopped.

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

#table ...

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#string:

The Schedule ID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#string SchedulerID

(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.

Set the Class Core.Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Parameter:

#number EventPriority

The Core.Event processing Priority.

Return value:

self

Set a state or property of the Object given a Key and a Value.

Note that if the Object is destroyed, set to nil, or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that will hold the Value set by the Key.

Key

The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

true = trace all methods in MOOSE.

Set tracing for a class

Defined in:

Parameter:

#string Class

Class name.

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

Class name.

#string Method

Method.

Set trace level

Defined in:

Parameter:

#number Level

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.

So tracing must be switched on manually in your mission if you are using Moose statically. When moose is loading dynamically (for moose class development), tracing is switched on by default.

Defined in:

Parameter:

#boolean TraceOnOff

Switch the tracing on or off.

Usage:


  -- Switch the tracing On
  BASE:TraceOnOff( true )

  -- Switch the tracing Off
  BASE:TraceOnOff( false )

UnSubscribe to a DCS event.

Defined in:

Parameter:

Event ID.

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

The main event handling function...

This function captures all events generated for the class.

Defined in:

Parameter:

DCS#Event event