Module Range

  • Functional - (R2.3) - Range Practice.

Banner Image


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.

Features

  • Impact points of bombs, rockets and missils 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 practices.
  • 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.

More information and examples can be found below.


Demo Missions

MOOSE - ALL Demo Missions


YouTube Channel

MOOSE YouTube Channel

MOOSE - On the Range - Demonstration Video


Author: funkyfranky

Contributions: FlightControl, Ciribob


Global(s)

RANGE

RANGE class, extends Core.Base#BASE

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

Type RANGE

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.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:GetFoullineDistance(namepit, namefoulline)

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

RANGE.MenuAddedTo

Table for monitoring which players already got an F10 menu.

RANGE.MenuF10

Main radio menu.

RANGE.Names

Global list of all defined range names.

RANGE:New(rangename)

RANGE contructor.

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

Indiviual player settings.

RANGE:SetBombTargetSmokeColor(colorid)

Set smoke color for marking bomb targets.

RANGE:SetBombtrackTimestep(dt)

Set time interval for tracking bombs.

RANGE:SetDisplayedMaxPlayerResults(nmax)

Set max number of player results that are displayed.

RANGE:SetMaxStrafeAlt(maxalt)

Set maximal strafing altitude.

RANGE:SetMessageTimeDuration(time)

Set time how long (most) messages are displayed.

RANGE:SetRangeLocation(coordinate)

Set range location.

RANGE:SetRangeRadius(radius)

Set range radius.

RANGE:SetSmokeTimeDelay(delay)

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

RANGE:SetStrafePitSmokeColor(colorid)

Set smoke color for marking strafe pit approach boxes.

RANGE:SetStrafeTargetSmokeColor(colorid)

Set smoke color for marking strafe targets.

RANGE:Start()

Initializes number of targets and location of the range.

RANGE.StrafePitSmokeColor

Color id used to smoke strafe pit approach boxes.

RANGE.StrafeSmokeColor

Color id used to smoke strafe targets.

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:_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 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:_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:_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:_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:_split(str, sep)

Split string.

RANGE.bombPlayerResults

Table containing the bombing results of each player.

RANGE.bombingTargets

Table of targets to 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.id

Some ID to identify who we are in output of the DCS.log file.

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

Coordinate of the range location.

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

Table for administration.

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

Global(s)

#RANGE RANGE

RANGE class, extends Core.Base#BASE

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" defindes 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 spector 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 findes 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 achive 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.

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.

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..." --> "Fxx. On the Range..." --> "F1. Your Range Name...".

The range menu contains the following submenues:

  • "F1. Mark Targets": Various ways to mark targets.
  • "F2. My Settings": Player specific settings.
  • "F3. Stats" Player: statistics and scores.
  • "Range Information": Information about the range, such as bearing and range. Also range and player specific settings are displayed.
  • "Weather Report": Temperatur, wind and QFE pressure information is provided.

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 Range

Type RANGE

Extends Core.Base#BASE

  • RANGE class

Field(s)

RANGE:AddBombingTargetGroup(group, goodhitrange, randommove)

Add all units of a group as bombing targets.

Parameters

  • Wrapper.Group#GROUP group : 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.

RANGE:AddBombingTargetUnit(unit, goodhitrange, randommove)

Add a unit or static object as bombing target.

Parameters

  • Wrapper.Positionable#POSITIONABLE unit : 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.

RANGE:AddBombingTargets(targetnames, goodhitrange, randommove)

Add bombing target(s) to 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.

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

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.

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.

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

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.

Parameters

  • Wrapper.Group#GROUP group : 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.

Utilities.Utils#SMOKECOLOR RANGE.BombSmokeColor

Color id used for smoking bomb targets.

#string RANGE.ClassName

Name of the Class.

#boolean RANGE.Debug

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

RANGE:DebugOFF()

Disable debug modus.

RANGE:DebugON()

Enable debug modus.

#table RANGE.Defaults

Default range parameters.

RANGE:GetFoullineDistance(namepit, namefoulline)

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

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.

