Difference between revisions of "DCS func hasSensors"

From DCS World Wiki - Hoggitworld.com
 
(2 intermediate revisions by the same user not shown)
Line 16: Line 16:
 
Some sensorTypes have additional subcategories which can be used to further specify for certain sensors.  
 
Some sensorTypes have additional subcategories which can be used to further specify for certain sensors.  
  
For all sensor information please check [[DCS_enum_unit_enums|the article on sensor enumerators]] for more details.  
+
Sensor Types
 +
 
 +
Unit.SensorType = {
 +
  OPTIC    = 0,
 +
  RADAR    = 1,
 +
  IRST      = 2,
 +
  RWR      = 3
 +
}
 +
 
 +
'''Sensor Sub categories'''
 +
 
 +
Optic Types
 +
 
 +
Unit.OpticType = {
 +
  TV    = 0, --TV-sensor
 +
  LLTV  = 1, --Low-level TV-sensor
 +
  IR    = 2  --Infra-Red optic sensor
 +
}
 +
 
 +
Radar Types
 +
 
 +
Unit.RadarType = {
 +
  AS    = 0, --air search radar
 +
  SS    = 1 --surface/land search radar
 +
}
  
  
Line 52: Line 76:
 
}}
 
}}
 
[[Category:Class Functions|hasSensors]]
 
[[Category:Class Functions|hasSensors]]
 +
[[Category:Game Patch 1.2.0|hasSensors]]

Latest revision as of 00:06, 21 March 2022

Scripting Root

Envrioment: Mission Scripting
Function: hasSensors Added with: 1.2.0
Member Of: Unit
Syntax: boolean Unit.hasSensors(Class Self , enum SensorType, enum SubCategory)
Description: Returns true if the unit has the specified sensors. If SensorType is not specified the function will return true if the unit has any type of sensors.

Some sensorTypes have additional subcategories which can be used to further specify for certain sensors.

Sensor Types

Unit.SensorType = {
  OPTIC     = 0,
  RADAR     = 1,
  IRST      = 2,
  RWR       = 3
}

Sensor Sub categories

Optic Types

Unit.OpticType = {
  TV     = 0, --TV-sensor
  LLTV   = 1, --Low-level TV-sensor
  IR     = 2  --Infra-Red optic sensor
}

Radar Types

Unit.RadarType = {
  AS    = 0, --air search radar
  SS    = 1 --surface/land search radar
}


Return Value: boolean
Return Example: true or false
Examples:
Related Functions: Unit Functions: isActive, getPlayerName, getID, getNumber, getCategoryEx, getObjectID, getController, getGroup, getCallsign, getLife, getLife0, getFuel, getAmmo, getSensors, hasSensors, getRadar, getDrawArgumentValue, getNearestCargos, enableEmission, getDescentCapacity

Object Functions: isExist, destroy, getCategory, getTypeName, getDesc, hasAttribute, getName, getPoint, getPosition, getVelocity, inAir

Coalition Object Functions: getCoalition, getCountry

Notes: