Difference between revisions of "DCS func isTargetDetected"
From DCS World Wiki - Hoggitworld.com
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
|fName= isTargetDetected | |fName= isTargetDetected | ||
− | |vNum= 1.2. | + | |vNum= 1.2.6 |
|par1= [[DCS_Class_Controller|Controller]] | |par1= [[DCS_Class_Controller|Controller]] | ||
Line 53: | Line 53: | ||
|related= [[DCS_Class_Controller|'''Controller:''']] {{listofScriptingControllerFuncs}} | |related= [[DCS_Class_Controller|'''Controller:''']] {{listofScriptingControllerFuncs}} | ||
− | |examples= | + | |examples= The following returns al of the entries: |
local detected , visible , lastTime , type , distance , lastPos , lastVel = uCon:isTargetDetected(target) | local detected , visible , lastTime , type , distance , lastPos , lastVel = uCon:isTargetDetected(target) | ||
+ | To output a list of how the aircraft is detecting the target as a message: | ||
+ | local con = Unit.getController(Unit.getByName('whatever')) | ||
+ | local target = Unit.getByName('target') | ||
+ | local m = {} | ||
+ | for det, enum in pairs(Controller.Detection) do | ||
+ | m[#m+1] = det .. " : " | ||
+ | m[#m+1] = tostring(con:isTargetDetected(target, enum)) | ||
+ | m[#m+1] = "\n" | ||
+ | end | ||
+ | trigger.action.outText(table.concat(m), 20, true) | ||
|notes= Detection Types | |notes= Detection Types | ||
Line 70: | Line 80: | ||
}} | }} | ||
[[Category:Class Functions|isTargetDetected]] | [[Category:Class Functions|isTargetDetected]] | ||
+ | [[Category:Game Patch 1.2.6|isTargetDetected]] |