Steggles Posted December 29, 2015 Posted December 29, 2015 (edited) Is there a simple way to check if an EWR / AWACS unit has detection on any units and retrieve information (coalition, air-frame, position, heading and speed) on all detected aircraft? I would prefer it be done using a information directly from the EWR unit if possible, rather then just checking if its within a certain range of the EWR unit. I've looked at a few of the EWR / AWACS scripts out there, and they are far beyond the complexity I'm after. If I can just get the above mentioned information I can do what I need with it. Thanks Steggles EDIT: Or if someone could point me towards documentation on the API on EWR / AWACS units would be great too. Edited December 29, 2015 by Steggles -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
Grimes Posted December 29, 2015 Posted December 29, 2015 These functions aren't really an API specifically for EWR, but rather all AI detection. You can limit the search to just contacts known by radar. http://wiki.hoggit.us/view/DCS_func_isTargetDetected http://wiki.hoggit.us/view/DCS_func_getDetectedTargets Both functions return slightly different data. isTargetDetected is useful for tracking a list of possible targets and it returns a bunch of different entries pertaining to different data. It'll give you last know position and velocity. detected = Controller.isTargetDetected(Unit.getController(Unit.getByName(srData.unitName)), Unit.getByName(targetName), Controller.Detection.RADAR) I haven't really used getDetectedTargets. 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
Steggles Posted December 29, 2015 Author Posted December 29, 2015 Thank you sir!! Its a step in the direction I was after. The getDetectedTargets is what I think I'm after (every aircraft currently detected by the radar) Is there any particular reason isTargetDetected would be used apart from a trigger being set for when a particular unit is detected? -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
Grimes Posted December 29, 2015 Posted December 29, 2015 It simply can return more data that a given unit "knows" about another unit. For example if contact was lost for a given unit the last known position and velocity might be useful in plotting a potential intercept course or at least a starting position to try and find it again. Also getDetectedTargets *might* only return detected enemies while isTargetDetected *might* work with friendly objects. I really don't know, buts been a long time since I last tested either of these functions. 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
Steggles Posted December 29, 2015 Author Posted December 29, 2015 Thanks mate! Just tested out the getDetectedTargets and it does only detect enemies. I'll have a fiddle with isTargetDetected tomorrow. If it can detect a friendly that I know the name / ID of, it'll still do what it need it to. Thanks heaps for your help! Solved my problems. -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
Steggles Posted December 30, 2015 Author Posted December 30, 2015 isTargetDetected doesn't work with friendly units either :-( Is there any other way I can check this? I've looked thru the wiki but couldn't find anything. If all else fails I'll just check distance between the friendly unit and radar. -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
ESAc_matador Posted March 3, 2016 Posted March 3, 2016 how would you do this. if 'unitEWR' detects '[blue][aircraft]' then flag 100 is true. i want to activate few things... Please help!
Steggles Posted March 3, 2016 Author Posted March 3, 2016 Use getDetectedTargets and run a check on the return to ensure that any targets are aircraft. From the tests I did when doing EWRS, unless it's changed very recently, blue radar units will not detect blue units, and the same with red. If aircraft is detected use setUserFlag() -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
ESAc_matador Posted March 3, 2016 Posted March 3, 2016 I ll try to do my best but I am very bad with lua!
Steggles Posted March 3, 2016 Author Posted March 3, 2016 If I get a chance later today, I'll slap up a very simple example of what I suggested so you can see the workflow. -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
Steggles Posted March 4, 2016 Author Posted March 4, 2016 ohh cheers!!! PM Sent -16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com EWRS - Early Warning Radar Script Specs: Gigabyte Sniper Z5-S Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler 16GB RAM Gigabyte GTX 1080 TM Hotas Warthog: SN: 06976 Saitek Pro Flight Combat Rudder Pedals TrackIR5 with TrackClipPro & Oculus Rift 2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024
ESAc_matador Posted May 17, 2016 Posted May 17, 2016 (edited) Deleted messagw. I forgo I had some info. Edited May 18, 2016 by ESAc_matador
Recommended Posts