Module DCS.DCSUnit
Global(s)
Global Unit |
Type(s)
Extends Dcs.DCSCoalitionWrapper.Object#CoalitionObject
Field(s)
Function(s)
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 controller of the unit if it exist and nil otherwise
Return value:
Returns unit descriptor.
Descriptor type depends on unit category.
Return value:
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.
Return value:
number:
Returns the unit's group if it exist and nil otherwise
Return value:
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.
Return value:
number:
Returns name of the player that control the unit or nil if the unit is controlled by A.I.
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.
Return value:
boolean, Wrapper.Object#Object:
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.
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.