Banner Image

Module DCS

DCS API Prototypes.


See the Simulator Scripting Engine Documentation on Hoggit for further explanation and examples.

Global(s)

Global AI

Global Airbase

Global CoalitionObject

Global Controller

Global Event

Global Group

Global Object

Global Spot

Global StaticObject

Global Unit

Global Warehouse

Global Weapon

Global Zone

#table Zone

Global coalition

Global country

Global env

DCS Singleton env

Global land

DCS Singleton land

Global radio

#table radio

Global timer

DCS Singleton timer

Global world

The world singleton contains functions centered around two different but extremely useful functions.

#world world

The world singleton contains functions centered around two different but extremely useful functions.

  • Events and event handlers are all governed within world.
  • A number of functions to get information about the game world.

See https://wiki.hoggitworld.com/view/DCS_singleton_world

Type(s)

AI
Fields and Methods inherited from AI Description

AI.Option

AI.Skill

AI.Task

Fields and Methods inherited from AI.Option Description

AI.Option.Air

AI.Option.Ground

AI.Option.Naval

Fields and Methods inherited from AI.Option.Air Description

AI.Option.Air.id

AI.Option.Air.val

Fields and Methods inherited from AI.Option.Ground Description

AI.Option.Ground.id

AI.Option.Ground.mid

AI.Option.Ground.mval

AI.Option.Ground.val

Fields and Methods inherited from AI.Option.Ground.mval Description

AI.Option.Ground.mval.ENGAGE_TARGETS

Fields and Methods inherited from AI.Option.Ground.mval.ENGAGE_TARGETS Description

AI.Option.Ground.mval.ENGAGE_TARGETS.AIR_UNITS_ONLY

-- 1

AI.Option.Ground.mval.ENGAGE_TARGETS.ANY_TARGET

-- 0

AI.Option.Ground.mval.ENGAGE_TARGETS.GROUND_UNITS_ONLY

-- 2

Fields and Methods inherited from AI.Option.Ground.val Description

AI.Option.Ground.val.ALARM_STATE

AI.Option.Ground.val.RESTRICT_TARGETS

AI.Option.Ground.val.ROE

Fields and Methods inherited from AI.Option.Ground.val.ALARM_STATE Description

AI.Option.Ground.val.ALARM_STATE.AUTO

AI.Option.Ground.val.ALARM_STATE.GREEN

AI.Option.Ground.val.ALARM_STATE.RED

Fields and Methods inherited from AI.Option.Ground.val.ROE Description

AI.Option.Ground.val.ROE.OPEN_FIRE

AI.Option.Ground.val.ROE.RETURN_FIRE

AI.Option.Ground.val.ROE.WEAPON_HOLD

Fields and Methods inherited from AI.Option.Naval.id Description

AI.Option.Naval.id.NO_OPTION

AI.Option.Naval.id.ROE

Fields and Methods inherited from AI.Option.Naval.val Description

AI.Option.Naval.val.ROE

Fields and Methods inherited from AI.Option.Naval.val.ROE Description

AI.Option.Naval.val.ROE.OPEN_FIRE

AI.Option.Naval.val.ROE.RETURN_FIRE

AI.Option.Naval.val.ROE.WEAPON_HOLD

Fields and Methods inherited from AI.Skill Description

AI.Skill.AVERAGE

AI.Skill.CLIENT

AI.Skill.EXCELLENT

AI.Skill.GOOD

AI.Skill.HIGH

AI.Skill.PLAYER

Fields and Methods inherited from AI.Task.AltitudeType Description

AI.Task.AltitudeType.BARO

AI.Task.AltitudeType.RADIO

Fields and Methods inherited from AI.Task.OrbitPattern Description

AI.Task.OrbitPattern.CIRCLE

AI.Task.OrbitPattern.RACE_TRACK

Fields and Methods inherited from AI.Task.TurnMethod Description

AI.Task.TurnMethod.FIN_POINT

AI.Task.TurnMethod.FLY_OVER_POINT

Fields and Methods inherited from Airbase Description

Airbase.Category

enum contains identifiers of airbase categories.

Airbase.Desc

Airbase descriptor. Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.

Airbase.ID

Identifier of an airbase. It assigned to an airbase by the Mission Editor automatically. This identifier is used in AI tasks to refer an airbase that exists (spawned and not dead) or not.

Airbase:autoCapture(setting)

Enables or disables the airbase and FARP auto capture game mechanic where ownership of a base can change based on the presence of ground forces or the default setting assigned in the editor.

Airbase:autoCaptureIsOn()

Returns the current autoCapture setting for the passed base.

Airbase.getByName(name)

Returns airbase by its name.

Airbase:getCallsign()

Returns the airbase's callsign - the localized string.

Airbase:getDesc()

Returns descriptor of the airbase.

Airbase.getDescByName(typeName)

Returns airbase descriptor by type name.

Airbase:getID()

Returns identifier of the airbase.

Airbase:getResourceMap()

Returns the wsType of every object that exists in DCS.

Airbase:getUnit()

Returns Unit that is corresponded to the airbase.

Airbase:getWarehouse()

Returns the warehouse object associated with the airbase object.

Airbase:setCoalition(coa)

Changes the passed airbase object's coalition to the set value.

Fields and Methods inherited from Airbase.Category Description

Airbase.Category.AIRDROME

Airbase.Category.HELIPAD

Airbase.Category.SHIP

Airbase.Desc , extends #Desc
Fields and Methods inherited from Airbase.Desc Description

Airbase.Desc.category

Category of the airbase type.

Fields and Methods inherited from Box3 Description

Box3.max

Max

Box3.min

Min.

Fields and Methods inherited from CoalitionObject Description

CoalitionObject:getCoalition()

Returns coalition of the object.

CoalitionObject:getCountry()

Returns object country.

Fields and Methods inherited from Controller Description

Controller.Detection

Enum contains identifiers of surface types.

Controller:getDetectedTargets(detection)

Returns list of detected targets.

Controller:hasTask()

Returns true if the controller has a task.

Controller:isTargetDetected(target, detection)

Checks if the target is detected or not.

Controller:knowTarget(object, type, distance)

Know a target.

Controller:popTask()

Pops current (front) task from the queue and makes active next task in the queue (if exists).

Controller:pushTask(task)

Pushes the task to the front of the queue and makes the task active.

Controller:resetTask()

Resets current task of the controller.

Controller:setOnOff(value)

Enables and disables the controller.

Controller:setOption(optionId, optionValue)

Sets the option to the controller.

Controller:setTask(task)

Resets current task and then sets the task to the controller.

Fields and Methods inherited from Controller.DetectedTarget Description

Controller.DetectedTarget.distance

Distance to the target is known

Controller.DetectedTarget.object

The target

Controller.DetectedTarget.type

The target type is known

Controller.DetectedTarget.visible

The target is visible

Fields and Methods inherited from Controller.Detection Description

Controller.Detection.DLINK

Data link detection. Numeric value 32.

Controller.Detection.IRST

Infra-red search and track detection. Numeric value 8.

Controller.Detection.OPTIC

Optical detection. Numeric value 2.

Controller.Detection.RADAR

Radar detection. Numeric value 4.

Controller.Detection.RWR

Radar Warning Receiver detection. Numeric value 16.

Controller.Detection.VISUAL

Visual detection. Numeric value 1.

Fields and Methods inherited from Desc Description

Desc.Hmax

Max height in meters.

Desc.Kab

?

Desc.Kmax

?

Desc.NyMax

?

Desc.NyMin

?

Desc.RCS

?

Desc.VyMax

Max vertical velocity in m/s.

Desc.attributes

Table of attributes.

Desc.box

Bounding box.

Desc.category

Unit category.

Desc.displayName

Localized display name.

Desc.fuelMassMax

Max fuel mass in kg.

Desc.life

Life points.

Desc.massEmpty

Empty mass in kg.

Desc.massMax

Max mass of unit.

Desc.range

Range in km(?).

Desc.speedMax0

Max speed in meters/second at zero altitude.

Desc.speedMax10K

Max speed in meters/second.

Desc.tankerType

Type of refueling system: 0=boom, 1=probe.

Desc.typeName

Type Name.

Fields and Methods inherited from Event Description

Event.coalition

Coalition ID.

Event.comment

