FlightControl Posted May 15, 2017 Posted May 15, 2017 (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 April 11, 2018 by BIGNEWY TITLE [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
FlightControl Posted April 9, 2018 Author Posted April 9, 2018 Bug 9 - Detection of statics make DCS crash Can we please have a look at this together? https://forums.eagle.ru/showthread.php?p=3139284#post3139284 [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
ED Team BIGNEWY Posted April 9, 2018 ED Team Posted April 9, 2018 please attach an example mission so we can check Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal
Grimes Posted April 11, 2018 Posted April 11, 2018 Reported. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
FlightControl Posted April 11, 2018 Author Posted April 11, 2018 @grimes ... Thanks. You could resimulate it? [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
Grimes Posted April 11, 2018 Posted April 11, 2018 Thats generally what I mean when I say reported. Can't think of the last time I said it in context of reporting a post to moderators. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
FlightControl Posted April 11, 2018 Author Posted April 11, 2018 OK. confirmed! [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
Recommended Posts