Banner Image

Module Functional.Range

Functional - Range Practice.


The RANGE class enables easy set up of bombing and strafing ranges within DCS World.

Implementation is based on the Simple Range Script by Ciribob, which itself was motivated by a script by SNAFU see here.

476th - Air Weapons Range Objects mod is highly recommended for this class.

Main Features:

  • Impact points of bombs, rockets and missiles are recorded and distance to closest range target is measured and reported to the player.
  • Number of hits on strafing passes are counted and reported. Also the percentage of hits w.r.t fired shots is evaluated.
  • Results of all bombing and strafing runs are stored and top 10 results can be displayed.
  • Range targets can be marked by smoke.
  • Range can be illuminated by illumination bombs for night missions.
  • Bomb, rocket and missile impact points can be marked by smoke.
  • Direct hits on targets can trigger flares.
  • Smoke and flare colors can be adjusted for each player via radio menu.
  • Range information and weather report at the range can be reported via radio menu.
  • Persistence: Bombing range results can be saved to disk and loaded the next time the mission is started.
  • Range control voice overs (>40) for hit assessment.

Youtube Videos:


Missions: Example missions will be added later.


Sound files: Check out the pinned messages in the Moose discord #func-range channel.


Author: funkyfranky

Contributions: FlightControl, Ciribob


Global(s)

Global RANGE

Don't only practice your art, but force your way into its secrets; art deserves that, for it and knowledge can raise man to the Divine. - Ludwig van Beethoven


Banner Image

The Range Concept

The RANGE class enables a mission designer to easily set up practice ranges in DCS.

#RANGE RANGE

Don't only practice your art, but force your way into its secrets; art deserves that, for it and knowledge can raise man to the Divine. - Ludwig van Beethoven


Banner Image

The Range Concept

The RANGE class enables a mission designer to easily set up practice ranges in DCS.

A new RANGE object can be created with the RANGE.New(rangename) contructor. The parameter rangename defines the name of the range. It has to be unique since this is also the name displayed in the radio menu.

Generally, a range consists of strafe pits and bombing targets. For strafe pits the number of hits for each pass is counted and tabulated. For bombing targets, the distance from the impact point of the bomb, rocket or missile to the closest range target is measured and tabulated. Each player can display his best results via a function in the radio menu or see the best best results from all players.

When all targets have been defined in the script, the range is started by the RANGE.Start() command.

IMPORTANT

Due to a DCS bug, it is not possible to directly monitor when a player enters a plane. So in a mission with client slots, it is vital that a player first enters as spectator or hits ESC twice and after that jumps into the slot of his aircraft! If that is not done, the script is not started correctly. This can be checked by looking at the radio menues. If the mission was entered correctly, there should be an "On the Range" menu items in the "F10. Other..." menu.

Strafe Pits

Each strafe pit can consist of multiple targets. Often one finds two or three strafe targets next to each other.

A strafe pit can be added to the range by the RANGE.AddStrafePit(targetnames, boxlength, boxwidth, heading, inverseheading, goodpass, foulline) function.

  • The first parameter targetnames defines the target or targets. This has to be given as a lua table which contains the names of Wrapper.Unit or Static objects defined in the mission editor.
  • In order to perform a valid pass on the strafe pit, the pilot has to begin his run from the correct direction. Therefore, an "approach box" is defined in front of the strafe targets. The parameters boxlength and boxwidth define the size of the box while the parameter heading defines its direction. If the parameter heading is passed as nil, the heading is automatically taken from the heading of the first target unit as defined in the ME. The parameter inverseheading turns the heading around by 180 degrees. This is sometimes useful, since the default heading of strafe target units point in the wrong/opposite direction.
  • The parameter goodpass defines the number of hits a pilot has to achieve during a run to be judged as a "good" pass.
  • The last parameter foulline sets the distance from the pit targets to the foul line. Hit from closer than this line are not counted!

Another function to add a strafe pit is RANGE.AddStrafePitGroup(group, boxlength, boxwidth, heading, inverseheading, goodpass, foulline). Here, the first parameter group is a MOOSE Wrapper.Group object and all units in this group define one strafe pit.

Finally, a valid approach has to be performed below a certain maximum altitude. The default is 914 meters (3000 ft) AGL. This is a parameter valid for all strafing pits of the range and can be adjusted by the RANGE.SetMaxStrafeAlt(maxalt) function.

Bombing targets

One ore multiple bombing targets can be added to the range by the RANGE.AddBombingTargets(targetnames, goodhitrange, randommove) function.

  • The first parameter targetnames has to be a lua table, which contains the names of Wrapper.Unit and/or Static objects defined in the mission editor. Note that the Range logic automatically determines, if a name belongs to a Wrapper.Unit or Static object now.
  • The (optional) parameter goodhitrange specifies the radius around the target. If a bomb or rocket falls at a distance smaller than this number, the hit is considered to be "good".
  • If final (optional) parameter "randommove" can be enabled to create moving targets. If this parameter is set to true, the units of this bombing target will randomly move within the range zone. Note that there might be quirks since DCS units can get stuck in buildings etc. So it might be safer to manually define a route for the units in the mission editor if moving targets are desired.

Adding Groups

Another possibility to add bombing targets is the RANGE.AddBombingTargetGroup(group, goodhitrange, randommove) function. Here the parameter group is a MOOSE Wrapper.Group object and all units in this group are defined as bombing targets.

Specifying Coordinates

It is also possible to specify coordinates rather than unit or static objects as bombing target locations. This has the advantage, that even when the unit/static object is dead, the specified coordinate will still be a valid impact point. This can be done via the RANGE.AddBombingTargetCoordinate(coord, name, goodhitrange) function.

Fine Tuning

Many range parameters have good default values. However, the mission designer can change these settings easily with the supplied user functions:

Radio Menu

Each range gets a radio menu with various submenus where each player can adjust his individual settings or request information about the range or his scores.

The main range menu can be found at "F10. Other..." --> "FX . On the Range..." --> "F1. ...".

The range menu contains the following submenues:

Banner Image

  • "F1. Statistics...": Range results of all players and personal stats.
  • "F2. Mark Targets": Mark range targets by smoke or flares.
  • "F3. My Settings" Personal settings.
  • "F4. Range Info": Information about the range, such as bearing and range.

F1 Statistics

Banner Image

F2 Mark Targets

Banner Image

F3 My Settings

Banner Image

F4 Range Info

Banner Image

Voice Overs

Voice over sound files can be downloaded from the Moose Discord. Check the pinned messages in the #func-range channel.

Instructor radio will inform players when they enter or exit the range zone and provide the radio frequency of the range control for hit assessment. This can be enabled via the RANGE.SetInstructorRadio(frequency) functions, where frequency is the AM frequency in MHz.

The range control can be enabled via the RANGE.SetRangeControl(frequency) functions, where frequency is the AM frequency in MHz.

By default, the sound files are placed in the "Range Soundfiles/" folder inside the mission (.miz) file. Another folder can be specified via the RANGE.SetSoundfilesPath(path) function.

Persistence

To automatically save bombing results to disk, use the RANGE.SetAutosave() function. Bombing results will be saved as csv file in your "Saved Games\DCS.openbeta\Logs" directory. Each range has a separate file, which is named "RANGE-<RangeName>_BombingResults.csv".

The next time you start the mission, these results are also automatically loaded.

Strafing results are currently not saved.

Examples

Goldwater Range

This example shows hot to set up the Barry M. Goldwater range. It consists of two strafe pits each has two targets plus three bombing targets.

 -- Strafe pits. Each pit can consist of multiple targets. Here we have two pits and each of the pits has two targets.
 -- These are names of the corresponding units defined in the ME.
 local strafepit_left={"GWR Strafe Pit Left 1", "GWR Strafe Pit Left 2"}
 local strafepit_right={"GWR Strafe Pit Right 1", "GWR Strafe Pit Right 2"}

 -- Table of bombing target names. Again these are the names of the corresponding units as defined in the ME.
 local bombtargets={"GWR Bomb Target Circle Left", "GWR Bomb Target Circle Right", "GWR Bomb Target Hard"}

 -- Create a range object.
 GoldwaterRange=RANGE:New("Goldwater Range")

 -- Distance between strafe target and foul line. You have to specify the names of the unit or static objects.
 -- Note that this could also be done manually by simply measuring the distance between the target and the foul line in the ME.
 GoldwaterRange:GetFoullineDistance("GWR Strafe Pit Left 1", "GWR Foul Line Left")

 -- Add strafe pits. Each pit (left and right) consists of two targets.
 GoldwaterRange:AddStrafePit(strafepit_left, 3000, 300, nil, true, 20, fouldist)
 GoldwaterRange:AddStrafePit(strafepit_right, nil, nil, nil, true, nil, fouldist)

 -- Add bombing targets. A good hit is if the bomb falls less then 50 m from the target.
 GoldwaterRange:AddBombingTargets(bombtargets, 50)

 -- Start range.
 GoldwaterRange:Start()

The 476th - Air Weapons Range Objects mod is (implicitly) used in this example.

Debugging

In case you have problems, it is always a good idea to have a look at your DCS log file. You find it in your "Saved Games" folder, so for example in

 C:\Users\<yourname>\Saved Games\DCS\Logs\dcs.log

All output concerning the RANGE class should have the string "RANGE" in the corresponding line.

The verbosity of the output can be increased by adding the following lines to your script:

 BASE:TraceOnOff(true)
 BASE:TraceLevel(1)
 BASE:TraceClass("RANGE")

To get even more output you can increase the trace level to 2 or even 3, c.f. BASE for more details.

The function RANGE.DebugON() can be used to send messages on screen. It also smokes all defined strafe and bombing targets, the strafe pit approach boxes and the range zone.

Note that it can happen that the RANGE radio menu is not shown. Check that the range object is defined as a global variable rather than a local one. The could avoid the lua garbage collection to accidentally/falsely deallocate the RANGE objects.

Type(s)

RANGE , extends Core.Fsm#FSM , extends Core.Base#BASE
Fields and Methods inherited from RANGE Description

RANGE:AddBombingTargetCoordinate(coord, name, goodhitrange)

Add a coordinate of a bombing target.

RANGE:AddBombingTargetGroup(group, goodhitrange, randommove)

Add all units of a group as bombing targets.

RANGE:AddBombingTargetUnit(unit, goodhitrange, randommove)

Add a unit or static object as bombing target.

RANGE:AddBombingTargets(targetnames, goodhitrange, randommove)

Add bombing target(s) to range.

RANGE:AddStrafePit(targetnames, boxlength, boxwidth, heading, inverseheading, goodpass, foulline)

Add new strafe pit.

RANGE:AddStrafePitGroup(group, boxlength, boxwidth, heading, inverseheading, goodpass, foulline)

Add all units of a group as one new strafe target pit.

RANGE.BombSmokeColor

Color id used for smoking bomb targets.

RANGE.BombtrackThreshold

Bombs/rockets/missiles are only tracked if player-range distance is smaller than this threshold [m]. Default 25000 m.

RANGE.ClassName

Name of the Class.

RANGE.Debug

If true, debug info is send as messages on the screen.

RANGE:DebugOFF()

Disable debug modus.

RANGE:DebugON()

Enable debug modus.

RANGE.Defaults

Default range parameters.

RANGE:EnterRange(player)

Triggers the FSM event "EnterRange".

RANGE:ExitRange(player)

Triggers the FSM event "ExitRange".

RANGE:GetFoullineDistance(namepit, namefoulline)

Measures the foule line distance between two unit or static objects.

RANGE:Impact(result, player)

Triggers the FSM event "Impact".

RANGE.MenuAddedTo

Table for monitoring which players already got an F10 menu.

RANGE.MenuF10

Main radio menu on group level.

RANGE.MenuF10Root

Main radio menu on mission level.

RANGE.Names

Global list of all defined range names.

RANGE:New(rangename)

RANGE contructor.

RANGE:OnAfterEnterRange(From, Event, To, player)

On after "EnterRange" event user function.

RANGE:OnAfterExitRange(From, Event, To, player)

On after "ExitRange" event user function.

RANGE:OnAfterImpact(From, Event, To, result, player)

On after "Impact" event user function.

RANGE:OnEventBirth(EventData)

Range event handler for event birth.

RANGE:OnEventHit(EventData)

Range event handler for event hit.

RANGE:OnEventShot(EventData)