Comment, e.g. LSO score.

Event.groupID

Group ID, e.g. of group that added mark point.

Event.id

Event ID.

Event.idx

Mark ID.

Event.initiator

Unit initiating the event.

Event.number

subPlace Subplace. Unknown and often just 0.

Event.place

Airbase.

Event.pos

Position vector, e.g. of mark point.

Event.target

Target unit.

Event.text

Text, e.g. of mark point.

Event.time

Mission time in seconds.

Event.weapon_name

Weapoin name.

Fields and Methods inherited from Group Description

Group.Category

Enum contains identifiers of group types.

Group.ID

Identifier of a group. It is assigned to a group by Mission Editor automatically.

Group:destroy()

Destroys the group and all of its units.

Group:enableEmission(switch)

GROUND - Switch on/off radar emissions

Group.getByName(name)

Returns group by the name assigned to the group in Mission Editor.

Group:getCategory()

Returns category of the group.

Group:getCoalition()

Returns the coalition of the group.

Group:getController()

Returns controller of the group.

Group:getID()

Returns the group identifier.

Group:getInitialSize()

Returns initial size of the group.

Group:getName()

Returns the group's name.

Group:getSize()

Returns current size of the group.

Group:getUnit(unitNumber)

Returns the unit with number unitNumber.

Group:getUnits()

Returns array of the units present in the group now.

Group:isExist()

returns true if the group exist or false otherwise.

Fields and Methods inherited from Object Description

Object.Category

Object.Desc

Object:destroy()

Object:getCategory()

Object:getDesc()

Returns object descriptor.

Object:getName()

Returns name of the object.

Object:getPoint()

Returns object coordinates for current time.

Object:getPosition()

Returns object position for current time.

Object:getTypeName()

Returns type name of the Object.

Object:getVelocity()

Returns the unit's velocity vector.

Object:hasAttribute(attributeName)

Returns true if the object belongs to the category.

Object:inAir()

Returns true if the unit is in air.

Object:isActive()

Object:isExist()

Fields and Methods inherited from Position3 Description

Position3.p

3D position vector.

Position3.x

Orientation component of vector pointing East.

Position3.y

Orientation component of vector pointing up.

Position3.z

Orientation component of vector pointing North.

Fields and Methods inherited from Spot Description

Spot.Category

enum that stores spot categories.

Spot.createInfraRed(Source, LocalRef, Vec3)

Creates an infrared ray emanating from the given object to a point in 3d space.

Spot.createLaser(Source, LocalRef, Vec3, LaserCode)

Creates a laser ray emanating from the given object to a point in 3d space.

Spot:destroy()

Destroys the spot.

Spot:getCategory()

Gets the category of the spot (laser or IR).

Spot:getCode()

Returns the number that is used to define the laser code for which laser designation can track.

Spot:getPoint()

Returns a vec3 table of the x, y, and z coordinates for the position of the given object in 3D space.

Spot:setCode(Code)

Sets the number that is used to define the laser code for which laser designation can track.

Spot:setPoint(Vec3)

Sets the destination point from which the source of the spot is drawn toward.

Fields and Methods inherited from Spot.Category Description

Spot.Category.INFRA_RED

Spot.Category.LASER

Fields and Methods inherited from StaticObject Description

StaticObject.getByName(name)

Returns the static object.

Fields and Methods inherited from Object Description

StaticObject.Category

StaticObject.Desc

StaticObject:destroy()

StaticObject:getCategory()

StaticObject:getDesc()

Returns object descriptor.

StaticObject:getName()

Returns name of the object.

StaticObject:getPoint()

Returns object coordinates for current time.

StaticObject:getPosition()

Returns object position for current time.

StaticObject:getTypeName()

Returns type name of the Object.

StaticObject:getVelocity()

Returns the unit's velocity vector.

StaticObject:hasAttribute(attributeName)

Returns true if the object belongs to the category.

StaticObject:inAir()

Returns true if the unit is in air.

StaticObject:isActive()

StaticObject:isExist()

Fields and Methods inherited from Task Description

Task.id

Task.param

Fields and Methods inherited from Template Description

Template.lateActivation

Group is late activated.

Template.uncontrolled

Aircraft is uncontrolled.

Template.units

Unit list.

Template.x

2D Position on x-axis in meters.

Template.y

2D Position on y-axis in meters.

Fields and Methods inherited from Template.Unit Description

Template.Unit.alt

Template.Unit.name

Name of the unit.

Template.Unit.x

Template.Unit.y

Fields and Methods inherited from Unit Description

Unit.Ammo

Unit.AmmoItem

Unit.Category

Unit.Desc

Unit.DescAircraft

Unit.DescAirplane

Unit.DescHelicopter

Unit.DescShip

Unit.DescVehicle

Unit.ID

Identifier of an unit. It assigned to an unit by the Mission Editor automatically.

Unit.IRST

Unit.Optic

Unit.OpticType

Unit.Radar

Unit.RadarType

Unit.RefuelingSystem

Unit.Sensor

Unit.SensorType

Unit:enableEmission(switch)

GROUND - Switch on/off radar emissions

Unit:getAmmo()

Returns the unit ammunition.

Unit.getByName(name)

Returns unit object by the name assigned to the unit in Mission Editor.

Unit:getCallsign()

Returns the unit's callsign - the localized string.

Unit:getController()

Returns controller of the unit if it exist and nil otherwise

Unit:getDesc()

Returns unit descriptor.

Unit:getDescentCapacity()

Returns the number of infantry that can be embark onto the aircraft.

Unit:getFuel()

Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks.

Unit:getGroup()

Returns the unit's group if it exist and nil otherwise

Unit:getID()

returns the unit's unique identifier.

Unit:getLife()

Returns the unit's health.

Unit:getLife0()

returns the unit's initial health.

Unit:getNumber()

Returns the unit's number in the group.

Unit:getPlayerName()

Returns name of the player that control the unit or nil if the unit is controlled by A.I.

Unit:getRadar()

returns two values: First value indicates if at least one of the unit's radar(s) is on.

Unit:getSensors()

Returns the unit sensors.

Unit:hasSensors(sensorType, ...)

Returns true if the unit has specified types of sensors.

Unit:isActive()

Returns if the unit is activated.

Fields and Methods inherited from Unit.AmmoItem Description

Unit.AmmoItem.count

ammunition count

Unit.AmmoItem.desc

ammunition descriptor

Fields and Methods inherited from Unit.Desc Description

Unit.Desc.category

Unit Category

Unit.Desc.massEmpty

mass of empty unit

Unit.Desc.speedMax

istance / Time, --maximal velocity

Fields and Methods inherited from Unit.DescAircraft Description

Unit.DescAircraft.Hmax

Ceiling

Unit.DescAircraft.NyMax

maximal safe acceleration

Unit.DescAircraft.NyMin

minimal safe acceleration

Unit.DescAircraft.VyMax

#Distance / #Time, --maximal climb rate

Unit.DescAircraft.fuelMassMax

maximal inner fuel mass

Unit.DescAircraft.range

Operational range

Unit.DescAircraft.tankerType

refueling system type

Fields and Methods inherited from Unit.DescAirplane Description

Unit.DescAirplane.speedMax0

Distance / Time maximal TAS at ground level

Unit.DescAirplane.speedMax10K

Distance / Time maximal TAS at altitude of 10 km

Fields and Methods inherited from Unit.DescHelicopter Description

Unit.DescHelicopter.HmaxStat

static ceiling

Fields and Methods inherited from Unit.DescVehicle Description

Unit.DescVehicle.maxSlopeAngle

maximal slope angle

Unit.DescVehicle.riverCrossing

can the vehicle cross a rivers

Fields and Methods inherited from Unit.IRST Description

Unit.IRST.detectionDistanceAfterburner

..., engines are in afterburner mode

Unit.IRST.detectionDistanceIdle

detection of tail-on target with heat signature = 1 in upper hemisphere, engines are in idle

Unit.IRST.detectionDistanceMaximal

..., engines are in maximal mode

Fields and Methods inherited from Unit.Optic Description

Unit.Optic.opticType

Fields and Methods inherited from Unit.OpticType Description

Unit.OpticType.IR

Infra-Red optic sensor

Unit.OpticType.LLTV

Low-level TV-sensor

Unit.OpticType.TV

