1. I placed single SA-10 site on template and client-side F-16C. F-16C's steerpoint 1 placed on SA-10 site so I can recognize its position.
2. Single Script activated with repetitive action and here's code.
trigger.action.outText("Checking Targets..", 1, false)
local sam = Unit.getByName('SA-10 SAM-2')
local ctrl = sam:getController()
local tgts = ctrl:getDetectedTargets(4)
for i, target in pairs(tgts) do
local detected , visible , lastTime , type , distance , lastPos , lastVel = ctrl:isTargetDetected(target.object,4)
trigger.action.outText("isTargetDetected() return these : "..tostring(detected).."/"..tostring(visible).."/"..tostring(lastTime).."/"..tostring(type).."/"..tostring(distance).."/"..tostring(lastPos).."/"..tostring(lastVel), 1, false)
trigger.action.outText("Detected Target from getDetectedTargets() : "..target.object:getName().." is visible : ".. tostring(target.visible), 1, false)
local samPos = sam:getPosition().p
samPos = {x = samPos.x, y = samPos.y+1, z = samPos.z}
trigger.action.outText("is LOS : ".. tostring(land.isVisible(samPos, target.object:getPosition().p)), 1, false)
end
3. Enter a mission, Climb until spotted by the SA-10 and hide behind the ridge. Then you can see that isTargetDetected() still returns visible as true. Even if there are obstacles in line of sight. also, distance, lastPos and lastVel still returns nil value after hide on ridge.
It tested on version 2.9.5.55300
detect_test.miz
dcs.log