DCS func isTargetDetected: Difference between revisions
From DCS World Wiki - Hoggitworld.com
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 58: | Line 58: | ||
To output a list of how the aircraft is detecting the target as a message: | To output a list of how the aircraft is detecting the target as a message: | ||
local con = Unit.getController(Unit.getByName('whatever') | local con = Unit.getController(Unit.getByName('whatever')) | ||
local target = Unit.getByName('target') | local target = Unit.getByName('target') | ||
local m = {} | local m = {} | ||
for det, enum in pairs(Controller.Detection) do | for det, enum in pairs(Controller.Detection) do | ||
m[m+1] = det .. " : " | m[#m+1] = det .. " : " | ||
m[m+1] = con:isTargetDetected(target, enum) | m[#m+1] = tostring(con:isTargetDetected(target, enum)) | ||
m[m+1] = "\n" | m[#m+1] = "\n" | ||
end | end | ||
trigger.action.outText(table.concat(m), 20, true) | trigger.action.outText(table.concat(m), 20, true) | ||