TV-sensor

Fields and Methods inherited from Unit.Radar Description

Unit.Radar.detectionDistanceAir

detection distance for RCS=1m^2 airborne target, nil if radar doesn't support air search

Unit.Radar.detectionDistanceHRM

detection distance for RCS=1m^2 in high-resolution mapping mode, nil if radar has no HRM

Unit.Radar.detectionDistanceRBM

detection distance for RCS=1m^2 in real-beam mapping mode, nil if radar doesn't support surface/land search

Fields and Methods inherited from Unit.Radar.detectionDistanceAir Description

Unit.Radar.detectionDistanceAir.lowerHemisphere

Unit.Radar.detectionDistanceAir.upperHemisphere

Fields and Methods inherited from Unit.Radar.detectionDistanceAir.lowerHemisphere Description

Unit.Radar.detectionDistanceAir.lowerHemisphere.headOn

Unit.Radar.detectionDistanceAir.lowerHemisphere.tailOn

Fields and Methods inherited from Unit.Radar.detectionDistanceAir.upperHemisphere Description

Unit.Radar.detectionDistanceAir.upperHemisphere.headOn

Unit.Radar.detectionDistanceAir.upperHemisphere.tailOn

Fields and Methods inherited from Unit.RadarType Description

Unit.RadarType.AS

air search radar

Unit.RadarType.SS

surface/land search radar

Fields and Methods inherited from Unit.RefuelingSystem Description

Unit.RefuelingSystem.BOOM_AND_RECEPTACLE

Tanker with a boom.

Unit.RefuelingSystem.PROBE_AND_DROGUE

Tanker with a probe.

Fields and Methods inherited from Unit.Sensor Description

Unit.Sensor.type

Unit.Sensor.typeName

Fields and Methods inherited from Unit.SensorType Description

Unit.SensorType.IRST

Unit.SensorType.OPTIC

Unit.SensorType.RADAR

Unit.SensorType.RWR

Fields and Methods inherited from Vec2 Description

Vec2.x

Vec2.x = Vec3.x

Vec2.y

Vec2.y = Vec3.z

Fields and Methods inherited from Vec3 Description

Vec3.x

is directed to the North

Vec3.y

is directed up

Vec3.z

is directed to the East

Fields and Methods inherited from Warehouse Description

Warehouse:addItem(itemName, count)

Adds the passed amount of a given item to the warehouse.

Warehouse:addLiquid(liquidType, count)

Adds the passed amount of a liquid fuel into the warehouse inventory.

Warehouse.getByName(Name)

Get a warehouse by passing its name.

Warehouse:getInventory(itemName)

Returns a full itemized list of everything currently in a warehouse.

Warehouse:getItemCount(itemName)

Returns the number of the passed type of item currently in a warehouse object.

Warehouse:getLiquidAmount(liquidType)

Returns the amount of the passed liquid type within a given warehouse.

Warehouse:getOwner()

Returns the airbase object associated with the warehouse object.

Warehouse:removeItem(itemName, count)

Removes the amount of the passed item from the warehouse.

Warehouse:setItem(itemName, count)

Sets the passed amount of a given item to the warehouse.

Warehouse:setLiquidAmount(liquidType, count)

Removes the set amount of liquid from the inventory in a warehouse.

Fields and Methods inherited from WaypointAir Description

WaypointAir.lateActivated

WaypointAir.uncontrolled

Fields and Methods inherited from Weapon Description

Weapon.Category

enum that stores weapon categories.

Weapon.Desc

The descriptor of a weapon.

Weapon.GuidanceType

enum that stores guidance methods. Available only for guided weapon (Weapon.Category.MISSILE and some Weapon.Category.BOMB).

Weapon.MissileCategory

enum that stores missile category. Available only for missiles (Weapon.Category.MISSILE).

Weapon.WarheadType

enum that stores warhead types.

Weapon.flag

enum stores weapon flags. Some of them are combination of another flags.

Weapon:getDesc()

returns weapon descriptor.

Weapon:getLauncher()

Returns the unit that launched the weapon.

Weapon:getTarget()

returns target of the guided weapon.

Fields and Methods inherited from Weapon.Category Description

Weapon.Category.BOMB

Bomb.

Weapon.Category.MISSILE

Missile

Weapon.Category.ROCKET

Rocket.

Weapon.Category.SHELL

Shell.

Weapon.Category.TORPEDO

Torpedo.

Fields and Methods inherited from Weapon.WarheadType Description

Weapon.WarheadType.AP

Weapon.WarheadType.HE

Weapon.WarheadType.SHAPED_EXPLOSIVE

Fields and Methods inherited from Weapon.flag Description

Weapon.flag.AR_AAM

Weapon.flag.AntiRadarMissile

Weapon.flag.AntiShipMissile

Weapon.flag.AntiTankMissile

Weapon.flag.AnyAAM

= IR_AAM + SAR_AAM + AR_AAM + SRAAM + MRAAM + LRAAM

Weapon.flag.AnyAAWeapon

= BuiltInCannon + GUN_POD + AnyAAM

Weapon.flag.AnyAGWeapon

= BuiltInCannon + GUN_POD + AnyBomb + AnyRocket + AnyASM

Weapon.flag.AnyASM

= AntiRadarMissile + AntiShipMissile + AntiTankMissile + FireAndForgetASM + GuidedASM + CruiseMissile

Weapon.flag.AnyAutonomousMissile

= IR_AAM + AntiRadarMissile + AntiShipMissile + FireAndForgetASM + CruiseMissile

Weapon.flag.AnyBomb

= GuidedBomb + AnyUnguidedBomb

Weapon.flag.AnyMissile

= AnyASM + AnyAAM

Weapon.flag.AnyRocket

= LightRocket + HeavyRocket + MarkerRocket + CandleRocket

Weapon.flag.AnyUnguidedBomb

= HEBomb + Penetrator + NapalmBomb + FAEBomb + ClusterBomb + Dispencer + CandleBomb + ParachuteBomb

Weapon.flag.AnyWeapon

= AnyBomb + AnyRocket + AnyMissile + Cannons

Weapon.flag.ArmWeapon

= AnyWeapon - MarkerWeapon

Weapon.flag.BuiltInCannon

Weapon.flag.CandleBomb

Weapon.flag.CandleRocket

Weapon.flag.Cannons

= GUN_POD + BuiltInCannon

Weapon.flag.ClusterBomb

Weapon.flag.CruiseMissile

Weapon.flag.Dispencer

Weapon.flag.FAEBomb

Weapon.flag.FireAndForgetASM

Weapon.flag.GUN_POD

Weapon.flag.GuidedASM

= LaserASM + TeleASM

Weapon.flag.GuidedBomb

= LGB + TvGB + SNSGB

Weapon.flag.GuidedWeapon

= GuidedBomb + AnyASM + AnyAAM

Weapon.flag.HEBomb

Weapon.flag.HeavyRocket

Weapon.flag.IR_AAM

Weapon.flag.LGB

Weapon.flag.LRAAM

Weapon.flag.LaserASM

Weapon.flag.LightRocket

Weapon.flag.MRAAM

Weapon.flag.MarkerRocket

Weapon.flag.MarkerWeapon

= MarkerRocket + CandleRocket + CandleBomb

Weapon.flag.NapalmBomb

Weapon.flag.ParachuteBomb

Weapon.flag.Penetrator

Weapon.flag.SAR_AAM

Weapon.flag.SNSGB

Weapon.flag.SRAAM

Weapon.flag.TacticASM

= GuidedASM + FireAndForgetASM

Weapon.flag.TeleASM

Weapon.flag.TvGB

Weapon.flag.UnguidedWeapon

= Cannons + BuiltInCannon + GUN_POD + AnyUnguidedBomb + AnyRocket

Fields and Methods inherited from coalition Description

coalition.addGroup(countryId, groupCategory, groupData)

Dynamically spawns a group.

coalition.addStaticObject(countryId, groupData)

Dynamically spawns a static object.

coalition.getCountryCoalition(countryId)

Get country coalition.

coalition.side

Fields and Methods inherited from coalition.side Description

coalition.side.BLUE

coalition.side.NEUTRAL

coalition.side.RED

Fields and Methods inherited from country Description

country.id

Fields and Methods inherited from country.id Description