Range event handler for event shot (when a unit releases a rocket or bomb (but not a fast firing gun).

RANGE.PlayerSettings

Individual player settings.

RANGE:SetAutosaveOff()

Switch off auto save player results.

RANGE:SetAutosaveOn()

Automatically save player results to disc.

RANGE:SetBombTargetSmokeColor(colorid)

Set smoke color for marking bomb targets.

RANGE:SetBombtrackThreshold(distance)

Set bomb track threshold distance.

RANGE:SetBombtrackTimestep(dt)

Set time interval for tracking bombs.

RANGE:SetDefaultPlayerSmokeBomb(switch)

Set player setting whether bomb impact points are smoked or not.

RANGE:SetDisplayedMaxPlayerResults(nmax)

Set max number of player results that are displayed.

RANGE:SetInstructorRadio(frequency)

Enable instructor radio and set frequency.

RANGE:SetMaxStrafeAlt(maxalt)

Set maximal strafing altitude.

RANGE:SetMessageTimeDuration(time)

Set time how long (most) messages are displayed.

RANGE:SetMessageToExaminer(examinergroupname, exclusively)

Set messages to examiner.

RANGE:SetMessagesOFF()

Disable ALL messages to players.

RANGE:SetMessagesON()

Enable messages to players.

RANGE:SetRangeControl(frequency)

Enable range control and set frequency.

RANGE:SetRangeLocation(coordinate)

Set range location.

RANGE:SetRangeRadius(radius)

Set range radius.

RANGE:SetRangeZone(zone)

Set range zone.

RANGE:SetScoreBombDistance(distance)

Set score bomb distance.

RANGE:SetSmokeTimeDelay(delay)

Set time delay between bomb impact and starting to smoke the impact point.

RANGE:SetSoundfilesPath(path)

Set sound files folder within miz file.

RANGE:SetStrafePitSmokeColor(colorid)

Set smoke color for marking strafe pit approach boxes.

RANGE:SetStrafeTargetSmokeColor(colorid)

Set smoke color for marking strafe targets.

RANGE.Sound

RANGE:Start()

Triggers the FSM event "Start".

RANGE:Status()

Triggers the FSM event "Status".

RANGE.StrafePitSmokeColor

Color id used to smoke strafe pit approach boxes.

RANGE.StrafeSmokeColor

Color id used to smoke strafe targets.

RANGE.TargetType

RANGE.TdelaySmoke

Time delay in seconds between impact of bomb and starting the smoke. Default 3 seconds.

RANGE.Tmsg

Time [sec] messages to players are displayed. Default 30 sec.

RANGE:TrackBombsOFF()

Disables tracking of all bomb types.

RANGE:TrackBombsON()

Enables tracking of all bomb types.

RANGE:TrackMissilesOFF()

Disables tracking of all missile types.

RANGE:TrackMissilesON()

Enables tracking of all missile types.

RANGE:TrackRocketsOFF()

Disables tracking of all rocket types.

RANGE:TrackRocketsON()

Enables tracking of all rocket types.

RANGE:_AddF10Commands(_unitName)

Add menu commands for player.

RANGE:_CheckInZone(_unitName)

Check if player is inside a strafing zone.

RANGE:_CheckPlayers(_unitName)

Check status of players.

RANGE:_CheckStatic(name)

Checks if a static object with a certain name exists.

RANGE._DelayedSmoke(_args)

Start smoking a coordinate with a delay.

RANGE:_DisplayBombTargets(_unitname)

Display bombing target locations to player.

RANGE:_DisplayBombingResults(_unitName)

Display best bombing results of top 10 players.

RANGE:_DisplayMessageToGroup(_unit, _text, _time, _clear, display)

Display message to group.

RANGE:_DisplayMyBombingResults(_unitName)

Display top 10 bombing run results of specific player.

RANGE:_DisplayMyStrafePitResults(_unitName)

Display top 10 stafing results of a specific player.

RANGE:_DisplayRangeInfo(_unitname)

Report information like bearing and range from player unit to range.

RANGE:_DisplayRangeWeather(_unitname)

Report weather conditions at range.

RANGE:_DisplayStrafePitResults(_unitName)

Display top 10 strafing results of all players.

RANGE:_DisplayStrafePits(_unitname)

Display pit location and heading to player.

RANGE:_FlareDirectHitsOnOff(unitname)

Toggle status of flaring direct hits of range targets.

RANGE:_GetAmmo(unitname)

Get the number of shells a unit currently has.

RANGE:_GetBombTargetCoordinate(target)

Get the number of shells a unit currently has.

RANGE:_GetPlayerUnitAndName(_unitName)

Returns the unit of a player and the player name.

RANGE:_GetSpeed(controllable)

Get max speed of controllable.

RANGE:_IlluminateBombTargets(_unitName)

Illuminate targets.

RANGE:_MarkTargetsOnMap(_unitName)

Mark targets on F10 map.

RANGE:_MessagesToPlayerOnOff(unitname)

Toggle display messages to player.

RANGE:_ResetRangeStats(_unitName)

Reset player statistics.

RANGE:_SmokeBombDelayOnOff(unitname)

Toggle status of time delay for smoking bomb impact points

RANGE:_SmokeBombImpactOnOff(unitname)

Toggle status of smoking bomb impact points.

RANGE:_SmokeBombTargets(unitname)

Mark bombing targets with smoke.

RANGE:_SmokeStrafeTargetBoxes(unitname)

Mark approach boxes of strafe targets with smoke.

RANGE:_SmokeStrafeTargets(unitname)

Mark strafing targets with smoke.

RANGE:__EnterRange(delay, player)

Triggers the FSM delayed event "EnterRange".

RANGE:__ExitRange(delay, player)

Triggers the FSM delayed event "ExitRange".

RANGE:__Impact(delay, result, player)

Triggers the FSM delayed event "Impact".

RANGE:__Start(delay)

Triggers the FSM event "Start" after a delay.

RANGE:__Status(delay)

Triggers the FSM event "Status" after a delay.

RANGE:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

RANGE:_flarecolor2text(color)

Sets the flare color used to flare players direct target hits.

RANGE:_myname(unitname)

Returns a string which consits of this callsign and the player name.

RANGE:_playerflarecolor(_unitName, color)

Sets the flare color used when player makes a direct hit on target.

RANGE:_playersmokecolor(_unitName, color)

Sets the smoke color used to smoke players bomb impact points.

RANGE:_smokecolor2text(color)

Converts a smoke color id to text.

RANGE.autosave

If true, automatically save results every X seconds.

RANGE.bombPlayerResults

Table containing the bombing results of each player.

RANGE.bombingTargets

Table of targets to bomb.

RANGE.defaultsmokebomb

If true, initialize player settings to smoke bomb.

RANGE.dtBombtrack

Time step [sec] used for tracking released bomb/rocket positions. Default 0.005 seconds.

RANGE.eventmoose

If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.

RANGE.examinerexclusive

If true, only the examiner gets messages. If false, clients and examiner get messages.

RANGE.examinergroupname

Name of the examiner group which should get all messages.

RANGE.id

String id of range for output in DCS log.

RANGE.illuminationmaxalt

Maximum altitude AGL in meters at which illumination bombs are fired. Default is 1000 m.

RANGE.illuminationminalt

Minimum altitude AGL in meters at which illumination bombs are fired. Default is 500 m.

RANGE.instructor

Instructor radio queue.

RANGE.instructorfreq

Frequency on which the range control transmitts.

RANGE.location

Coordinate of the range location.

RANGE.messages

Globally enable/disable all messages to players.

RANGE.nbombtargets

Number of bombing targets.

RANGE.ndisplayresult

Number of (player) results that a displayed. Default is 10.

RANGE.nstrafetargets

Number of strafing targets.

RANGE:onEvent(Event)

General event handler.

RANGE:onafterEnterRange(From, Event, To, player)

Function called after player enters the range zone.

RANGE:onafterExitRange(From, Event, To, player)

Function called after player leaves the range zone.

RANGE:onafterImpact(From, Event, To, result, player)

Function called after bomb impact on range.

RANGE:onafterLoad(From, Event, To)

On after "Load" event.

RANGE:onafterSave(From, Event, To)

Function called after save.

RANGE:onafterStart(From, Event, To)

Initializes number of targets and location of the range.

RANGE:onafterStatus(From, Event, To)

Check spawn queue and spawn aircraft if necessary.

RANGE:onbeforeLoad(From, Event, To)

Function called before save event.

RANGE:onbeforeSave(From, Event, To)

Function called before save event.

RANGE.planes

Table for administration.

RANGE.rangecontrol

Range control radio queue.

RANGE.rangecontrolfreq

Frequency on which the range control transmitts.

RANGE.rangename

Name of the range.

RANGE.rangeradius

Radius of range defining its total size for e.g. smoking bomb impact points and sending radio messages. Default 5 km.

RANGE.rangezone

MOOSE zone object of the range. For example, no bomb impacts are smoked if bombs fall outside of the range zone.

RANGE.scorebombdistance

Distance from closest target up to which bomb hits are counted. Default 1000 m.

RANGE.soundpath

Path inside miz file where the sound files are located. Default is "Range Soundfiles/".

RANGE.strafePlayerResults

Table containing the strafing results of each player.

RANGE.strafeStatus

Table containing the current strafing target a player as assigned to.

RANGE.strafeTargets

Table of strafing targets.

RANGE.strafemaxalt

Maximum altitude above ground for registering for a strafe run. Default is 914 m = 3000 ft.

RANGE.trackbombs

If true (default), all bomb types are tracked and impact point to closest bombing target is evaluated.

RANGE.trackmissiles

If true (default), all missile types are tracked and impact point to closest bombing target is evaluated.

RANGE.trackrockets

If true (default), all rocket types are tracked and impact point to closest bombing target is evaluated.

RANGE.version

Range script version.

Fields and Methods inherited from FSM Description

RANGE:AddEndState(State)

Adds an End state.

RANGE:AddProcess(From, Event, Process, ReturnEvents)

Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

RANGE:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

RANGE:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

RANGE:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

RANGE.CallScheduler

RANGE.Events

RANGE:GetCurrentState()

RANGE:GetEndStates()

Returns the End states.

RANGE:GetProcess(From, Event)

RANGE:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

RANGE:GetScores()

Returns a table with the scores defined.

RANGE:GetStartState()

Returns the start state of the FSM.

RANGE:GetState()

RANGE:GetSubs()

Returns a table with the Subs defined.

RANGE:GetTransitions()

Returns a table of the transition rules defined within the FSM.

RANGE:Is(State)

RANGE:LoadCallBacks(CallBackTable)

RANGE:New()

Creates a new FSM object.

RANGE.Scores

RANGE:SetProcess(From, Event, Fsm)

RANGE:SetStartState(State)

Sets the start state of the FSM.

RANGE._EndStates

RANGE._EventSchedules

RANGE._Processes

RANGE._Scores

RANGE._StartState

RANGE._Transitions

RANGE:_add_to_map(Map, Event)

RANGE:_call_handler(step, trigger, params, EventName)

RANGE:_create_transition(EventName)

RANGE:_delayed_transition(EventName)

RANGE:_eventmap(Events, EventStructure)

RANGE:_gosub(ParentFrom, ParentEvent)

RANGE:_handler(EventName, ...)

RANGE:_isendstate(Current)

RANGE:_submap(subs, sub, name)

RANGE:can(e)

RANGE:cannot(e)

RANGE.current

RANGE.endstates

RANGE:is(state)

RANGE.options

RANGE.subs

Fields and Methods inherited from BASE Description

RANGE.ClassID

The ID number of the class.

RANGE.ClassName

The name of the class.

RANGE.ClassNameAndID

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

RANGE:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

RANGE:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

RANGE:CreateEventDead(EventTime, Initiator)

Creation of a Dead Event.

RANGE:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

RANGE:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

RANGE:E(Arguments)

Log an exception which will be traced always.

RANGE:EventDispatcher()

Returns the event dispatcher

RANGE:EventRemoveAll()

Remove all subscribed events

RANGE:F(Arguments)

Trace a function call.

RANGE:F2(Arguments)

Trace a function call level 2.

RANGE:F3(Arguments)

Trace a function call level 3.

RANGE:GetClassID()

Get the ClassID of the class instance.

RANGE:GetClassName()

Get the ClassName of the class instance.

RANGE:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

RANGE:GetEventPriority()

Get the Class Event processing Priority.

RANGE:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

RANGE:GetState(Object, Key)

Get a Value given a Key from the Object.

RANGE:HandleEvent(Event, EventFunction)

Subscribe to a DCS Event.

RANGE:I(Arguments)

Log an information which will be traced always.

RANGE:Inherit(Child, Parent)

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

RANGE:IsInstanceOf(ClassName)

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

RANGE:IsTrace()

Enquires if tracing is on (for the class).

RANGE:New()

BASE constructor.

RANGE:OnEvent(EventData)

Occurs when an object is completely destroyed.

RANGE:OnEventBaseCaptured(EventData)

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

RANGE:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

RANGE:OnEventCrash(EventData)

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

RANGE:OnEventDead(EventData)

Occurs when an object is dead.

RANGE:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

RANGE:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

RANGE:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

RANGE:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

RANGE:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

RANGE:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

RANGE:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

RANGE:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

RANGE:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

RANGE:OnEventMissionEnd(EventData)

Occurs when a mission ends

RANGE:OnEventMissionStart(EventData)

Occurs when a mission starts

RANGE:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

RANGE:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

RANGE:OnEventPlayerLeaveUnit(EventData)

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

RANGE:OnEventRefueling(EventData)

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

RANGE:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

RANGE:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

RANGE:OnEventShootingStart(EventData)

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

RANGE:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

RANGE:OnEventTakeoff(EventData)

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

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

Schedule a new time event.

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

Schedule a new time event.

RANGE:ScheduleStop(SchedulerFunction)

Stops the Schedule.

RANGE.Scheduler

RANGE:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

RANGE:SetState(Object, Key, Value)

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

RANGE:T(Arguments)

Trace a function logic level 1.

RANGE:T2(Arguments)

Trace a function logic level 2.

RANGE:T3(Arguments)

Trace a function logic level 3.

RANGE:TraceAll(TraceAll)

Trace all methods in MOOSE

RANGE:TraceClass(Class)

Set tracing for a class

RANGE:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

RANGE:TraceLevel(Level)

Set trace level

RANGE:TraceOff()

Set trace off.

RANGE:TraceOn()

Set trace on.

RANGE: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.

RANGE:UnHandleEvent(Event)

UnSubscribe to a DCS event.

RANGE._

RANGE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

RANGE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

RANGE.__

RANGE:onEvent(event)

Fields and Methods inherited from RANGE.BombResult Description

RANGE.BombResult.airframe

Aircraft type of player.

RANGE.BombResult.date

OS date.

RANGE.BombResult.distance

Distance in meters.

RANGE.BombResult.name

Name of closest target.

RANGE.BombResult.player

Player name.

RANGE.BombResult.quality

Hit quality.

RANGE.BombResult.radial

Radial in degrees.

RANGE.BombResult.time

Time via timer.getAbsTime() in seconds of impact.

RANGE.BombResult.weapon

Name of the weapon.

Fields and Methods inherited from RANGE.BombTarget Description

RANGE.BombTarget.coordinate

Coordinate of the target.

RANGE.BombTarget.goodhitrange

Range in meters for a good hit.

RANGE.BombTarget.move

If true, unit move randomly.

RANGE.BombTarget.name

Name of unit.

RANGE.BombTarget.speed

Speed of unit.

RANGE.BombTarget.target

Target unit.

RANGE.BombTarget.type

Type of target.

Fields and Methods inherited from RANGE.PlayerData Description

RANGE.PlayerData.airframe

Aircraft type name.

RANGE.PlayerData.client

Client object of player.

RANGE.PlayerData.flarecolor

Color of flares.

RANGE.PlayerData.flaredirecthits

Flare when player directly hits a target.

RANGE.PlayerData.inzone

If true, player is inside the range zone.

RANGE.PlayerData.messages

Display info messages.

RANGE.PlayerData.playername

Name of player.

RANGE.PlayerData.smokebombimpact

Smoke bomb impact points.

RANGE.PlayerData.smokecolor

Color of smoke.

RANGE.PlayerData.unitname

Name of player aircraft unit.

Fields and Methods inherited from RANGE.Soundfile Description

RANGE.Soundfile.duration

Duration in seconds.

RANGE.Soundfile.filename

Name of the file

Fields and Methods inherited from RANGE.StrafeTarget Description

RANGE.StrafeTarget.coordinate

Center coordinate of the pit.

RANGE.StrafeTarget.foulline

Foul line

RANGE.StrafeTarget.goodPass

Number of hits for a good pass.

RANGE.StrafeTarget.heading

Heading of pit.

RANGE.StrafeTarget.name

Name of the unit.

RANGE.StrafeTarget.polygon

Polygon zone.

RANGE.StrafeTarget.smokepoints

Number of smoke points.

RANGE.StrafeTarget.targets

Table of target units.

Fields and Methods inherited from RANGE.TargetType Description

RANGE.TargetType.COORD

Target is a coordinate.

RANGE.TargetType.STATIC

Target is a static.

RANGE.TargetType.UNIT

Target is a unit.

  • RANGE class

Field(s)

Utilities.Utils#SMOKECOLOR RANGE.BombSmokeColor

Color id used for smoking bomb targets.

#number RANGE.BombtrackThreshold

Bombs/rockets/missiles are only tracked if player-range distance is smaller than this threshold [m]. Default 25000 m.

#string RANGE.ClassName

Name of the Class.

#boolean RANGE.Debug

If true, debug info is send as messages on the screen.

#table RANGE.Defaults

Default range parameters.

#table RANGE.MenuAddedTo

Table for monitoring which players already got an F10 menu.

#table RANGE.MenuF10

Main radio menu on group level.

#table RANGE.MenuF10Root

Main radio menu on mission level.

#table RANGE.Names

Global list of all defined range names.

#table RANGE.PlayerSettings

Individual player settings.

Utilities.Utils#SMOKECOLOR RANGE.StrafePitSmokeColor

Color id used to smoke strafe pit approach boxes.

Utilities.Utils#SMOKECOLOR RANGE.StrafeSmokeColor

Color id used to smoke strafe targets.

#number RANGE.TdelaySmoke

Time delay in seconds between impact of bomb and starting the smoke. Default 3 seconds.

#number RANGE.Tmsg

Time [sec] messages to players are displayed. Default 30 sec.

#boolean RANGE.autosave

If true, automatically save results every X seconds.

#table RANGE.bombPlayerResults

Table containing the bombing results of each player.

#table RANGE.bombingTargets

Table of targets to bomb.

#boolean RANGE.defaultsmokebomb

If true, initialize player settings to smoke bomb.

#number RANGE.dtBombtrack

Time step [sec] used for tracking released bomb/rocket positions. Default 0.005 seconds.

#boolean RANGE.eventmoose

If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.

#boolean RANGE.examinerexclusive

If true, only the examiner gets messages. If false, clients and examiner get messages.

#string RANGE.examinergroupname

Name of the examiner group which should get all messages.

#string RANGE.id

String id of range for output in DCS log.

#number RANGE.illuminationmaxalt

Maximum altitude AGL in meters at which illumination bombs are fired. Default is 1000 m.

#number RANGE.illuminationminalt

Minimum altitude AGL in meters at which illumination bombs are fired. Default is 500 m.

#number RANGE.instructorfreq

Frequency on which the range control transmitts.

Core.Point#COORDINATE RANGE.location

Coordinate of the range location.

#boolean RANGE.messages

Globally enable/disable all messages to players.

#number RANGE.nbombtargets

Number of bombing targets.

#number RANGE.ndisplayresult

Number of (player) results that a displayed. Default is 10.

#number RANGE.nstrafetargets

Number of strafing targets.

#table RANGE.planes

Table for administration.

Core.RadioQueue#RADIOQUEUE RANGE.rangecontrol

Range control radio queue.

#number RANGE.rangecontrolfreq

Frequency on which the range control transmitts.

#string RANGE.rangename

Name of the range.

#number RANGE.rangeradius

Radius of range defining its total size for e.g. smoking bomb impact points and sending radio messages. Default 5 km.

Core.Zone#ZONE RANGE.rangezone

MOOSE zone object of the range. For example, no bomb impacts are smoked if bombs fall outside of the range zone.

#number RANGE.scorebombdistance

Distance from closest target up to which bomb hits are counted. Default 1000 m.

#string RANGE.soundpath

Path inside miz file where the sound files are located. Default is "Range Soundfiles/".

#table RANGE.strafePlayerResults

Table containing the strafing results of each player.

#table RANGE.strafeStatus

Table containing the current strafing target a player as assigned to.

#table RANGE.strafeTargets

Table of strafing targets.

#number RANGE.strafemaxalt

Maximum altitude above ground for registering for a strafe run. Default is 914 m = 3000 ft.

#boolean RANGE.trackbombs

If true (default), all bomb types are tracked and impact point to closest bombing target is evaluated.

#boolean RANGE.trackmissiles

If true (default), all missile types are tracked and impact point to closest bombing target is evaluated.

#boolean RANGE.trackrockets

If true (default), all rocket types are tracked and impact point to closest bombing target is evaluated.

#string RANGE.version

Range script version.

Function(s)

Add a coordinate of a bombing target.

This

Defined in:

RANGE

Parameters:

The coordinate.

#string name

Name of target.

#number goodhitrange

Max distance from unit which is considered as a good hit.

Return value:

self

Add all units of a group as bombing targets.

Defined in:

RANGE

Parameters:

Group of bombing targets.

#number goodhitrange

Max distance from unit which is considered as a good hit.

#boolean randommove

If true, unit will move randomly within the range. Default is false.

Return value:

self

Add a unit or static object as bombing target.

Defined in:

RANGE

Parameters:

Positionable (unit or static) of the strafe target.

#number goodhitrange

Max distance from unit which is considered as a good hit.

#boolean randommove

If true, unit will move randomly within the range. Default is false.

Return value:

self

Add bombing target(s) to range.

Defined in:

RANGE

Parameters:

#table targetnames

Table containing names of unit or static objects serving as bomb targets.

#number goodhitrange

(Optional) Max distance from target unit (in meters) which is considered as a good hit. Default is 25 m.

#boolean randommove

If true, unit will move randomly within the range. Default is false.

Return value:

self

Add new strafe pit.

For a strafe pit, hits from guns are counted. One pit can consist of several units. Note, an approach is only valid, if the player enters via a zone in front of the pit, which defined by boxlength and boxheading. Furthermore, the player must not be too high and fly in the direction of the pit to make a valid target apporoach.

Defined in:

RANGE

Parameters:

#table targetnames

Table of unit or static names defining the strafe targets. The first target in the list determines the approach zone (heading and box).

#number boxlength

(Optional) Length of the approach box in meters. Default is 3000 m.

#number boxwidth

(Optional) Width of the approach box in meters. Default is 300 m.

#number heading

(Optional) Approach heading in Degrees. Default is heading of the unit as defined in the mission editor.

#boolean inverseheading

(Optional) Take inverse heading (heading --> heading - 180 Degrees). Default is false.

#number goodpass

(Optional) Number of hits for a "good" strafing pass. Default is 20.

#number foulline

(Optional) Foul line distance. Hits from closer than this distance are not counted. Default 610 m = 2000 ft. Set to 0 for no foul line.

Return value:

self

Add all units of a group as one new strafe target pit.

For a strafe pit, hits from guns are counted. One pit can consist of several units. Note, an approach is only valid, if the player enters via a zone in front of the pit, which defined by boxlength and boxheading. Furthermore, the player must not be too high and fly in the direction of the pit to make a valid target apporoach.

Defined in:

RANGE

Parameters:

MOOSE group of unit names defining the strafe target pit. The first unit in the group determines the approach zone (heading and box).

#number boxlength

(Optional) Length of the approach box in meters. Default is 3000 m.

#number boxwidth

(Optional) Width of the approach box in meters. Default is 300 m.

#number heading

(Optional) Approach heading in Degrees. Default is heading of the unit as defined in the mission editor.

#boolean inverseheading

(Optional) Take inverse heading (heading --> heading - 180 Degrees). Default is false.

#number goodpass

(Optional) Number of hits for a "good" strafing pass. Default is 20.

#number foulline

(Optional) Foul line distance. Hits from closer than this distance are not counted. Default 610 m = 2000 ft. Set to 0 for no foul line.

Return value:

self

Disable debug modus.

Defined in:

RANGE

Return value:

self

Enable debug modus.

Defined in:

RANGE

Return value:

self

Triggers the FSM event "EnterRange".

Defined in:

RANGE

Parameter:

Data of player settings etc.

Triggers the FSM event "ExitRange".

Defined in:

RANGE

Parameter:

Data of player settings etc.

Measures the foule line distance between two unit or static objects.

Defined in:

RANGE

Parameters:

#string namepit

Name of the strafe pit target object.

#string namefoulline

Name of the fould line distance marker object.

Return value:

#number:

Foul line distance in meters.

Triggers the FSM event "Impact".

Defined in:

RANGE

Parameters:

Data of bombing run.

Data of player settings etc.

RANGE contructor.

Creates a new RANGE object.

Defined in:

RANGE

Parameter:

#string rangename

Name of the range. Has to be unique. Will we used to create F10 menu items etc.

Return value:

RANGE object.

On after "EnterRange" event user function.

Called when a player enters the range zone.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Data of player settings etc.

On after "ExitRange" event user function.

Called when a player leaves the range zone.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Data of player settings etc.

On after "Impact" event user function.

Called when a bomb/rocket/missile impacted.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Data of the bombing run.

Data of player settings etc.

Range event handler for event birth.

Defined in:

RANGE

Parameter:

Range event handler for event hit.

Defined in:

RANGE

Parameter:

Range event handler for event shot (when a unit releases a rocket or bomb (but not a fast firing gun).

Defined in:

RANGE

Parameter:

Switch off auto save player results.

Defined in:

RANGE

Return value:

self

Automatically save player results to disc.

Defined in:

RANGE

Return value:

self

Set smoke color for marking bomb targets.

By default bomb targets are marked by red smoke.

Defined in:

RANGE

Parameter:

Color id. Default SMOKECOLOR.Red.

Return value:

self

Set bomb track threshold distance.

Bombs/rockets/missiles are only tracked if player-range distance is less than this distance. Default 25 km.

Defined in:

RANGE

Parameter:

#number distance

Threshold distance in km. Default 25 km.

Return value:

self

Set time interval for tracking bombs.

A smaller time step increases accuracy but needs more CPU time.

Defined in:

RANGE

Parameter:

#number dt

Time interval in seconds. Default is 0.005 s.

Return value:

self

Set player setting whether bomb impact points are smoked or not.

Defined in:

RANGE

Parameter:

#boolean switch

If true nor nil default is to smoke impact points of bombs.

Return value:

self

Set max number of player results that are displayed.

Defined in:

RANGE

Parameter:

#number nmax

Number of results. Default is 10.

Return value:

self

Enable instructor radio and set frequency.

Defined in:

RANGE

Parameter:

#number frequency

Frequency in MHz. Default 305 MHz.

Return value:

self

Set maximal strafing altitude.

Player entering a strafe pit above that altitude are not registered for a valid pass.

Defined in:

RANGE

Parameter:

#number maxalt

Maximum altitude AGL in meters. Default is 914 m= 3000 ft.

Return value:

self

Set time how long (most) messages are displayed.

Defined in:

RANGE

Parameter:

#number time

Time in seconds. Default is 30 s.

Return value:

self

Set messages to examiner.

The examiner will receive messages from all clients.

Defined in:

RANGE

Parameters:

#string examinergroupname

Name of the group of the examiner.

#boolean exclusively

If true, messages are send exclusively to the examiner, i.e. not to the clients.

Return value:

self

Disable ALL messages to players.

Defined in:

RANGE

Return value:

self

Enable messages to players.

This is the default

Defined in:

RANGE

Return value:

self

Enable range control and set frequency.

Defined in:

RANGE

Parameter:

#number frequency

Frequency in MHz. Default 256 MHz.

Return value:

self

Set range location.

If this is not done, one (random) unit position of the range is used to determine the location of the range. The range location determines the position at which the weather data is evaluated.

Defined in:

RANGE

Parameter:

Coordinate of the range.

Return value:

self

Set range radius.

Defines the area in which e.g. bomb impacts are smoked.

Defined in:

RANGE

Parameter:

#number radius

Radius in km. Default 5 km.

Return value:

self

Set range zone.

For example, no bomb impact points are smoked if a bomb falls outside of this zone. If a zone is not explicitly specified, the range zone is determined by its location and radius.

Defined in:

RANGE

Parameter:

MOOSE zone defining the range perimeters.

Return value:

self

Set score bomb distance.

Defined in:

RANGE

Parameter:

#number distance

Distance in meters. Default 1000 m.

Return value:

self

Set time delay between bomb impact and starting to smoke the impact point.

Defined in:

RANGE

Parameter:

#number delay

Time delay in seconds. Default is 3 seconds.

Return value:

self

Set sound files folder within miz file.

Defined in:

RANGE

Parameter:

#string path

Path for sound files. Default "ATIS Soundfiles/". Mind the slash "/" at the end!

Return value:

self

Set smoke color for marking strafe pit approach boxes.

By default strafe pit boxes are marked by white smoke.

Defined in:

RANGE

Parameter:

Color id. Default SMOKECOLOR.White.

Return value:

self

Set smoke color for marking strafe targets.

By default strafe targets are marked by green smoke.

Defined in:

RANGE

Parameter:

Color id. Default SMOKECOLOR.Green.

Return value:

self

Triggers the FSM event "Start".

Starts the RANGE. Initializes parameters and starts event handlers.

Defined in:

RANGE

Triggers the FSM event "Status".

Defined in:

RANGE

Disables tracking of all bomb types.

Defined in:

RANGE

Return value:

self

Enables tracking of all bomb types.

Note that this is the default setting.

Defined in:

RANGE

Return value:

self

Disables tracking of all missile types.

Defined in:

RANGE

Return value:

self

Enables tracking of all missile types.

Note that this is the default setting.

Defined in:

RANGE

Return value:

self

Disables tracking of all rocket types.

Defined in:

RANGE

Return value:

self

Enables tracking of all rocket types.

Note that this is the default setting.

Defined in:

RANGE

Return value:

self

Add menu commands for player.

Defined in:

RANGE

Parameter:

#string _unitName

Name of player unit.

Check if player is inside a strafing zone.

If he is, we start looking for hits. If he was and left the zone again, the result is stored.

Defined in:

RANGE

Parameter:

#string _unitName

Name of player unit.

Check status of players.

Defined in:

RANGE

Parameter:

#string _unitName

Name of player unit.

Checks if a static object with a certain name exists.

It also added it to the MOOSE data base, if it is not already in there.

Defined in:

RANGE

Parameter:

#string name

Name of the potential static object.

Return value:

#boolean:

Returns true if a static with this name exists. Retruns false if a unit with this name exists. Returns nil if neither unit or static exist.

Start smoking a coordinate with a delay.

Defined in:

RANGE

Parameter:

#table _args

Argements passed.

Display bombing target locations to player.

Defined in:

RANGE

Parameter:

#string _unitname

Name of the player unit.

Display best bombing results of top 10 players.

Defined in:

RANGE

Parameter:

#string _unitName

Name of player unit.

Display message to group.

Defined in:

RANGE

Parameters:

Player unit.

#string _text

Message text.

#number _time

Duration how long the message is displayed.

#boolean _clear

Clear up old messages.

#boolean display

If true, display message regardless of player setting "Messages Off".

Display top 10 bombing run results of specific player.

Defined in:

RANGE

Parameter:

#string _unitName

Name of the player unit.

Display top 10 stafing results of a specific player.

Defined in:

RANGE

Parameter:

#string _unitName

Name of the player unit.

Report information like bearing and range from player unit to range.

Defined in:

RANGE

Parameter:

#string _unitname

Name of the player unit.

Report weather conditions at range.

Temperature, QFE pressure and wind data.

Defined in:

RANGE

Parameter:

#string _unitname

Name of the player unit.

Display top 10 strafing results of all players.

Defined in:

RANGE

Parameter:

#string _unitName

Name fo the player unit.

Display pit location and heading to player.

Defined in:

RANGE

Parameter:

#string _unitname

Name of the player unit.

Toggle status of flaring direct hits of range targets.

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Get the number of shells a unit currently has.

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Return value:

Number of shells left

Get the number of shells a unit currently has.

Defined in:

RANGE

Parameter:

Bomb target data.

Return value:

Target coordinate.

Returns the unit of a player and the player name.

If the unit does not belong to a player, nil is returned.

Defined in:

RANGE

Parameter:

#string _unitName

Name of the player unit.

Return values:

Unit of player.

#string:

Name of the player.

nil If player does not exist.

Get max speed of controllable.

Defined in:

RANGE

Parameter:

Return value:

Maximum speed in km/h.

Illuminate targets.

Fires illumination bombs at one random bomb and one random strafe target at a random altitude between 400 and 800 m.

Defined in:

RANGE

Parameter:

#string _unitName

(Optional) Name of the player unit.

Mark targets on F10 map.

Defined in:

RANGE

Parameter:

#string _unitName

Name of the player unit.

Toggle display messages to player.

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Reset player statistics.

Defined in:

RANGE

Parameter:

#string _unitName

Name of the player unit.

Toggle status of time delay for smoking bomb impact points

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Toggle status of smoking bomb impact points.

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Mark bombing targets with smoke.

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Mark approach boxes of strafe targets with smoke.

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Mark strafing targets with smoke.

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Triggers the FSM delayed event "EnterRange".

Defined in:

RANGE

Parameters:

#number delay

Delay in seconds before the function is called.

Data of player settings etc.

Triggers the FSM delayed event "ExitRange".

Defined in:

RANGE

Parameters:

#number delay

Delay in seconds before the function is called.

Data of player settings etc.

Triggers the FSM delayed event "Impact".

Defined in:

RANGE

Parameters:

#number delay

Delay in seconds before the function is called.

Data of the bombing run.

Data of player settings etc.

Triggers the FSM event "Start" after a delay.

Starts the RANGE. Initializes parameters and starts event handlers.

Defined in:

RANGE

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Status" after a delay.

Defined in:

RANGE

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Stop" after a delay.

Stops the RANGE and all its event handlers.

Defined in:

RANGE

Parameter:

#number delay

Delay in seconds.

Sets the flare color used to flare players direct target hits.

Defined in:

RANGE

Parameter:

Color Id.

Return value:

#string:

Color text.

Returns a string which consits of this callsign and the player name.

Defined in:

RANGE

Parameter:

#string unitname

Name of the player unit.

Sets the flare color used when player makes a direct hit on target.

Defined in:

RANGE

Parameters:

#string _unitName

Name of the player unit.

ID of flare color.

Sets the smoke color used to smoke players bomb impact points.

Defined in:

RANGE

Parameters:

#string _unitName

Name of the player unit.

ID of the smoke color.

Converts a smoke color id to text.

E.g. SMOKECOLOR.Blue --> "blue".

Defined in:

RANGE

Parameter:

Color Id.

Return value:

#string:

Color text.

General event handler.

Defined in:

RANGE

Parameter:

#table Event

DCS event table.

Function called after player enters the range zone.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Player data.

Function called after player leaves the range zone.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Player data.

Function called after bomb impact on range.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Result of bomb impact.

Player data table.

On after "Load" event.

Loads results of all players from file.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Function called after save.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Initializes number of targets and location of the range.

Starts the event handlers.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Check spawn queue and spawn aircraft if necessary.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Function called before save event.

Checks that io and lfs are desanitized.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Function called before save event.

Checks that io and lfs are desanitized.

Defined in:

RANGE

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Field(s)

Utilities.Utils#SMOKECOLOR RANGE.BombSmokeColor

Color id used for smoking bomb targets.

#number RANGE.BombtrackThreshold

Bombs/rockets/missiles are only tracked if player-range distance is smaller than this threshold [m]. Default 25000 m.

#string RANGE.ClassName

Name of the Class.

#boolean RANGE.Debug

If true, debug info is send as messages on the screen.

#table RANGE.Defaults

Default range parameters.

#table RANGE.MenuAddedTo

Table for monitoring which players already got an F10 menu.

#table RANGE.MenuF10

Main radio menu on group level.

#table RANGE.MenuF10Root

Main radio menu on mission level.

#table RANGE.Names

Global list of all defined range names.

#table RANGE.PlayerSettings

Individual player settings.

Utilities.Utils#SMOKECOLOR RANGE.StrafePitSmokeColor

Color id used to smoke strafe pit approach boxes.

Utilities.Utils#SMOKECOLOR RANGE.StrafeSmokeColor

Color id used to smoke strafe targets.

#number RANGE.TdelaySmoke

Time delay in seconds between impact of bomb and starting the smoke. Default 3 seconds.

#number RANGE.Tmsg

Time [sec] messages to players are displayed. Default 30 sec.

#boolean RANGE.autosave

If true, automatically save results every X seconds.

#table RANGE.bombPlayerResults

Table containing the bombing results of each player.

#table RANGE.bombingTargets

Table of targets to bomb.

#boolean RANGE.defaultsmokebomb

If true, initialize player settings to smoke bomb.

#number RANGE.dtBombtrack

Time step [sec] used for tracking released bomb/rocket positions. Default 0.005 seconds.

#boolean RANGE.eventmoose

If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.

#boolean RANGE.examinerexclusive

If true, only the examiner gets messages. If false, clients and examiner get messages.

#string RANGE.examinergroupname

Name of the examiner group which should get all messages.

#string RANGE.id

String id of range for output in DCS log.

#number RANGE.illuminationmaxalt

Maximum altitude AGL in meters at which illumination bombs are fired. Default is 1000 m.

#number RANGE.illuminationminalt

Minimum altitude AGL in meters at which illumination bombs are fired. Default is 500 m.

#number RANGE.instructorfreq

Frequency on which the range control transmitts.

Core.Point#COORDINATE RANGE.location

Coordinate of the range location.

#boolean RANGE.messages

Globally enable/disable all messages to players.

#number RANGE.nbombtargets

Number of bombing targets.

#number RANGE.ndisplayresult

Number of (player) results that a displayed. Default is 10.

#number RANGE.nstrafetargets

Number of strafing targets.

#table RANGE.planes

Table for administration.

Core.RadioQueue#RADIOQUEUE RANGE.rangecontrol

Range control radio queue.

#number RANGE.rangecontrolfreq

Frequency on which the range control transmitts.

#string RANGE.rangename

Name of the range.

#number RANGE.rangeradius

Radius of range defining its total size for e.g. smoking bomb impact points and sending radio messages. Default 5 km.

Core.Zone#ZONE RANGE.rangezone

MOOSE zone object of the range. For example, no bomb impacts are smoked if bombs fall outside of the range zone.

#number RANGE.scorebombdistance

Distance from closest target up to which bomb hits are counted. Default 1000 m.

#string RANGE.soundpath

Path inside miz file where the sound files are located. Default is "Range Soundfiles/".

#table RANGE.strafePlayerResults

Table containing the strafing results of each player.

#table RANGE.strafeStatus

Table containing the current strafing target a player as assigned to.

#table RANGE.strafeTargets

Table of strafing targets.

#number RANGE.strafemaxalt

Maximum altitude above ground for registering for a strafe run. Default is 914 m = 3000 ft.

#boolean RANGE.trackbombs

If true (default), all bomb types are tracked and impact point to closest bombing target is evaluated.

#boolean RANGE.trackmissiles

If true (default), all missile types are tracked and impact point to closest bombing target is evaluated.

#boolean RANGE.trackrockets

If true (default), all rocket types are tracked and impact point to closest bombing target is evaluated.

#string RANGE.version

Range script version.

Function(s)

Adds an End state.

Defined in:

Parameter:

State

Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Returns the End states.

Defined in:

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Returns a table with the scores defined.

Defined in:

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Returns a table with the Subs defined.

Defined in:

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Defined in:

Parameter:

State

Defined in:

Parameter:

CallBackTable

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Defined in:

Parameters:

Map

Event

Defined in:

Parameters:

step

trigger

params

EventName

Defined in:

Parameter:

EventName

Defined in:

Parameter:

EventName

Defined in:

Parameters:

Events

EventStructure

Defined in:

Parameters:

ParentFrom

ParentEvent

Defined in:

Parameters:

EventName

...

Defined in:

Parameter:

Current

Defined in:

Parameters:

subs

sub

name

Defined in:

Parameter:

e

Defined in:

Parameter:

e

Defined in:

Parameter:

state

Field(s)

Utilities.Utils#SMOKECOLOR RANGE.BombSmokeColor

Color id used for smoking bomb targets.

#number RANGE.BombtrackThreshold

Bombs/rockets/missiles are only tracked if player-range distance is smaller than this threshold [m]. Default 25000 m.

#string RANGE.ClassName

Name of the Class.

#boolean RANGE.Debug

If true, debug info is send as messages on the screen.

#table RANGE.Defaults

Default range parameters.

#table RANGE.MenuAddedTo

Table for monitoring which players already got an F10 menu.

#table RANGE.MenuF10

Main radio menu on group level.

#table RANGE.MenuF10Root

Main radio menu on mission level.

#table RANGE.Names

Global list of all defined range names.

#table RANGE.PlayerSettings

Individual player settings.

Utilities.Utils#SMOKECOLOR RANGE.StrafePitSmokeColor

Color id used to smoke strafe pit approach boxes.

Utilities.Utils#SMOKECOLOR RANGE.StrafeSmokeColor

Color id used to smoke strafe targets.

#number RANGE.TdelaySmoke

Time delay in seconds between impact of bomb and starting the smoke. Default 3 seconds.

#number RANGE.Tmsg

Time [sec] messages to players are displayed. Default 30 sec.

#boolean RANGE.autosave

If true, automatically save results every X seconds.

#table RANGE.bombPlayerResults

Table containing the bombing results of each player.

#table RANGE.bombingTargets

Table of targets to bomb.

#boolean RANGE.defaultsmokebomb

If true, initialize player settings to smoke bomb.

#number RANGE.dtBombtrack

Time step [sec] used for tracking released bomb/rocket positions. Default 0.005 seconds.

#boolean RANGE.eventmoose

If true, events are handled by MOOSE. If false, events are handled directly by DCS eventhandler. Default true.

#boolean RANGE.examinerexclusive

If true, only the examiner gets messages. If false, clients and examiner get messages.

#string RANGE.examinergroupname

Name of the examiner group which should get all messages.

#string RANGE.id

String id of range for output in DCS log.

#number RANGE.illuminationmaxalt

Maximum altitude AGL in meters at which illumination bombs are fired. Default is 1000 m.

#number RANGE.illuminationminalt

Minimum altitude AGL in meters at which illumination bombs are fired. Default is 500 m.

#number RANGE.instructorfreq

Frequency on which the range control transmitts.

Core.Point#COORDINATE RANGE.location

Coordinate of the range location.

#boolean RANGE.messages

Globally enable/disable all messages to players.

#number RANGE.nbombtargets

Number of bombing targets.

#number RANGE.ndisplayresult

Number of (player) results that a displayed. Default is 10.

#number RANGE.nstrafetargets

Number of strafing targets.

#table RANGE.planes

Table for administration.

Core.RadioQueue#RADIOQUEUE RANGE.rangecontrol

Range control radio queue.

#number RANGE.rangecontrolfreq

Frequency on which the range control transmitts.

#string RANGE.rangename

Name of the range.

#number RANGE.rangeradius

Radius of range defining its total size for e.g. smoking bomb impact points and sending radio messages. Default 5 km.

Core.Zone#ZONE RANGE.rangezone

MOOSE zone object of the range. For example, no bomb impacts are smoked if bombs fall outside of the range zone.

#number RANGE.scorebombdistance

Distance from closest target up to which bomb hits are counted. Default 1000 m.

#string RANGE.soundpath

Path inside miz file where the sound files are located. Default is "Range Soundfiles/".

#table RANGE.strafePlayerResults

Table containing the strafing results of each player.

#table RANGE.strafeStatus

Table containing the current strafing target a player as assigned to.

#table RANGE.strafeTargets

Table of strafing targets.

#number RANGE.strafemaxalt

Maximum altitude above ground for registering for a strafe run. Default is 914 m = 3000 ft.

#boolean RANGE.trackbombs

If true (default), all bomb types are tracked and impact point to closest bombing target is evaluated.

#boolean RANGE.trackmissiles

If true (default), all missile types are tracked and impact point to closest bombing target is evaluated.

#boolean RANGE.trackrockets

If true (default), all rocket types are tracked and impact point to closest bombing target is evaluated.

#string RANGE.version

Range script version.

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.

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.

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.

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

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

FromClass

Return value:

Get a Value given a Key from the Object.

Note that if the Object is destroyed, nillified 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:

#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 object is completely destroyed.

initiator : The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

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

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.

initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

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

initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

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.

initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft lands at an airbase, farp or ship 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 when a new mark was added.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts

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. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

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.

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.

initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. 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. 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.

Defined in:

Parameter:

The EventData structure.

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

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.

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:

#number:

The ScheduleID 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:

#number:

The ScheduleID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#function SchedulerFunction

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

Set the Class 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 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, nillified 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

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

#string 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:

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

TODO: Complete DCS#Event structure.
- The main event handling function... This function captures all events generated for the class. @param #BASE self @param DCS#Event event

Defined in:

Parameter:

event

Bomb target result.

Field(s)

#string RANGE.BombResult.airframe

Aircraft type of player.

#string RANGE.BombResult.date

OS date.

#number RANGE.BombResult.distance

Distance in meters.

#string RANGE.BombResult.name

Name of closest target.

#string RANGE.BombResult.player

Player name.

#string RANGE.BombResult.quality

Hit quality.

#number RANGE.BombResult.radial

Radial in degrees.

#number RANGE.BombResult.time

Time via timer.getAbsTime() in seconds of impact.

#string RANGE.BombResult.weapon

Name of the weapon.

Function(s)

Bomb target data.

Field(s)

#number RANGE.BombTarget.goodhitrange

Range in meters for a good hit.

#boolean RANGE.BombTarget.move

If true, unit move randomly.

#string RANGE.BombTarget.name

Name of unit.

#number RANGE.BombTarget.speed

Speed of unit.

Function(s)

Player settings.

Field(s)

#string RANGE.PlayerData.airframe

Aircraft type name.

#number RANGE.PlayerData.flarecolor

Color of flares.

#boolean RANGE.PlayerData.flaredirecthits

Flare when player directly hits a target.

#boolean RANGE.PlayerData.inzone

If true, player is inside the range zone.

#boolean RANGE.PlayerData.messages

Display info messages.

#string RANGE.PlayerData.playername

Name of player.

#boolean RANGE.PlayerData.smokebombimpact

Smoke bomb impact points.

#number RANGE.PlayerData.smokecolor

Color of smoke.

#string RANGE.PlayerData.unitname

Name of player aircraft unit.

Function(s)

Sound files.

Field(s)

Function(s)

Sound file data.

Field(s)

#number RANGE.Soundfile.duration

Duration in seconds.

#string RANGE.Soundfile.filename

Name of the file

Function(s)

Strafe target data.

Field(s)

#number RANGE.StrafeTarget.foulline

Foul line

#number RANGE.StrafeTarget.goodPass

Number of hits for a good pass.

#number RANGE.StrafeTarget.heading

Heading of pit.

#string RANGE.StrafeTarget.name

Name of the unit.

#number RANGE.StrafeTarget.smokepoints

Number of smoke points.

#table RANGE.StrafeTarget.targets

Table of target units.

Function(s)

Target type, i.e.

unit, static, or coordinate.

Field(s)

#string RANGE.TargetType.COORD

Target is a coordinate.

#string RANGE.TargetType.STATIC

Target is a static.

#string RANGE.TargetType.UNIT

Target is a unit.

Function(s)