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 |
Global coalition |
Global country |
Global env |
Global land |
Global radio |
Global timer |
Global world |
The world singleton contains functions centered around two different but extremely useful functions. |
Type(s)
Fields and Methods inherited from AI.Option | Description |
---|---|
Fields and Methods inherited from AI.Option.Air | Description |
---|---|
Fields and Methods inherited from AI.Option.Air.id | Description |
---|---|
Fields and Methods inherited from AI.Option.Air.val | Description |
---|---|
Fields and Methods inherited from AI.Option.Air.val.ECM_USING | Description |
---|---|
Fields and Methods inherited from AI.Option.Air.val.FLARE_USING | Description |
---|---|
Fields and Methods inherited from AI.Option.Air.val.MISSILE_ATTACK | Description |
---|---|
Fields and Methods inherited from AI.Option.Air.val.RADAR_USING | Description |
---|---|
Fields and Methods inherited from AI.Option.Air.val.REACTION_ON_THREAT | Description |
---|---|
Fields and Methods inherited from AI.Option.Air.val.ROE | Description |
---|---|
Fields and Methods inherited from AI.Option.Ground | Description |
---|---|
Fields and Methods inherited from AI.Option.Ground.id | Description |
---|---|
true or false |
|
Fields and Methods inherited from AI.Option.Ground.mid | Description |
---|---|
|
|
|
|
Fields and Methods inherited from AI.Option.Ground.mval | Description |
---|---|
Fields and Methods inherited from AI.Option.Ground.mval.ENGAGE_TARGETS | Description |
---|---|
-- 1 |
|
-- 0 |
|
-- 2 |
Fields and Methods inherited from AI.Option.Ground.val | Description |
---|---|
Fields and Methods inherited from AI.Option.Ground.val.ALARM_STATE | Description |
---|---|
Fields and Methods inherited from AI.Option.Ground.val.ROE | Description |
---|---|
Fields and Methods inherited from AI.Option.Naval.id | Description |
---|---|
Fields and Methods inherited from AI.Option.Naval.val | Description |
---|---|
Fields and Methods inherited from AI.Option.Naval.val.ROE | Description |
---|---|
Fields and Methods inherited from AI.Skill | Description |
---|---|
Fields and Methods inherited from AI.Task | Description |
---|---|
Fields and Methods inherited from AI.Task.AltitudeType | Description |
---|---|
Fields and Methods inherited from AI.Task.Designation | Description |
---|---|
Fields and Methods inherited from AI.Task.OrbitPattern | Description |
---|---|
Fields and Methods inherited from AI.Task.TurnMethod | Description |
---|---|
Fields and Methods inherited from AI.Task.VehicleFormation | Description |
---|---|
Fields and Methods inherited from AI.Task.WaypointType | Description |
---|---|
Fields and Methods inherited from AI.Task.WeaponExpend | Description |
---|---|
Fields and Methods inherited from Airbase | Description |
---|---|
enum contains identifiers of airbase categories. |
|
Airbase descriptor. Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type. |
|
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. |
|
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. |
|
Returns the current autoCapture setting for the passed base. |
|
Returns airbase by its name. |
|
Returns the airbase's callsign - the localized string. |
|
Returns descriptor of the airbase. |
|
Returns airbase descriptor by type name. |
|
Returns identifier of the airbase. |
|
Returns the wsType of every object that exists in DCS. |
|
Returns Unit that is corresponded to the airbase. |
|
Returns the warehouse object associated with the airbase object. |
|
Changes the passed airbase object's coalition to the set value. |
Fields and Methods inherited from Airbase.Category | Description |
---|---|
Fields and Methods inherited from Airbase.Desc | Description |
---|---|
Category of the airbase type. |
Fields and Methods inherited from CoalitionObject | Description |
---|---|
Returns coalition of the object. |
|
Returns object country. |
Fields and Methods inherited from Controller | Description |
---|---|
Returns list of detected targets. |
|
Returns true if the controller has a task. |
|
Checks if the target is detected or not. |
|
Know a target. |
|
Pops current (front) task from the queue and makes active next task in the queue (if exists). |
|
Pushes the task to the front of the queue and makes the task active. |
|
Resets current task of the controller. |
|
Enables and disables the controller. |
|
Sets the option to the controller. |
|
Resets current task and then sets the task to the controller. |
Fields and Methods inherited from Controller.Detection | Description |
---|---|
Fields and Methods inherited from DetectedTarget | Description |
---|---|
Distance to the target is known |
|
The target |
|
The target type is known |
|
The target is visible |
Fields and Methods inherited from Event | Description |
---|---|
Coalition ID. |
|
Comment, e.g. LSO score. |
|
Group ID, e.g. of group that added mark point. |
|
Event ID. |
|
Mark ID. |
|
Unit initiating the event. |
|
subPlace Subplace. Unknown and often just 0. |
|
Airbase. |
|
Position vector, e.g. of mark point. |
|
Target unit. |
|
Text, e.g. of mark point. |
|
Mission time in seconds. |
|
Weapoin name. |
Fields and Methods inherited from Group | Description |
---|---|
Enum contains identifiers of group types. |
|
Identifier of a group. It is assigned to a group by Mission Editor automatically. |
|
Destroys the group and all of its units. |
|
GROUND - Switch on/off radar emissions |
|
Returns group by the name assigned to the group in Mission Editor. |
|
Returns category of the group. |
|
Returns the coalition of the group. |
|
Returns controller of the group. |
|
Returns the group identifier. |
|
Returns initial size of the group. |
|
Returns the group's name. |
|
Returns current size of the group. |
|
Returns the unit with number unitNumber. |
|
Returns array of the units present in the group now. |
|
returns true if the group exist or false otherwise. |
Fields and Methods inherited from Group.Category | Description |
---|---|
Fields and Methods inherited from Object | Description |
---|---|
Returns object descriptor. |
|
Returns name of the object. |
|
Returns object coordinates for current time. |
|
Returns object position for current time. |
|
Returns type name of the Object. |
|
Returns the unit's velocity vector. |
|
Returns true if the object belongs to the category. |
|
Returns true if the unit is in air. |
|
Fields and Methods inherited from Object.Category | Description |
---|---|
Fields and Methods inherited from Position3 | Description |
---|---|
3D position vector. |
|
Orientation component of vector pointing East. |
|
Orientation component of vector pointing up. |
|
Orientation component of vector pointing North. |
Fields and Methods inherited from Spot | Description |
---|---|
enum that stores spot categories. |
|
Creates an infrared ray emanating from the given object to a point in 3d space. |
|
Creates a laser ray emanating from the given object to a point in 3d space. |
|
Destroys the spot. |
|
Gets the category of the spot (laser or IR). |
|
Returns the number that is used to define the laser code for which laser designation can track. |
|
Returns a vec3 table of the x, y, and z coordinates for the position of the given object in 3D space. |
|
Sets the number that is used to define the laser code for which laser designation can track. |
|
Sets the destination point from which the source of the spot is drawn toward. |
Fields and Methods inherited from Spot.Category | Description |
---|---|
Fields and Methods inherited from StaticObject | Description |
---|---|
Returns the static object. |
Fields and Methods inherited from Object | Description |
---|---|
Returns object descriptor. |
|
Returns name of the object. |
|
Returns object coordinates for current time. |
|
Returns object position for current time. |
|
Returns type name of the Object. |
|
Returns the unit's velocity vector. |
|
Returns true if the object belongs to the category. |
|
Returns true if the unit is in air. |
|
Fields and Methods inherited from Task | Description |
---|---|
Fields and Methods inherited from Template | Description |
---|---|
Group is late activated. |
|
Aircraft is uncontrolled. |
|
Unit list. |
|
2D Position on x-axis in meters. |
|
2D Position on y-axis in meters. |
Fields and Methods inherited from Template.Unit | Description |
---|---|
Name of the unit. |
|
Fields and Methods inherited from Unit | Description |
---|---|
GROUND - Switch on/off radar emissions |
|
Returns the unit ammunition. |
|
Returns unit object by the name assigned to the unit in Mission Editor. |
|
Returns the unit's callsign - the localized string. |
|
Returns controller of the unit if it exist and nil otherwise |
|
Returns unit descriptor. |
|
Returns the number of infantry that can be embark onto the aircraft. |
|
Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks. |
|
Returns the unit's group if it exist and nil otherwise |
|
returns the unit's unique identifier. |
|
Returns the unit's health. |
|
returns the unit's initial health. |
|
Returns the unit's number in the group. |
|
Returns name of the player that control the unit or nil if the unit is controlled by A.I. |
|
returns two values: First value indicates if at least one of the unit's radar(s) is on. |
|
Returns the unit sensors. |
|
Returns true if the unit has specified types of sensors. |
|
Returns if the unit is activated. |
Fields and Methods inherited from Unit.AmmoItem | Description |
---|---|
ammunition count |
|
ammunition descriptor |
Fields and Methods inherited from Unit.Category | Description |
---|---|
Fields and Methods inherited from Unit.Desc | Description |
---|---|
Unit Category |
|
mass of empty unit |
|
istance / Time, --maximal velocity |
Fields and Methods inherited from Unit.DescAircraft | Description |
---|---|
Ceiling |
|
maximal safe acceleration |
|
minimal safe acceleration |
|
#Distance / #Time, --maximal climb rate |
|
maximal inner fuel mass |
|
Operational range |
|
refueling system type |
Fields and Methods inherited from Unit.DescAirplane | Description |
---|---|
Distance / Time maximal TAS at ground level |
|
Distance / Time maximal TAS at altitude of 10 km |
Fields and Methods inherited from Unit.DescHelicopter | Description |
---|---|
static ceiling |
Fields and Methods inherited from Unit.DescVehicle | Description |
---|---|
maximal slope angle |
|
can the vehicle cross a rivers |
Fields and Methods inherited from Unit.IRST | Description |
---|---|
..., engines are in afterburner mode |
|
detection of tail-on target with heat signature = 1 in upper hemisphere, engines are in idle |
|
..., engines are in maximal mode |
Fields and Methods inherited from Unit.Optic | Description |
---|---|
Fields and Methods inherited from Unit.OpticType | Description |
---|---|
Infra-Red optic sensor |
|
Low-level TV-sensor |
|
TV-sensor |
Fields and Methods inherited from Unit.Radar | Description |
---|---|
detection distance for RCS=1m^2 airborne target, nil if radar doesn't support air search |
|
detection distance for RCS=1m^2 in high-resolution mapping mode, nil if radar has no HRM |
|
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 |
---|---|
Fields and Methods inherited from Unit.Radar.detectionDistanceAir.lowerHemisphere | Description |
---|---|
Fields and Methods inherited from Unit.Radar.detectionDistanceAir.upperHemisphere | Description |
---|---|
Fields and Methods inherited from Unit.RadarType | Description |
---|---|
air search radar |
|
surface/land search radar |
Fields and Methods inherited from Unit.RefuelingSystem | Description |
---|---|
Tanker with a boom. |
|
Tanker with a probe. |
Fields and Methods inherited from Unit.Sensor | Description |
---|---|
Fields and Methods inherited from Unit.SensorType | Description |
---|---|
Fields and Methods inherited from Vec3 | Description |
---|---|
is directed to the North |
|
is directed up |
|
is directed to the East |
Fields and Methods inherited from Warehouse | Description |
---|---|
Adds the passed amount of a given item to the warehouse. |
|
Adds the passed amount of a liquid fuel into the warehouse inventory. |
|
Get a warehouse by passing its name. |
|
Returns a full itemized list of everything currently in a warehouse. |
|
Returns the number of the passed type of item currently in a warehouse object. |
|
Returns the amount of the passed liquid type within a given warehouse. |
|
Returns the airbase object associated with the warehouse object. |
|
Removes the amount of the passed item from the warehouse. |
|
Sets the passed amount of a given item to the warehouse. |
|
Removes the set amount of liquid from the inventory in a warehouse. |
Fields and Methods inherited from WaypointAir | Description |
---|---|
Fields and Methods inherited from Weapon | Description |
---|---|
enum that stores weapon categories. |
|
The descriptor of a weapon. |
|
enum that stores guidance methods. Available only for guided weapon (Weapon.Category.MISSILE and some Weapon.Category.BOMB). |
|
enum that stores missile category. Available only for missiles (Weapon.Category.MISSILE). |
|
enum that stores warhead types. |
|
enum stores weapon flags. Some of them are combination of another flags. |
|
returns weapon descriptor. |
|
Returns the unit that launched the weapon. |
|
returns target of the guided weapon. |
Fields and Methods inherited from Weapon.Category | Description |
---|---|
Bomb. |
|
Missile |
|
Rocket. |
|
Shell. |
|
Torpedo. |
Fields and Methods inherited from Weapon.GuidanceType | Description |
---|---|
Fields and Methods inherited from Weapon.MissileCategory | Description |
---|---|
Fields and Methods inherited from Weapon.WarheadType | Description |
---|---|
Fields and Methods inherited from Weapon.flag | Description |
---|---|
= IR_AAM + SAR_AAM + AR_AAM + SRAAM + MRAAM + LRAAM |
|
= BuiltInCannon + GUN_POD + AnyAAM |
|
= BuiltInCannon + GUN_POD + AnyBomb + AnyRocket + AnyASM |
|
= AntiRadarMissile + AntiShipMissile + AntiTankMissile + FireAndForgetASM + GuidedASM + CruiseMissile |
|
= IR_AAM + AntiRadarMissile + AntiShipMissile + FireAndForgetASM + CruiseMissile |
|
= GuidedBomb + AnyUnguidedBomb |
|
= AnyASM + AnyAAM |
|
= LightRocket + HeavyRocket + MarkerRocket + CandleRocket |
|
= HEBomb + Penetrator + NapalmBomb + FAEBomb + ClusterBomb + Dispencer + CandleBomb + ParachuteBomb |
|
= AnyBomb + AnyRocket + AnyMissile + Cannons |
|
= AnyWeapon - MarkerWeapon |
|
= GUN_POD + BuiltInCannon |
|
= LaserASM + TeleASM |
|
= LGB + TvGB + SNSGB |
|
= GuidedBomb + AnyASM + AnyAAM |
|
= MarkerRocket + CandleRocket + CandleBomb |
|
= GuidedASM + FireAndForgetASM |
|
= Cannons + BuiltInCannon + GUN_POD + AnyUnguidedBomb + AnyRocket |
Fields and Methods inherited from coalition | Description |
---|---|
Dynamically spawns a group. |
|
Dynamically spawns a static object. |
|
Get country coalition. |
|
Fields and Methods inherited from coalition.side | Description |
---|---|
Fields and Methods inherited from country | Description |
---|---|
Fields and Methods inherited from country.id | Description |
---|---|
Fields and Methods inherited from env | Description |
---|---|
Add message to simulator log with caption "ERROR". |
|
Add message to simulator log with caption "INFO". |
|
Enables/disables appearance of message box each time lua error occurs. |
|
Add message to simulator log with caption "WARNING". |
Fields and Methods inherited from land | Description |
---|---|
Returns the distance from sea level (y-axis) of a given vec2 point. |
|
Returns the surface height and depth of a point. |
|
Returns surface type at the given point. |
Fields and Methods inherited from land.SurfaceType | Description |
---|---|
Land=1 |
|
Road=4 |
|
Runway=5 |
|
Shallow water=2 |
|
Water=3 |
Fields and Methods inherited from radio | Description |
---|---|
Fields and Methods inherited from radio.modulation | Description |
---|---|
Fields and Methods inherited from timer | Description |
---|---|
Returns mission time in seconds. |
|
Returns model time in seconds. |
|
Returns mission start time in seconds. |
|
Removes the function from schedule. |
|
timer.scheduleFunction(functionToCall, functionArgument, time) |
Schedules function to call at desired model time. |
Re-schedules function to call at another model time. |
Fields and Methods inherited from world | Description |
---|---|
The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events. |
|
The volumeType enumerator defines the types of 3d geometery used within the world.searchObjects function. |
|
Adds a function as an event handler that executes whenever a simulator event occurs. |
|
Returns a table of DCS airbase objects. |
|
Returns a table of mark panels indexed numerically that are present within the mission. |
|
Returns a table of the single unit object in the game who's skill level is set as "Player". |
|
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. |
Fields and Methods inherited from world.BirthPlace | Description |
---|---|
Fields and Methods inherited from world.VolumeType | Description |
---|---|
Fields and Methods inherited from world.event | Description |
---|---|
= 38 |
|
= 10 |
|
= 37 -- battle damage assessment |
|
= 15 |
|
= 5 |
|
= 39 |
|
= 8 |
|
= 17 |
|
= 33 |
|
= 6 |
|
= 43 |
|
= 19 |
|
= 18 |
|
= 40 |
|
= 2 |
|
= 60 |
|
= 59 |
|
= 16 |
|
= 0 |
|
= 28 |
|
= 4 |
|
= 31 |
|
= 36 |
|
51 -- not sure what this is |
|
56 -- not sure what this is |
|
= 25 |
|
= 26 |
|
= 27 |
|
= 61 |
|
= 12 |
|
52 |
|
= 11 |
|
= 53 |
|
= 32 -- who's lending whom what? ;) |
|
= 9 |
|
= 42 |
|
= 22 |
|
= 20 |
|
= 21 |
|
= 41 |
|
= 7 |
|
= 14 |
|
54 |
|
55 |
|
= 29 |
|
= 24 |
|
= 23 |
|
= 1 |
|
= 57 |
|
= 46 |
|
= 58 |
|
= 3 |
|
= 13 |
|
= 35 |
|
= 44 |
|
= 45 |
|
= 30 |
|
= 49 |
|
= 50 |
|
= 34 |
|
= 48 |
|
= 47 |
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 descriptor. Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.
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.
Returns the airbase's callsign - the localized string.
Defined in:
Airbase
Return value:
#string:
Returns descriptor of the airbase.
Returns airbase descriptor by type name.
If no descriptor is found the function will return nil.
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.
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.
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)
Function(s)
Field(s)
Function(s)
Returns coalition of the object.
Returns object country.
Field(s)
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 detection
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:
Wrapper.Object#Object target
Target to check
#Controller.Detection detection
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.
lastTime Has effect only if visible is false. Last time when target was seen.
#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.
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:
Wrapper.Object#Object object
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.
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.
Enum contains identifiers of surface types.
Field(s)
Function(s)
Detected target.
Field(s)
Distance to the target is known
The target type is known
The target is visible
Function(s)
Event structure.
Note that present fields depend on type of event.
Field(s)
Coalition ID.
Comment, e.g. LSO score.
Group ID, e.g. of group that added mark point.
Event ID.
Mark ID.
Text, e.g. of mark point.
Mission time in seconds.
Weapoin name.
Function(s)
Represents group of Units.
Field(s)
Function(s)
GROUND - Switch on/off radar emissions
Defined in:
Group
Parameter:
#boolean switch
Returns group by the name assigned to the group in Mission Editor.
Returns the coalition of the group.
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.
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)
Field(s)
Function(s)
Defined in:
Object
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.
Returns object position for current time.
Returns the unit's velocity vector.
Returns true if the object belongs to the category.
Defined in:
Object
Parameter:
#AttributeName attributeName
Attribute name to check.
Return value:
#boolean:
Defined in:
Object
Return value:
#boolean:
Defined in:
Object
Return value:
#boolean:
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)
Function(s)
DCS Class Spot Represents a spot from laser or IR-pointer.
Field(s)
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:
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.
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.
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)
Defined in:
Returns object descriptor.
Returns name of the object.
This is the name that is assigned to the object in the Mission Editor.
Returns object coordinates for current time.
Returns object position for current time.
Returns type name of the Object.
Returns the unit's 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.
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)
Function(s)
DCS template data structure.
Field(s)
Group is late activated.
Aircraft is uncontrolled.
Unit list.
2D Position on x-axis in meters.
2D Position on y-axis in meters.
Function(s)
Unit data structure.
Field(s)
Name of the unit.
Function(s)
Field(s)
Function(s)
GROUND - Switch on/off radar emissions
Defined in:
Unit
Parameter:
#boolean switch
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.
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
Returns unit descriptor.
Descriptor type depends on unit category.
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
Returns the unit's health.
Dead units has health <= 1.0
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.
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.
ammunition item: "type-count" pair.
Field(s)
ammunition count
Function(s)
Enum that stores unit categories.
Field(s)
Function(s)
A unit descriptor.
Field(s)
istance / Time, --maximal velocity
Function(s)
An aircraft descriptor.
Field(s)
maximal safe acceleration
minimal safe acceleration
#Distance / #Time, --maximal climb rate
Function(s)
An airplane descriptor.
Field(s)
Distance / Time maximal TAS at ground level
Distance / Time maximal TAS at altitude of 10 km
Function(s)
A vehicle descriptor.
Field(s)
can the vehicle cross a rivers
Function(s)
An IRST.
Field(s)
detection of tail-on target with heat signature = 1 in upper hemisphere, engines are in idle
Function(s)
Enum that stores types of optic sensors.
Field(s)
Function(s)
A radar.
Field(s)
detection distance for RCS=1m^2 airborne target, nil if radar doesn't support air search
detection distance for RCS=1m^2 in high-resolution mapping mode, nil if radar has no HRM
detection distance for RCS=1m^2 in real-beam mapping mode, nil if radar doesn't support surface/land search
Function(s)
A radar.
Field(s)
Function(s)
A radar.
Field(s)
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)
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.
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)
enum that stores guidance methods. Available only for guided weapon (Weapon.Category.MISSILE and some Weapon.Category.BOMB).
enum that stores missile category. Available only for missiles (Weapon.Category.MISSILE).
Function(s)
returns weapon descriptor.
Descriptor type depends on weapon category.
Returns the unit that launched the weapon.
returns target of the guided weapon.
Unguided weapons and guided weapon that is targeted at the point on the ground will return nil.
Weapon.Category enum that stores weapon categories.
Field(s)
Bomb.
Missile
Rocket.
Shell.
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)
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.
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.
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)
Field(s)
Function(s)
Field(s)
Function(s)
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.
Field(s)
The birthplace enumerator is used to define where an aircraft or helicopter has spawned in association with birth events.
The volumeType enumerator defines the types of 3d geometery used within the world.searchObjects function.
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.
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.
DCS#word.VolumeType volume
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)
The volumeType enumerator defines the types of 3d geometery used within the #world.searchObjects function.