country.id.ABKHAZIA

country.id.AGGRESSORS

country.id.ALGERIA

country.id.AUSTRALIA

country.id.AUSTRIA

country.id.Argentinia

country.id.BAHRAIN

country.id.BELARUS

country.id.BELGIUM

country.id.BOLIVIA

country.id.BRAZIL

country.id.BULGARIA

country.id.CANADA

country.id.CHEZH_REPUBLIC

country.id.CHILE

country.id.CHINA

country.id.CJTF_BLUE

country.id.CJTF_RED

country.id.CROATIA

country.id.CUBA

country.id.Cyprus

country.id.DENMARK

country.id.ECUADOR

country.id.EGYPT

country.id.ETHIOPIA

country.id.FINLAND

country.id.FRANCE

country.id.GDR

country.id.GEORGIA

country.id.GERMANY

country.id.GHANA

country.id.GREECE

country.id.HONDURAS

country.id.HUNGARY

country.id.INDIA

country.id.INDONESIA

country.id.INSURGENTS

country.id.IRAN

country.id.IRAQ

country.id.ISRAEL

country.id.ITALIAN_SOCIAL_REPUBLIC

country.id.ITALY

country.id.JAPAN

country.id.JORDAN

country.id.KAZAKHSTAN

country.id.KUWAIT

country.id.LEBANON

country.id.LIBYA

country.id.MALAYSIA

country.id.MEXICO

country.id.MOROCCO

country.id.NIGERIA

country.id.NORTH_KOREA

country.id.NORWAY

country.id.OMAN

country.id.PAKISTAN

country.id.PERU

country.id.PHILIPPINES

country.id.POLAND

country.id.PORTUGAL

country.id.QATAR

country.id.ROMANIA

country.id.RUSSIA

country.id.SAUDI_ARABIA

country.id.SERBIA

country.id.SLOVAKIA

country.id.SOUTH_AFRICA

country.id.SOUTH_KOREA

country.id.SOUTH_OSETIA

country.id.SPAIN

country.id.SUDAN

country.id.SWEDEN

country.id.SWITZERLAND

country.id.SYRIA

country.id.Slovenia

country.id.THAILAND

country.id.THE_NETHERLANDS

country.id.THIRDREICH

country.id.TUNISIA

country.id.TURKEY

country.id.UK

country.id.UKRAINE

country.id.UNITED_ARAB_EMIRATES

country.id.UN_PEACEKEEPERS

country.id.USA

country.id.USSR

country.id.VENEZUELA

country.id.VIETNAM

country.id.YEMEN

country.id.YUGOSLAVIA

env
Fields and Methods inherited from env Description

env.error(message, showMessageBox)

Add message to simulator log with caption "ERROR".

env.info(message, showMessageBox)

Add message to simulator log with caption "INFO".

env.setErrorMessageBoxEnabled(on)

Enables/disables appearance of message box each time lua error occurs.

env.warning(message, showMessageBox)

Add message to simulator log with caption "WARNING".

Fields and Methods inherited from land Description

land.SurfaceType

land.getHeight(point)

Returns the distance from sea level (y-axis) of a given vec2 point.

land.getSurfaceHeightWithSeabed(point)

Returns the surface height and depth of a point.

land.getSurfaceType(point)

Returns surface type at the given point.

Fields and Methods inherited from land.SurfaceType Description

land.SurfaceType.LAND

Land=1

land.SurfaceType.ROAD

Road=4

land.SurfaceType.RUNWAY

Runway=5

land.SurfaceType.SHALLOW_WATER

Shallow water=2

land.SurfaceType.WATER

Water=3

Fields and Methods inherited from radio Description

radio.modulation

Fields and Methods inherited from radio.modulation Description

radio.modulation.AM

radio.modulation.FM

Fields and Methods inherited from timer Description

timer.getAbsTime()

Returns mission time in seconds.

timer.getTime()

Returns model time in seconds.

timer.getTime0()

Returns mission start time in seconds.

timer.removeFunction(functionId)

Removes the function from schedule.

timer.scheduleFunction(functionToCall, functionArgument, time)

Schedules function to call at desired model time.

timer.setFunctionTime(functionId, time)

Re-schedules function to call at another model time.

Fields and Methods inherited from world Description

world.BirthPlace

The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.

world.VolumeType

The volumeType enumerator defines the types of 3d geometery used within the world.searchObjects function.

world.addEventHandler(handler)

Adds a function as an event handler that executes whenever a simulator event occurs.

world.event

https://wiki.hoggitworld.com/view/DCS_enum_world

world.getAirbases(coalitionId)

Returns a table of DCS airbase objects.

world.getMarkPanels()

Returns a table of mark panels indexed numerically that are present within the mission.

world.getPlayer()

Returns a table of the single unit object in the game who's skill level is set as "Player".

world.removeEventHandler(handler)

Removes the specified event handler from handling events.

world.searchObjects(objectcategory, volume, ObjectSeachHandler, any)

Searches a defined volume of 3d space for the specified objects within it and then can run function on each returned object.

world.weather

Weather functions for fog etc.

Fields and Methods inherited from world.FogAnimation Description

world.FogAnimation.thickness

world.FogAnimation.time

world.FogAnimation.visibility

Fields and Methods inherited from world.VolumeType Description

world.VolumeType.BOX

world.VolumeType.PYRAMID

world.VolumeType.SEGMENT

world.VolumeType.SPHERE

Fields and Methods inherited from world.event Description

world.event.S_EVENT_AI_ABORT_MISSION

= 38

world.event.S_EVENT_BASE_CAPTURED

= 10

world.event.S_EVENT_BDA

= 37 -- battle damage assessment

world.event.S_EVENT_BIRTH

= 15

world.event.S_EVENT_CRASH

= 5

world.event.S_EVENT_DAYNIGHT

= 39

world.event.S_EVENT_DEAD

= 8

world.event.S_EVENT_DETAILED_FAILURE

= 17

world.event.S_EVENT_DISCARD_CHAIR_AFTER_EJECTION

= 33

world.event.S_EVENT_EJECTION

= 6

world.event.S_EVENT_EMERGENCY_LANDING

= 43

world.event.S_EVENT_ENGINE_SHUTDOWN

= 19

world.event.S_EVENT_ENGINE_STARTUP

= 18

world.event.S_EVENT_FLIGHT_TIME

= 40

world.event.S_EVENT_HIT

= 2

world.event.S_EVENT_HUMAN_AIRCRAFT_REPAIR_FINISH

= 60

world.event.S_EVENT_HUMAN_AIRCRAFT_REPAIR_START

= 59

world.event.S_EVENT_HUMAN_FAILURE

= 16

world.event.S_EVENT_INVALID

= 0

world.event.S_EVENT_KILL

= 28

world.event.S_EVENT_LAND

= 4

world.event.S_EVENT_LANDING_AFTER_EJECTION

= 31

world.event.S_EVENT_LANDING_QUALITY_MARK

= 36

world.event.S_EVENT_MAC_EXTRA_SCORE

51 -- not sure what this is

world.event.S_EVENT_MAC_LMS_RESTART

56 -- not sure what this is

world.event.S_EVENT_MARK_ADDED

= 25

world.event.S_EVENT_MARK_CHANGE

= 26

world.event.S_EVENT_MARK_REMOVED

= 27

world.event.S_EVENT_MAX

= 61

world.event.S_EVENT_MISSION_END

= 12

world.event.S_EVENT_MISSION_RESTART

52

world.event.S_EVENT_MISSION_START

= 11

world.event.S_EVENT_MISSION_WINNER

= 53

world.event.S_EVENT_PARATROOPER_LENDING

= 32 -- who's lending whom what? ;)

world.event.S_EVENT_PILOT_DEAD

= 9

world.event.S_EVENT_PLAYER_CAPTURE_AIRFIELD

= 42

world.event.S_EVENT_PLAYER_COMMENT

= 22

world.event.S_EVENT_PLAYER_ENTER_UNIT

= 20

world.event.S_EVENT_PLAYER_LEAVE_UNIT

= 21

world.event.S_EVENT_PLAYER_SELF_KILL_PILOT

= 41

world.event.S_EVENT_REFUELING

= 7

world.event.S_EVENT_REFUELING_STOP

= 14

world.event.S_EVENT_RUNWAY_TAKEOFF

