Prof_hilactic Posted June 19, 2016 Share Posted June 19, 2016 Hi I am trying to detect if a laser spot is inside a zone or not but I don t know if a Spot is an Object or not (i.e can I use world.searchObjects in conjunction with Spot?) test = 'test' local zone = trigger.misc.getZone(test) local Spots = {} local volume = { id = world.VolumeType.SPHERE, params = { point = zone.point, radius = zone.radius } } local jtac = Unit.getByName('jtac') local target = Unit.getByName('target'):getPoint() local ray = Spot.createInfraRed(jtac, {x = 0, y = 1, z = 0}, target, 1337) local spotloc = Spot.getPoint(ray) --trigger.action.smoke(spotloc, trigger.smokeColor.Green) local ifFound = function(Spots, data) trigger.action.smoke(spotloc, trigger.smokeColor.Green) data = Spot:getTypeName() env.info(data .. 'Spot Found') return true end env.info('test') world.searchObjects(Spot.Category.LASER, volume, ifFound, data) Any ideas? 1 Link to comment Share on other sites More sharing options...
FlightControl Posted June 23, 2016 Share Posted June 23, 2016 Hi everybody, Let me put the question a bit different... The million dollar question that we don't understand is: What is the relation between Spots and IRST? What we are trying to achieve, is to: 1. Detect Spots that a Unit is emitting. One can create Spots, but can we also "search" them? 2. Imagine that we can search for Spots, and that Spot is emitting to a target location or a unit, how can we find that Spot target location? 3. When will the function isTargetDetected() return a true for a function call "isTargetDetected", using the detection type Controller.Detection.IRST? In other words, is it possible to detect AI spotting other units with this function? local TargetIsDetected, TargetIsVisible, TargetLastTime, TargetKnowType, TargetKnowDistance, TargetLastPos, TargetLastVelocity = FACUnitController:isTargetDetected( DetectedUnit:GetDCSUnit(), Controller.Detection.IRST ) Your help would be kindly appreciated. Who can help? Sven 1 [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] Link to comment Share on other sites More sharing options...
Grimes Posted June 23, 2016 Share Posted June 23, 2016 IRST and spot aren't related. For the controller IRST refers to an IR sensor, I believe it may be limited to the IRST sensors found on aircraft like the Su-27 and Mig-29. However it could just be a catch all for any IR sensor like a FLIR on a targeting pod. Spots are simply created via script and I don't believe you are able to access any that are generated either by players in an A-10C, as JTAC, or by AI JTACs. You can obviously access the ones you create assuming you saved the spot object. world.searchObjects() can only find objects that belong to the Object class. It can't find groups, controllers, or spots. 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 Link to comment Share on other sites More sharing options...
FlightControl Posted June 23, 2016 Share Posted June 23, 2016 OK. thanks Grimes for this clarification :-) Maybe this is a potential extension that could be requested? We think it would make sense to do so ... We'll use a workaround... So, if in CA a player (a human) is lasing a unit, that cannot be detected with any function in the scripting engine? [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] Link to comment Share on other sites More sharing options...
Grimes Posted June 24, 2016 Share Posted June 24, 2016 The lasing part no. The controller might still be able to be used to determine if a target is detected by the unit the player is controlling. You just won't know if the player actually detects the target. As for a feature request, yeah it could be made, I don't know when it might come to fruition though. 1 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 Link to comment Share on other sites More sharing options...
FlightControl Posted June 25, 2016 Share Posted June 25, 2016 The lasing part no. The controller might still be able to be used to determine if a target is detected by the unit the player is controlling. You just won't know if the player actually detects the target. As for a feature request, yeah it could be made, I don't know when it might come to fruition though. Ok. Have thought of a nice workaround in the little moose framework... Will embed Spot actions within the database of the framework. Can then search that database to understand which AI is beaming which units. And will test the controller of a player unit that when he beams, that it is detected. Sent from mTalk on Windows 10 mobile [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] Link to comment Share on other sites More sharing options...
Recommended Posts