Detection

Home > Support > Technical questions > DCS: World Scripting Engine > Part 2 > Classes > Detection

Detection

Detection

 Controller.Detection = {
   VISUAL,
   OPTIC,
   RADAR,
   IRST,
   RWR,
   DLINK
 }

enum contains identifiers of surface types.

 function 
     boolean detected,
     boolean visible,
     ModelTime lastTime,
     boolean type,
     boolean distance,
     Vec3 lastPos,
     Vec3 lastVel,
                     Controller.isTargetDetected(Controller self,
                                                 Object target,
                                                 [Controller.Detection detection1,
                                                  Controller.Detection detection2,
                                                  ...
                                                  Controller.Detection detectionN] or nil) 

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.

target

  • Target to check.

detection1 - detectionN

  • Detection methods of interest.

Return values:

detected

  • True if the target is detected.

visible

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

type

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

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.
 DetectedTarget = {
   object = Object, --the target
   visible = boolean, --the target is visible
   type = boolean, --the target type is known
   distance = boolean --distance to the target is known
 }

detected target.

 DetectedTargets = array of DetectedTarget

list of detected targets.

 function array DetectedTargets Controller.getDetectedTargets(Controller self,
                                                              [Controller.Detection detection1,
                                                               Controller.Detection detection2,
                                                                 ...
                                                               Controller.Detection detectionN] or nil)

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.

detection1 - detectionN

  • Detection methods of interest.
 function Controller.knowTarget(Controller self, Object object, boolean type, boolean distance)

object

  • The target.

type

  • Target type is known.

distance

  • Distance to the target type is known.

FOLLOW US