54

world.event.S_EVENT_RUNWAY_TOUCH

55

world.event.S_EVENT_SCORE

= 29

world.event.S_EVENT_SHOOTING_END

= 24

world.event.S_EVENT_SHOOTING_START

= 23

world.event.S_EVENT_SHOT

= 1

world.event.S_EVENT_SIMULATION_FREEZE

= 57

world.event.S_EVENT_SIMULATION_START

= 46

world.event.S_EVENT_SIMULATION_UNFREEZE

= 58

world.event.S_EVENT_TAKEOFF

= 3

world.event.S_EVENT_TOOK_CONTROL

= 13

world.event.S_EVENT_TRIGGER_ZONE

= 35

world.event.S_EVENT_UNIT_CREATE_TASK

= 44

world.event.S_EVENT_UNIT_DELETE_TASK

= 45

world.event.S_EVENT_UNIT_LOST

= 30

world.event.S_EVENT_UNIT_TASK_COMPLETE

= 49

world.event.S_EVENT_UNIT_TASK_STAGE

= 50

world.event.S_EVENT_WEAPON_ADD

= 34

world.event.S_EVENT_WEAPON_DROP

= 48

world.event.S_EVENT_WEAPON_REARM

= 47

Fields and Methods inherited from world.weather Description

world.weather.getFogThickness()

Returns the current fog thickness.

world.weather.getFogVisibilityDistance()

Returns the current fog visibility distance.

world.weather.setFogAnimation(animation)

Sets fog animation keys.

world.weather.setFogThickness(thickness)

Sets the fog thickness instantly.

world.weather.setFogVisibilityDistance(visibility)

Instantly sets the maximum visibility distance of fog at sea level when looking at the horizon.

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

DCS Class Airbase Represents airbases: airdromes, helipads and ships with flying decks or landing pads.

Field(s)

#Airbase.Category Airbase.Category

enum contains identifiers of airbase categories.

#Airbase.Desc Airbase.Desc

Airbase descriptor. Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.

#Airbase.ID Airbase.ID

Identifier of an airbase. It assigned to an airbase by the Mission Editor automatically. This identifier is used in AI tasks to refer an airbase that exists (spawned and not dead) or not.

Function(s)

Enables or disables the airbase and FARP auto capture game mechanic where ownership of a base can change based on the presence of ground forces or the default setting assigned in the editor.

Defined in:

Airbase

Parameter:

#boolean setting

true : enables autoCapture behavior, false : disables autoCapture behavior

Returns the current autoCapture setting for the passed base.

Defined in:

Airbase

Return value:

#boolean:

true if autoCapture behavior is enabled and false otherwise.

Returns airbase by its name.

If no airbase found the function will return nil.

Defined in:

Airbase

Parameter:

#string name

Return value:

Returns the airbase's callsign - the localized string.

Defined in:

Airbase

Return value:

#string:

Returns descriptor of the airbase.

Defined in:

Airbase

Return value:

Returns airbase descriptor by type name.

If no descriptor is found the function will return nil.

Defined in:

Airbase

Parameter:

#TypeName typeName

Airbase type name.

Return value:

Returns identifier of the airbase.

Defined in:

Airbase

Return value:

Returns the wsType of every object that exists in DCS.

A wsType is a table consisting of 4 entries indexed numerically. It can be used to broadly categorize object types. The table can be broken down as: {mainCategory, subCat1, subCat2, index}

Defined in:

Airbase

Return value:

#table:

wsType of every object that exists in DCS.

Returns Unit that is corresponded to the airbase.

Works only for ships.

Defined in:

Airbase

Return value:

Returns the warehouse object associated with the airbase object.

Can then be used to call the warehouse class functions to modify the contents of the warehouse.

Defined in:

Airbase

Return value:

The DCS warehouse object of this airbase.

Changes the passed airbase object's coalition to the set value.

Must be used with Airbase.autoCapture to disable auto capturing of the base, otherwise the base can revert back to a different coalition depending on the situation and built in game capture rules.

Defined in:

Airbase

Parameter:

#number coa

The new owner coalition: 0=neutra, 1=red, 2=blue.

Enum contains identifiers of airbase categories.

Field(s)

Function(s)

Airbase descriptor.

Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.

Field(s)

#Airbase.Category Airbase.Desc.category

Category of the airbase type.

Function(s)

3-dimensional box.

Field(s)

Function(s)

DCS Class CoalitionObject

Field(s)

Function(s)

Returns coalition of the object.

Defined in:

CoalitionObject

Return value:

Returns object country.

Defined in:

CoalitionObject

Return value:

Controller is an object that performs A.I.-tasks.

Other words controller is an instance of A.I.. Controller stores current main task, active enroute tasks and behavior options. Controller performs commands. Please, read DCS A-10C GUI Manual EN.pdf chapter "Task Planning for Unit Groups", page 91 to understand A.I. system of DCS:A-10C.

This class has 2 types of functions:

  • Tasks
  • Commands: Commands are instant actions those required zero time to perform. Commands may be used both for control unit/group behavior and control game mechanics.

Field(s)

#Controller.Detection Controller.Detection

Enum contains identifiers of surface types.

Function(s)

Returns list of detected targets.

If one or more detection method is specified the function will return targets which were detected by at least one of these methods. If no detection methods are specified the function will return targets which were detected by any method.

Defined in:

Controller

Parameter:

Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN

Return value:

#list<#DetectedTarget>:

array of DetectedTarget

Returns true if the controller has a task.

Defined in:

Controller

Return value:

#boolean:

Checks if the target is detected or not.

If one or more detection method is specified the function will return true if the target is detected by at least one of these methods. If no detection methods are specified the function will return true if the target is detected by any method.

Defined in:

Controller

Parameters:

Target to check

Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN

Return values:

#boolean:

detected True if the target is detected.

#boolean:

visible Has effect only if detected is true. True if the target is visible now.

#boolean:

type Has effect only if detected is true. True if the target type is known.

#boolean:

distance Has effect only if detected is true. True if the distance to the target is known.

lastTime Has effect only if visible is false. Last time when target was seen.

lastPos Has effect only if visible is false. Last position of the target when it was seen.

lastVel Has effect only if visible is false. Last velocity of the target when it was seen.

Know a target.

Defined in:

Controller

Parameters:

The target.

#boolean type

Target type is known.

#boolean distance

Distance to target is known.

Pops current (front) task from the queue and makes active next task in the queue (if exists).

If no more tasks in the queue the function works like function Controller.resetTask() function. Does nothing if the queue is empty.

Defined in:

Controller

Pushes the task to the front of the queue and makes the task active.

Further call of function Controller.setTask() function will stop current task, clear the queue and set the new task active. If the task queue is empty the function will work like function Controller.setTask() function.

Defined in:

Controller

Parameter:

#Task task

Resets current task of the controller.

Defined in:

Controller

Enables and disables the controller.

Note: Now it works only for ground / naval groups!

Defined in:

Controller

Parameter:

#boolean value

Enable / Disable.

Sets the option to the controller.

Option is a pair of identifier and value. Behavior options are global parameters those affect controller behavior in all tasks it performs. Option identifiers and values are stored in table AI.Option in subtables Air, Ground and Naval.

OptionId = AI.Option.Air.id or AI.Option.Ground.id or AI.Option.Naval.id OptionValue = AI.Option.Air.val[optionName] or AI.Option.Ground.val[optionName] or AI.Option.Naval.val[optionName]

Defined in:

Controller

Parameters:

#OptionId optionId

Option identifier.

#OptionValue optionValue

Value of the option.

Resets current task and then sets the task to the controller.

Task is a table that contains task identifier and task parameters.

Defined in:

Controller

Parameter:

#Task task

Detected target.

Field(s)

#boolean Controller.DetectedTarget.distance

Distance to the target is known

#boolean Controller.DetectedTarget.type

The target type is known

#boolean Controller.DetectedTarget.visible

The target is visible

Function(s)

Enum containing detection types.

Field(s)

#number Controller.Detection.DLINK

Data link detection. Numeric value 32.

#number Controller.Detection.IRST

Infra-red search and track detection. Numeric value 8.

#number Controller.Detection.OPTIC

Optical detection. Numeric value 2.

#number Controller.Detection.RADAR

Radar detection. Numeric value 4.