#table RANGE.MenuAddedTo

Table for monitoring which players already got an F10 menu.

#table RANGE.MenuF10

Main radio menu.

#table RANGE.Names

Global list of all defined range names.

RANGE:New(rangename)

RANGE contructor.

Creates a new RANGE object.

Parameter

  • #string rangename : Name of the range. Has to be unique. Will we used to create F10 menu items etc.

Return value

#RANGE: RANGE object.

RANGE:OnEventBirth(EventData)

Range event handler for event birth.

Parameter

RANGE:OnEventHit(EventData)

Range event handler for event hit.

Parameter

RANGE:OnEventShot(EventData)

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

Parameter

#table RANGE.PlayerSettings

Indiviual player settings.

RANGE:SetBombTargetSmokeColor(colorid)

Set smoke color for marking bomb targets.

By default bomb targets are marked by red smoke.

Parameter

RANGE:SetBombtrackTimestep(dt)

Set time interval for tracking bombs.

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

Parameter

  • #number dt : Time interval in seconds. Default is 0.005 s.

RANGE:SetDisplayedMaxPlayerResults(nmax)

Set max number of player results that are displayed.

Parameter

  • #number nmax : Number of results. Default is 10.

RANGE:SetMaxStrafeAlt(maxalt)

Set maximal strafing altitude.

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

Parameter

  • #number maxalt : Maximum altitude AGL in meters. Default is 914 m= 3000 ft.

RANGE:SetMessageTimeDuration(time)

Set time how long (most) messages are displayed.

Parameter

  • #number time : Time in seconds. Default is 30 s.

RANGE:SetRangeLocation(coordinate)

Set range location.

If this is not done, one (random) unit position of the range is used to determine the center of the range.

Parameter

RANGE:SetRangeRadius(radius)

Set range radius.

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

Parameter

  • #number radius : Radius in km. Default 5 km.

RANGE:SetSmokeTimeDelay(delay)

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

Parameter

  • #number delay : Time delay in seconds. Default is 3 seconds.

RANGE:SetStrafePitSmokeColor(colorid)

Set smoke color for marking strafe pit approach boxes.

By default strafe pit boxes are marked by white smoke.

Parameter

RANGE:SetStrafeTargetSmokeColor(colorid)

Set smoke color for marking strafe targets.

By default strafe targets are marked by green smoke.

Parameter

RANGE:Start()

Initializes number of targets and location of the range.

Starts the event handlers.

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.

RANGE:TrackBombsOFF()

Disables tracking of all bomb types.

RANGE:TrackBombsON()

Enables tracking of all bomb types.

Note that this is the default setting.

RANGE:TrackMissilesOFF()

Disables tracking of all missile types.

RANGE:TrackMissilesON()

Enables tracking of all missile types.

Note that this is the default setting.

RANGE:TrackRocketsOFF()

Disables tracking of all rocket types.

RANGE:TrackRocketsON()

Enables tracking of all rocket types.

Note that this is the default setting.

RANGE:_AddF10Commands(_unitName)

Add menu commands for player.

Parameter

  • #string _unitName : Name of player unit.

RANGE:_CheckInZone(_unitName)

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.

Parameter

  • #string _unitName : Name of player unit.

RANGE:_CheckStatic(name)

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.

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.

RANGE._DelayedSmoke(_args)

Start smoking a coordinate with a delay.

Parameter

  • #table _args : Argements passed.

RANGE:_DisplayBombTargets(_unitname)

Display bombing target locations to player.

Parameter

  • #string _unitname : Name of the player unit.

RANGE:_DisplayBombingResults(_unitName)

Display best bombing results of top 10 players.

Parameter

  • #string _unitName : Name of player unit.

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

Display message to group.

Parameters

  • Wrapper.Unit#UNIT _unit : Player unit.

  • #string _text : Message text.

  • #number _time : Duration how long the message is displayed.

  • #boolean _clear : Clear up old messages.

RANGE:_DisplayMyBombingResults(_unitName)

Display top 10 bombing run results of specific player.

Parameter

  • #string _unitName : Name of the player unit.

RANGE:_DisplayMyStrafePitResults(_unitName)

Display top 10 stafing results of a specific player.

Parameter

  • #string _unitName : Name of the player unit.

RANGE:_DisplayRangeInfo(_unitname)

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

Parameter

  • #string _unitname : Name of the player unit.

RANGE:_DisplayRangeWeather(_unitname)

Report weather conditions at range.

Temperature, QFE pressure and wind data.

Parameter

  • #string _unitname : Name of the player unit.

RANGE:_DisplayStrafePitResults(_unitName)

Display top 10 strafing results of all players.

Parameter

  • #string _unitName : Name fo the player unit.

RANGE:_DisplayStrafePits(_unitname)

Display pit location and heading to player.

Parameter

  • #string _unitname : Name of the player unit.

RANGE:_FlareDirectHitsOnOff(unitname)

Toggle status of flaring direct hits of range targets.

Parameter

  • #string unitname : Name of the player unit.

RANGE:_GetAmmo(unitname)

Get the number of shells a unit currently has.

Parameter

  • #string unitname : Name of the player unit.

Return value

Number of shells left

RANGE:_GetPlayerUnitAndName(_unitName)

Returns the unit of a player and the player name.

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

Parameter

  • #string _unitName : Name of the player unit.

Return values

  1. Wrapper.Unit#UNIT: Unit of player.

  2. #string: Name of the player.

  3. nil If player does not exist.

RANGE:_GetSpeed(controllable)

Get max speed of controllable.

Parameter

Return value

Maximum speed in km/h.

RANGE:_IlluminateBombTargets(_unitName)

Illuminate targets.

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

Parameter

  • #string _unitName : (Optional) Name of the player unit.

RANGE:_MarkTargetsOnMap(_unitName)

Mark targets on F10 map.

Parameter

  • #string _unitName : Name of the player unit.

RANGE:_ResetRangeStats(_unitName)

Reset player statistics.

Parameter

  • #string _unitName : Name of the player unit.

RANGE:_SmokeBombDelayOnOff(unitname)

Toggle status of time delay for smoking bomb impact points

Parameter

  • #string unitname : Name of the player unit.

RANGE:_SmokeBombImpactOnOff(unitname)

Toggle status of smoking bomb impact points.

Parameter

  • #string unitname : Name of the player unit.

RANGE:_SmokeBombTargets(unitname)

Mark bombing targets with smoke.

Parameter

  • #string unitname : Name of the player unit.

RANGE:_SmokeStrafeTargetBoxes(unitname)

Mark approach boxes of strafe targets with smoke.

Parameter

  • #string unitname : Name of the player unit.

RANGE:_SmokeStrafeTargets(unitname)

Mark strafing targets with smoke.

Parameter

  • #string unitname : Name of the player unit.

RANGE:_flarecolor2text(color)

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

Parameter

Return value

#string: Color text.

RANGE:_myname(unitname)

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

Parameter

  • #string unitname : Name of the player unit.

RANGE:_playerflarecolor(_unitName, color)

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

Parameters

RANGE:_playersmokecolor(_unitName, color)

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

Parameters

RANGE:_smokecolor2text(color)

Converts a smoke color id to text.

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

Parameter

Return value

#string: Color text.

RANGE:_split(str, sep)

Split string.

Cf http://stackoverflow.com/questions/1426954/split-string-in-lua

Parameters

  • #string str : Sting to split.

  • #string sep : Speparator for split.

Return value

#table: Split text.

#table RANGE.bombPlayerResults

Table containing the bombing results of each player.

#table RANGE.bombingTargets

Table of targets to 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.

#string RANGE.id

Some ID to identify who we are in output of the DCS.log file.

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

Core.Point#COORDINATE RANGE.location

Coordinate of the range location.

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

RANGE:onEvent(Event)

General event handler.

Parameter

  • #table Event : DCS event table.

#table RANGE.planes

Table for administration.

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

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

#number RANGE.version

Range script version.