Jump to content

Recommended Posts

Posted (edited)

Is there a known issue related to the detection of static structures?

 

When using the method:

DetectedTargets = Controller:getDetectedTargets()

this API code returns an array of detected targets...

When in the visibility of the detecting group a static structure is located and is detected, it will be included in the list ...

 

So, when i have the following code:

 

for DetectionObjectID, Detection in pairs( DetectedTargets ) do
 local DetectedObject = Detection.object -- The detected object
         
 local Detected = false

 Detected = Detected or ( DetectedObject and DetectedObject:isExist() and DetectedObject.id_ < 50000000 and DetectedObject:getCategory() == Object.Category.UNIT )
 Detected = Detected or ( DetectedObject and DetectedObject:isExist() and DetectedObject.id_ < 50000000 and DetectedObject:getCategory() == Object.Category.STATIC )

 self:E( { DetectedObjectType = DetectedObject:getTypeName() } )

end

then this logic seems to be failing because in that list, an entry is included with a wrong DetectedObject.id_ entry. The value is above 500000..., but should be in my case 24...

As a result, the static cannot be found and an error is thrown. It does know however that it is a static, because it writes "Static doesn't exist" in the error message log.

 

Is there anybody who has used the getDetectedTargets() API and has experienced this behaviour too?

 

This is the relevant extract from the dcs.log:

 

04333.369 INFO    SCRIPTING:    560(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObject"]={["id_"]=16777472,},})
04333.369 INFO    SCRIPTING:    565(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObjectType"]="ammo_cargo",})
04333.369 INFO    SCRIPTING:    701(    -1)/T:     DETECTION_UNITS00060.{}
04333.369 INFO    SCRIPTING:    560(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObject"]={["id_"]=16777728,},})
04333.369 INFO    SCRIPTING:    565(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObjectType"]="MiG-25PD",})
04333.369 INFO    SCRIPTING:    580(    -1)/T:     DETECTION_UNITS00060.{["TargetIsDetected"]=true,["TargetIsVisible"]=true,["TargetKnowType"]=true,["TargetLastTime"]=true,}
04333.369 INFO    SCRIPTING:    598(    -1)/T:     DETECTION_UNITS00060.{[1]="Detected Target:",[2]="Recce",[3]="Pilot #001",[4]=0.17596424140721,[5]=0,}
04333.369 INFO    SCRIPTING:    701(    -1)/T:     DETECTION_UNITS00060.{}
04333.369 INFO    SCRIPTING:    560(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObject"]={["id_"]=16777984,},})
04333.370 INFO    SCRIPTING:    565(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObjectType"]="Ka-50",})
04333.370 INFO    SCRIPTING:    580(    -1)/T:     DETECTION_UNITS00060.{["TargetIsDetected"]=true,["TargetIsVisible"]=true,["TargetKnowType"]=true,["TargetLastTime"]=true,}
04333.370 INFO    SCRIPTING:    598(    -1)/T:     DETECTION_UNITS00060.{[1]="Detected Target:",[2]="Recce",[3]="Pilot #002",[4]=0.13939431565013,[5]=1,}
04333.370 INFO    SCRIPTING:    701(    -1)/T:     DETECTION_UNITS00060.{}
04333.370 INFO    SCRIPTING:    560(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObject"]={["id_"]=16778240,},})
04333.370 INFO    SCRIPTING:    565(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObjectType"]="ATMZ-5",})
04333.370 INFO    SCRIPTING:    580(    -1)/T:     DETECTION_UNITS00060.{["TargetIsDetected"]=true,["TargetIsVisible"]=true,["TargetKnowType"]=true,["TargetLastTime"]=true,}
04333.370 INFO    SCRIPTING:    598(    -1)/T:     DETECTION_UNITS00060.{[1]="Detected Target:",[2]="Recce",[3]="Unit #1",[4]=0.11842186601992,[5]=2,}
04333.370 INFO    SCRIPTING:    701(    -1)/T:     DETECTION_UNITS00060.{}
04333.370 INFO    SCRIPTING:    560(    -1)/E:     DETECTION_UNITS00060.function({["DetectedObject"]={["id_"]=50331904,},})
04333.370 INFO    SCRIPTING: Error in SCHEDULER function:[string "Scripts/Moose/Functional/Detection.lua"]:565: Static doesn't exist
04333.370 INFO    SCRIPTING: stack traceback:
   [string "Scripts/Moose/Core/Fsm.lua"]:586: in function <[string "Scripts/Moose/Core/Fsm.lua"]:582>
   [C]: in function 'getTypeName'
   [string "Scripts/Moose/Functional/Detection.lua"]:565: in function <[string "Scripts/Moose/Functional/Detection.lua"]:528>
   (tail call): ?
   [C]: in function 'xpcall'
   [string "Scripts/Moose/Core/Fsm.lua"]:594: in function '_call_handler'
   [string "Scripts/Moose/Core/Fsm.lua"]:661: in function <[string "Scripts/Moose/Core/Fsm.lua"]:599>
   (tail call): ?
   [C]: in function 'xpcall'
   [string "Scripts/Moose/Core/ScheduleDispatcher.lua"]:129: in function <[string "Scripts/Moose/Core/ScheduleDispatcher.lua"]:90>

If needed I can post a demo mission to reproduce this.

 

This error notice has a less urgency than the S_EVENT_PLAYER_ENTER bug report, which is much more urgent to be fixed. Thanks in advance!

 

Sven

Edited by BIGNEWY
TITLE

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

  • 10 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...