#number Controller.Detection.RWR

Radar Warning Receiver detection. Numeric value 16.

#number Controller.Detection.VISUAL

Visual detection. Numeric value 1.

Function(s)

Descriptors.

Field(s)

#number Desc.Hmax

Max height in meters.

#number Desc.Kab

?

#number Desc.Kmax

?

#number Desc.NyMax

?

#number Desc.NyMin

?

#number Desc.RCS

?

#number Desc.VyMax

Max vertical velocity in m/s.

#table Desc.attributes

Table of attributes.

#table Desc.box

Bounding box.

#number Desc.category

Unit category.

#string Desc.displayName

Localized display name.

#number Desc.fuelMassMax

Max fuel mass in kg.

#number Desc.life

Life points.

#number Desc.massEmpty

Empty mass in kg.

#number Desc.massMax

Max mass of unit.

#number Desc.range

Range in km(?).

#number Desc.speedMax0

Max speed in meters/second at zero altitude.

#number Desc.speedMax10K

Max speed in meters/second.

#number Desc.tankerType

Type of refueling system: 0=boom, 1=probe.

Function(s)

Event structure.

Note that present fields depend on type of event.

Field(s)

#number Event.coalition

Coalition ID.

#string Event.comment

Comment, e.g. LSO score.

#number Event.groupID

Group ID, e.g. of group that added mark point.

#number Event.id

Event ID.

#number Event.idx

Mark ID.

DCS#Unit Event.initiator

Unit initiating the event.

DCS#Vec3 Event.pos

Position vector, e.g. of mark point.

DCS#Unit Event.target

Target unit.

#string Event.text

Text, e.g. of mark point.

#number Event.time

Mission time in seconds.

#string Event.weapon_name

Weapoin name.

Function(s)

Represents group of Units.

Field(s)

#Group.Category Group.Category

Enum contains identifiers of group types.

#ID Group.ID

Identifier of a group. It is assigned to a group by Mission Editor automatically.

Function(s)

Destroys the group and all of its units.

Defined in:

Group

GROUND - Switch on/off radar emissions

Defined in:

Group

Parameter:

#boolean switch

Returns group by the name assigned to the group in Mission Editor.

Defined in:

Group

Parameter:

#string name

Return value:

Returns category of the group.

Defined in:

Group

Return value:

Returns the coalition of the group.

Defined in:

Group

Return value:

Returns controller of the group.

Defined in:

Group

Return value:

Returns the group identifier.

Defined in:

Group

Return value:

#ID:

Returns initial size of the group.

If some of the units will be destroyed, initial size of the group will not be changed; Initial size limits the unitNumber parameter for Group.getUnit() function.

Defined in:

Group

Return value:

#number:

Returns the group's name.

This is the same name assigned to the group in Mission Editor.

Defined in:

Group

Return value:

#string:

Returns current size of the group.

If some of the units will be destroyed, As units are destroyed the size of the group will be changed.

Defined in:

Group

Return value:

#number:

Returns the unit with number unitNumber.

If the unit is not exists the function will return nil.

Defined in:

Group

Parameter:

#number unitNumber

Return value:

Returns array of the units present in the group now.

Destroyed units will not be enlisted at all.

Defined in:

Group

Return value:

#list<#Unit>:

array of Units

returns true if the group exist or false otherwise.

Defined in:

Group

Return value:

#boolean:

Enum contains identifiers of group types.

Field(s)

Function(s)

DCS Class Object

Field(s)

Function(s)

Defined in:

Object

Defined in:

Object

Return value:

Returns object descriptor.

Defined in:

Object

Return value:

Returns name of the object.

This is the name that is assigned to the object in the Mission Editor.

Defined in:

Object

Return value:

#string:

Returns object coordinates for current time.

Defined in:

Object

Return value:

3D position vector with x,y,z components.

Returns object position for current time.

Defined in:

Object

Return value:

Returns type name of the Object.

Defined in:

Object

Return value:

#string:

Returns the unit's velocity vector.

Defined in:

Object

Return value:

3D velocity vector.

Returns true if the object belongs to the category.

Defined in:

Object

Parameter:

#AttributeName attributeName

Attribute name to check.

Return value:

#boolean:

Returns true if the unit is in air.

Defined in:

Object

Return value:

#boolean:

Defined in:

Object

Return value:

#boolean:

Defined in:

Object

Return value:

#boolean:

DCS Enum Object.Category

Field(s)

Function(s)

Position is a composite structure.

It consists of both coordinate vector and orientation matrix. Position3 (also known as "Pos3" for short) is a table that has following format:

Field(s)

#Vec3 Position3.p

3D position vector.

#Vec3 Position3.x

Orientation component of vector pointing East.

#Vec3 Position3.y

Orientation component of vector pointing up.

#Vec3 Position3.z

Orientation component of vector pointing North.

Function(s)

DCS Class Spot Represents a spot from laser or IR-pointer.

Field(s)

#Spot.Category Spot.Category

enum that stores spot categories.

Function(s)

Creates an infrared ray emanating from the given object to a point in 3d space.

Can be seen with night vision goggles.

Defined in:

Spot

Parameters:

DCS#Object Source

Source position of the IR ray.

DCS#Vec3 LocalRef

An optional 3D offset for the source.

DCS#Vec3 Vec3

Target coordinate where the ray is pointing at.

Return value:

Creates a laser ray emanating from the given object to a point in 3d space.

Defined in:

Spot

Parameters:

DCS#Object Source

The source object of the laser.

DCS#Vec3 LocalRef

An optional 3D offset for the source.

DCS#Vec3 Vec3

Target coordinate where the ray is pointing at.

#number LaserCode

Any 4 digit number between 1111 and 1788.

Return value:

Destroys the spot.

Defined in:

Spot

Gets the category of the spot (laser or IR).

Defined in:

Spot

Return value:

#string:

Category.

Returns the number that is used to define the laser code for which laser designation can track.

Defined in:

Spot

Return value:

#number:

Code The laser code used.

Returns a vec3 table of the x, y, and z coordinates for the position of the given object in 3D space.

Coordinates are dependent on the position of the maps origin.

Defined in:

Spot

Return value:

Point in 3D, where the beam is pointing at.

Sets the number that is used to define the laser code for which laser designation can track.

Defined in:

Spot

Parameter:

#number Code

The laser code. Default value is 1688.

Sets the destination point from which the source of the spot is drawn toward.

Defined in:

Spot

Parameter:

DCS#Vec3 Vec3

Point in 3D, where the beam is pointing at.

Enum that stores spot categories.

Field(s)

Function(s)

Represents a static object.

Field(s)

Function(s)

Returns the static object.

Defined in:

StaticObject

Parameter:

#string name

Name of the static object.

Return value:

Field(s)

Function(s)

Returns object descriptor.

Defined in:

Return value:

Returns name of the object.

This is the name that is assigned to the object in the Mission Editor.

Defined in:

Return value:

#string:

Returns object coordinates for current time.

Defined in:

Return value:

3D position vector with x,y,z components.

Returns object position for current time.

Defined in:

Return value:

Returns type name of the Object.

Defined in:

Return value:

#string:

Returns the unit's velocity vector.

Defined in:

Return value:

3D velocity vector.

Returns true if the object belongs to the category.

Defined in:

Parameter:

#AttributeName attributeName

Attribute name to check.

Return value:

#boolean:

Returns true if the unit is in air.

Defined in:

Return value:

#boolean:

Defined in:

Return value:

#boolean:

Defined in:

Return value:

#boolean:

A task descriptor (internal structure for DCS World).

See https://wiki.hoggitworld.com/view/Category:Tasks. In MOOSE, these tasks can be accessed via Wrapper.Controllable#CONTROLLABLE.

Field(s)

#string Task.id

Function(s)

DCS template data structure.

Field(s)

#boolean Template.lateActivation

Group is late activated.

#boolean Template.uncontrolled

Aircraft is uncontrolled.

#table Template.units

Unit list.

#number Template.x

2D Position on x-axis in meters.

#number Template.y

2D Position on y-axis in meters.

Function(s)

Unit data structure.

Field(s)

#string Template.Unit.name

Name of the unit.

#number Template.Unit.x
#number Template.Unit.y

Function(s)

Unit.

Field(s)

#list<#Unit.AmmoItem> Unit.Ammo

Function(s)

GROUND - Switch on/off radar emissions

Defined in:

Unit

Parameter:

#boolean switch

Returns the unit ammunition.

Defined in:

Unit

Return value:

Returns unit object by the name assigned to the unit in Mission Editor.

If there is unit with such name or the unit is destroyed the function will return nil. The function provides access to non-activated units too.

Defined in:

Unit

Parameter:

#string name

Return value:

Returns the unit's callsign - the localized string.

Defined in:

Unit

Return value:

#string:

Returns controller of the unit if it exist and nil otherwise

Defined in:

Unit

Return value:

Returns unit descriptor.

Descriptor type depends on unit category.

Defined in:

Unit

Return value:

Returns the number of infantry that can be embark onto the aircraft.

Only returns a value if run on airplanes or helicopters. Returns nil if run on ground or ship units.

Defined in:

Unit

Return value:

#number:

Number of soldiers that embark.

Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks.

If there are additional fuel tanks the value may be greater than 1.0.

Defined in:

Unit

Return value:

#number:

Returns the unit's group if it exist and nil otherwise

Defined in:

Unit

Return value:

returns the unit's unique identifier.

Defined in:

Unit

Return value:

Returns the unit's health.

Dead units has health <= 1.0

Defined in:

Unit

Return value:

#number:

returns the unit's initial health.

Defined in:

Unit

Return value:

#number:

Returns the unit's number in the group.

The number is the same number the unit has in ME. It may not be changed during the mission. If any unit in the group is destroyed, the numbers of another units will not be changed.

Defined in:

Unit

Return value:

#number:

Returns name of the player that control the unit or nil if the unit is controlled by A.I.

Defined in:

Unit

Return value:

#string:

returns two values: First value indicates if at least one of the unit's radar(s) is on.

Second value is the object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.

Defined in:

Unit

Return value:

Returns the unit sensors.

Defined in:

Unit

Return value:

Returns true if the unit has specified types of sensors.

This function is more preferable than Unit.getSensors() if you don't want to get information about all the unit's sensors, and just want to check if the unit has specified types of sensors.

Defined in:

Unit

Parameters:

#Unit.SensorType sensorType

(= nil) Sensor type.

...

Additional parameters.

Return value:

#boolean:

Usage:

If sensorType is Unit.SensorType.OPTIC, additional parameters are optic sensor types. Following example checks if the unit has LLTV or IR optics:
unit:hasSensors(Unit.SensorType.OPTIC, Unit.OpticType.LLTV, Unit.OpticType.IR)
If sensorType is Unit.SensorType.RADAR, additional parameters are radar types. Following example checks if the unit has air search radars:
unit:hasSensors(Unit.SensorType.RADAR, Unit.RadarType.AS)
If no additional parameters are specified the function returns true if the unit has at least one sensor of specified type.
If sensor type is not specified the function returns true if the unit has at least one sensor of any type.

Returns if the unit is activated.

Defined in:

Unit

Return value:

#boolean:

ammunition item: "type-count" pair.

Field(s)

#number Unit.AmmoItem.count

ammunition count

#Weapon.Desc Unit.AmmoItem.desc

ammunition descriptor

Function(s)

Enum that stores unit categories.

Field(s)

Function(s)

A unit descriptor.

Field(s)

#Mass Unit.Desc.massEmpty

mass of empty unit

#number Unit.Desc.speedMax

istance / Time, --maximal velocity

Function(s)

An aircraft descriptor.

Field(s)

#number Unit.DescAircraft.NyMax

maximal safe acceleration

#number Unit.DescAircraft.NyMin

minimal safe acceleration

#number Unit.DescAircraft.VyMax

#Distance / #Time, --maximal climb rate

#Mass Unit.DescAircraft.fuelMassMax

maximal inner fuel mass

Function(s)

An airplane descriptor.

Field(s)

#number Unit.DescAirplane.speedMax0

Distance / Time maximal TAS at ground level

#number Unit.DescAirplane.speedMax10K

Distance / Time maximal TAS at altitude of 10 km

Function(s)

A helicopter descriptor.

Field(s)

Function(s)

A vehicle descriptor.

Field(s)

#boolean Unit.DescVehicle.riverCrossing

can the vehicle cross a rivers

Function(s)

An IRST.

Field(s)

#Distance Unit.IRST.detectionDistanceAfterburner

..., engines are in afterburner mode

#Distance Unit.IRST.detectionDistanceIdle

detection of tail-on target with heat signature = 1 in upper hemisphere, engines are in idle

#Distance Unit.IRST.detectionDistanceMaximal

..., engines are in maximal mode

Function(s)

An optic sensor.

Field(s)

Function(s)

Enum that stores types of optic sensors.

Field(s)

Function(s)

A radar.

Field(s)

#Unit.Radar.detectionDistanceAir Unit.Radar.detectionDistanceAir

detection distance for RCS=1m^2 airborne target, nil if radar doesn't support air search

#Distance Unit.Radar.detectionDistanceHRM

detection distance for RCS=1m^2 in high-resolution mapping mode, nil if radar has no HRM

#Distance Unit.Radar.detectionDistanceRBM

detection distance for RCS=1m^2 in real-beam mapping mode, nil if radar doesn't support surface/land search

Function(s)

Enum that stores radar types.

Field(s)

Function(s)

Enum that stores aircraft refueling system types.

Field(s)

Function(s)

A unit sensor.

Field(s)

Function(s)

Enum that stores sensor types.

Field(s)

Function(s)

Vec2 is a 2D-vector for the ground plane as a reference plane.

Field(s)

#Distance Vec2.x

Vec2.x = Vec3.x

#Distance Vec2.y

Vec2.y = Vec3.z

Function(s)

Vec3 type is a 3D-vector.

DCS world has 3-dimensional coordinate system. DCS ground is an infinite plain.

Field(s)

#Distance Vec3.x

is directed to the North

#Distance Vec3.y

is directed up

#Distance Vec3.z

is directed to the East

Function(s)

DCS Class Warehouse The warehouse class gives control over warehouses that exist in airbase objects.

These warehouses can limit the aircraft, munitions, and fuel available to coalition aircraft.

Field(s)

Function(s)

Adds the passed amount of a given item to the warehouse.

itemName is the typeName associated with the item: "weapons.missiles.AIM_54C_Mk47" A wsType table can also be used, however the last digit with wsTypes has been known to change. {4, 4, 7, 322}

Defined in:

Warehouse

Parameters:

#string itemName

Name of the item.

#number count

Number of items to add.

Adds the passed amount of a liquid fuel into the warehouse inventory.

Defined in:

Warehouse

Parameters:

#number liquidType

Type of liquid to add: 0=jetfuel, 1=aviation gasoline, 2=MW50, 3=Diesel.

#number count

Amount of liquid to add.

Get a warehouse by passing its name.

Defined in:

Warehouse

Parameter:

#string Name

Name of the warehouse.

Return value:

The warehouse object.

Returns a full itemized list of everything currently in a warehouse.

If a category is set to unlimited then the table will be returned empty. Aircraft and weapons are indexed by strings. Liquids are indexed by number.

Defined in:

Warehouse

Parameter:

#string itemName

Name of the item.

Return value:

#table:

Itemized list of everything currently in a warehouse

Returns the number of the passed type of item currently in a warehouse object.

Defined in:

Warehouse

Parameter:

#string itemName

Name of the item.

Returns the amount of the passed liquid type within a given warehouse.

Defined in:

Warehouse

Parameter:

#number liquidType

Type of liquid to add: 0=jetfuel, 1=aviation gasoline, 2=MW50, 3=Diesel.

Return value:

#number:

Amount of liquid.

Returns the airbase object associated with the warehouse object.

Defined in:

Warehouse

Return value:

The airbase object owning this warehouse.

Removes the amount of the passed item from the warehouse.

Defined in:

Warehouse

Parameters:

#string itemName

Name of the item.

#number count

Number of items to be removed.

Sets the passed amount of a given item to the warehouse.

Defined in:

Warehouse

Parameters:

#string itemName

Name of the item.

#number count

Number of items to add.

Removes the set amount of liquid from the inventory in a warehouse.

Defined in:

Warehouse

Parameters:

#number liquidType

Type of liquid to add: 0=jetfuel, 1=aviation gasoline, 2=MW50, 3=Diesel.

#number count

Amount of liquid.

Field(s)

Function(s)

DCS Class Weapon

Field(s)

#Weapon.Category Weapon.Category

enum that stores weapon categories.

#Weapon.Desc Weapon.Desc

The descriptor of a weapon.

#Weapon.GuidanceType Weapon.GuidanceType

enum that stores guidance methods. Available only for guided weapon (Weapon.Category.MISSILE and some Weapon.Category.BOMB).

#Weapon.MissileCategory Weapon.MissileCategory

enum that stores missile category. Available only for missiles (Weapon.Category.MISSILE).

#Weapon.WarheadType Weapon.WarheadType

enum that stores warhead types.

#Weapon.flag Weapon.flag

enum stores weapon flags. Some of them are combination of another flags.

Function(s)

returns weapon descriptor.

Descriptor type depends on weapon category.

Defined in:

Weapon

Return value:

Returns the unit that launched the weapon.

Defined in:

Weapon

Return value:

returns target of the guided weapon.

Unguided weapons and guided weapon that is targeted at the point on the ground will return nil.

Defined in:

Weapon

Return value:

Weapon.Category enum that stores weapon categories.

Field(s)

#number Weapon.Category.BOMB

Bomb.

#number Weapon.Category.MISSILE

Missile

#number Weapon.Category.ROCKET

Rocket.

#number Weapon.Category.SHELL

Shell.

#number Weapon.Category.TORPEDO

Torpedo.

Function(s)

Weapon.GuidanceType enum that stores guidance methods.

Available only for guided weapon (Weapon.Category.MISSILE and some Weapon.Category.BOMB).

Field(s)

Function(s)

Weapon.MissileCategory enum that stores missile category.

Available only for missiles (Weapon.Category.MISSILE).

Field(s)

Function(s)

Weapon.WarheadType enum that stores warhead types.

Field(s)

Function(s)

enum stores weapon flags.

Some of them are combination of another flags.

Field(s)

Function(s)

DCS Enum coalition

Field(s)

Function(s)

Dynamically spawns a group.

See hoggit

Defined in:

coalition

Parameters:

#number countryId

Id of the country.

#number groupCategory

Group category. Set -1 for spawning FARPS.

#table groupData

Group data table.

Return value:

The spawned Group object.

Dynamically spawns a static object.

See hoggit

Defined in:

coalition

Parameters:

#number countryId

Id of the country.

#table groupData

Group data table.

Return value:

The spawned static object.

Get country coalition.

Defined in:

coalition

Parameter:

#number countryId

Country ID.

Return value:

#number:

coalitionId Coalition ID.

DCS Enum coalition.side

Field(s)

Function(s)

DCS Enum country

Field(s)

Function(s)

DCS enumerator country

Field(s)

Function(s)

DCS Singleton env

Field(s)

Function(s)

Add message to simulator log with caption "ERROR".

Message box is optional.

Defined in:

env

Parameters:

#string message

message string to add to log.

#boolean showMessageBox

If the parameter is true Message Box will appear. Optional.

Add message to simulator log with caption "INFO".

Message box is optional.

Defined in:

env

Parameters:

#string message

message string to add to log.

#boolean showMessageBox

If the parameter is true Message Box will appear. Optional.

Enables/disables appearance of message box each time lua error occurs.

Defined in:

env

Parameter:

#boolean on

if true message box appearance is enabled.

Add message to simulator log with caption "WARNING".

Message box is optional.

Defined in:

env

Parameters:

#string message

message string to add to log.

#boolean showMessageBox

If the parameter is true Message Box will appear. Optional.

DCS Singleton land

Field(s)

Function(s)

Returns the distance from sea level (y-axis) of a given vec2 point.

Defined in:

land

Parameter:

#Vec2 point

Point on the ground.

Return value:

#number:

Height in meters.

Returns the surface height and depth of a point.

Useful for checking if the path is deep enough to support a given ship. Both values are positive. When checked over water at sea level the first value is always zero. When checked over water at altitude, for example the reservoir of the Inguri Dam, the first value is the corresponding altitude the water level is at.

Defined in:

land

Parameter:

#Vec2 point

Position where to check.

Return values:

#number:

Height in meters.

#number:

Depth in meters.

Returns surface type at the given point.

Defined in:

land

Parameter:

#Vec2 point

Point on the land.

Return value:

#number:

Enumerator value from land.SurfaceType (LAND=1, SHALLOW_WATER=2, WATER=3, ROAD=4, RUNWAY=5)

Type of surface enumerator

Field(s)

Function(s)

Field(s)

Function(s)

Field(s)

Function(s)

DCS Singleton timer

Field(s)

Function(s)

Returns mission time in seconds.

Defined in:

timer

Return value:

Returns model time in seconds.

Defined in:

timer

Return value:

Returns mission start time in seconds.

Defined in:

timer

Return value:

Removes the function from schedule.

Defined in:

timer

Parameter:

functionId

Function identifier to remove from schedule

Schedules function to call at desired model time.

Time function FunctionToCall(any argument, Time time)

...

return ...

end

Must return model time of next call or nil. Note that the DCS scheduler calls the function in protected mode and any Lua errors in the called function will be trapped and not reported. If the function triggers a Lua error then it will be terminated and not scheduled to run again.

Defined in:

timer

Parameters:

#FunctionToCall functionToCall

Lua-function to call. Must have prototype of FunctionToCall.

functionArgument

Function argument of any type to pass to functionToCall.

#Time time

Model time of the function call.

Return value:

functionId

Re-schedules function to call at another model time.

Defined in:

timer

Parameters:

functionId

Lua-function to call. Must have prototype of FunctionToCall.

#Time time

Model time of the function call.

DCS Enum world

Field(s)

#world.BirthPlace world.BirthPlace

The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.

#world.VolumeType world.VolumeType

The volumeType enumerator defines the types of 3d geometery used within the world.searchObjects function.

#world.weather world.weather

Weather functions for fog etc.

Function(s)

Adds a function as an event handler that executes whenever a simulator event occurs.

See hoggit.

Defined in:

world

Parameter:

#table handler

Event handler table.

Returns a table of DCS airbase objects.

Defined in:

world

Parameter:

#number coalitionId

The coalition side number ID. Default is all airbases are returned.

Return value:

#table:

Table of DCS airbase objects.

Returns a table of mark panels indexed numerically that are present within the mission.

See hoggit

Defined in:

world

Return value:

#table:

Table of marks.

Returns a table of the single unit object in the game who's skill level is set as "Player".

See hoggit. There is only a single player unit in a mission and in single player the user will always spawn into this unit automatically unless other client or Combined Arms slots are available.

Defined in:

world

Return value:

Removes the specified event handler from handling events.

Defined in:

world

Parameter:

#table handler

Event handler table.

Searches a defined volume of 3d space for the specified objects within it and then can run function on each returned object.

See hoggit.

Defined in:

world

Parameters:

DCS#Object.Category objectcategory

Category (can be a table) of objects to search.

Shape of the search area/volume.

ObjectSeachHandler

handler A function that handles the search.

#table any

Additional data.

Return value:

The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.

Field(s)

Function(s)

Fog animation data structure.

Field(s)

Function(s)

The volumeType enumerator defines the types of 3d geometery used within the #world.searchObjects function.

Field(s)

Function(s)

Weather functions.

Field(s)

Function(s)

Returns the current fog thickness.

Defined in:

world.weather

Return value:

#number:

Fog thickness in meters. If there is no fog, zero is returned.

Returns the current fog visibility distance.

Defined in:

world.weather

Sets fog animation keys.

Time is set in seconds and relative to the current simulation time, where time=0 is the current moment. Time must be increasing. Previous animation is always discarded despite the data being correct.

Defined in:

world.weather

Parameter:

List of fog animations

Sets the fog thickness instantly.

Any current fog animation is discarded.

Defined in:

world.weather

Parameter:

#number thickness

Fog thickness in meters. Set to zero to disable fog.

Instantly sets the maximum visibility distance of fog at sea level when looking at the horizon.

Any current fog animation is discarded. Set zero to disable the fog.

Defined in:

world.weather

Parameter:

#number visibility

Max fog visibility in meters. Set to zero to disable fog.