Black6 Posted May 7, 2021 Share Posted May 7, 2021 Hi, I miss a trigger in mission editor, which would react on target detection (radar/visual). I imagine something similar like "unit/part of group/ part of coalition in zone" in combination with specific unit. e.g. IF unit(radar) DETECTS unit(target)/part of group/part of coalition DO .... I´am trying to bypass it by lua script, but without any succes yet 8 Link to comment Share on other sites More sharing options...
Harker Posted May 7, 2021 Share Posted May 7, 2021 +1. That'd be very useful for missions where avoiding detection is critical. 2 The vCVW-17 is looking for Hornet and Tomcat pilots and RIOs. Join the vCVW-17 Discord. F/A-18C, F-15E, AV-8B, F-16C, JF-17, A-10C/CII, M-2000C, F-14, AH-64D, BS2, UH-1H, P-51D, Sptifire, FC3 - i9-13900K, 64GB @6400MHz RAM, 4090 Strix OC, Samsung 990 Pro Link to comment Share on other sites More sharing options...
toutenglisse Posted May 7, 2021 Share Posted May 7, 2021 16 minutes ago, Black6 said: Hi, I miss a trigger in mission editor, which would react on target detection (radar/visual). I imagine something similar like "unit/part of group/ part of coalition in zone" in combination with specific unit. e.g. IF unit(radar) DETECTS unit(target)/part of group/part of coalition DO .... I´am trying to bypass it by lua script, but without any succes yet Hi, here is an example with DCS script. It uses this function : DCS func isTargetDetected - DCS World Wiki - Hoggitworld.com In my example the RWR detection of SAM site radar by a wingman is evaluated every seconds, and displays a message when the SAM is RWR detected (which also stops the evaluation). You can adapt it to your need (name of "target" unit to be detected, name of "detecting" unit, and type of detection : radar, visual, etc...), also the "do" function when detected in my example is in the script, but you can change the line that displays text to instead activate a flag - example : trigger.action.setUserFlag( "2", true ) , and then add a trigger to do whatever you want when the flag n°2 gets activated. test-RWR-detection-message.miz 2 2 Link to comment Share on other sites More sharing options...
Black6 Posted May 7, 2021 Author Share Posted May 7, 2021 55 minutes ago, toutenglisse said: Hi, here is an example with DCS script. It uses this function : DCS func isTargetDetected - DCS World Wiki - Hoggitworld.com In my example the RWR detection of SAM site radar by a wingman is evaluated every seconds, and displays a message when the SAM is RWR detected (which also stops the evaluation). You can adapt it to your need (name of "target" unit to be detected, name of "detecting" unit, and type of detection : radar, visual, etc...), also the "do" function when detected in my example is in the script, but you can change the line that displays text to instead activate a flag - example : trigger.action.setUserFlag( "2", true ) , and then add a trigger to do whatever you want when the flag n°2 gets activated. test-RWR-detection-message.miz 8.64 kB · 3 downloads I have to switch to 2.7. This will take some time. Could you replace F-18 by F-16 or F-5? I don´t have this module. Thanks Link to comment Share on other sites More sharing options...
toutenglisse Posted May 7, 2021 Share Posted May 7, 2021 3 minutes ago, Black6 said: I have to switch to 2.7. This will take some time. Could you replace F-18 by F-16 or F-5? I don´t have this module. Thanks You can open the mission file in mission editor, click on the F-18 group and change the type from hornet to whatever you want and save (it just needs that the unit/pilot names remain the same for the script to work). Link to comment Share on other sites More sharing options...
Northstar98 Posted May 8, 2021 Share Posted May 8, 2021 (edited) +99999999999999999999 This would also be incredibly useful for SAM sites, especially if we extend it to detecting an incoming missile (likely to be an ARM) and shut down. At the moment I have to take a guess at what range a particular RADAR would be able to detect one and shut down. Edited November 18, 2021 by Northstar98 1 Modules I own: F-14A/B, Mi-24P, AV-8B N/A, AJS 37, F-5E-3, MiG-21bis, F-16CM, F/A-18C, Supercarrier, Mi-8MTV2, UH-1H, Mirage 2000C, FC3, MiG-15bis, Ka-50, A-10C (+ A-10C II), P-47D, P-51D, C-101, Yak-52, WWII Assets, CA, NS430, Hawk. Terrains I own: South Atlantic, Syria, The Channel, SoH/PG, Marianas. System: GIGABYTE B650 AORUS ELITE AX, AMD Ryzen 5 7600, Corsair Vengeance DDR5-5200 32 GB, Western Digital Black SN850X 1 TB (DCS dedicated) & 2 TB NVMe SSDs, Corsair RM850X 850 W, NZXT H7 Flow, MSI G274CV. Peripherals: VKB Gunfighter Mk.II w. MCG Pro, MFG Crosswind V3 Graphite, Logitech Extreme 3D Pro. Link to comment Share on other sites More sharing options...
toutenglisse Posted May 8, 2021 Share Posted May 8, 2021 8 hours ago, Northstar98 said: +99999999999999999999 This would also be very useful for SAM sites - whether or not they are able to detect an incoming missile (likely to be an ARM) and shut down. At the moment I have to take a guess at what range a particular RADAR would be able to detect one and shut down. Hi, the "Controller.isTargetDetected" function also work with weapon detection. Here is a mission example (using Mist because of event handler that I'm only able to make work with Mist...) with 1) a event handler that detects HARM shot and track it for the SAM SR unit's radar detection, 2) a detection function that makes SAM SR unit to go GREEN state (radar off) for 45 seconds (can be changed) when a HARM is detected (with a defined delay to turn GREEN), then go back to RED state and start again detection (with a defined delay to restart detection). It works very well, but you need to tweak the different "defined delays" to makes SAM SR unit's survivability to varie from "untouchable" to "easy to kill with HARM". (if delays are 1 seconds for : HARM detection / GREEN STATE, and RED STATE / start again to detect, or if delay between GREEN and back to RED state is long enough, then the unit will be untouchable by HARM ! Can only be disabled by GPS glide bomb launched during GREEN state for example) In my example I've put a short 45 seconds delay between GREEN and back to RED states, and a 30 seconds delay between RED STATE / start again to detect, so if HARM is still in position to track again when SAM SR goes RED and close enough to reach it within 30 seconds, it will hit it. The SAM SR unit gets disabled almost every times with these settings. Tunable triggers/delays are : 1) alarm state GREEN - Time since flag 2 - X seconds (time between detection and GREEN state command) 2) alarm state RED - Time since flag 3 - X seconds (time between GREEN state command and RED state command) 3) restart HARM detection - Time since flag 4 - X seconds (time between RED state command and restart of HARM detection) Works for 1 HARM tracked at a time (in my example the 2 hornets only shoot 1 HARM at a time), it would probably needs a table of existing HARMs and detection of all HARMs through table to be really efficient in all cases. (and tracking/detecting all kinds of ARM also) Play mission in F10 map view and use time acceleration to see things happening (with displayed messages each time something happens), play with the delays settings in triggers, if you want. test-HARM-detection-Mist.miz 2 Link to comment Share on other sites More sharing options...
Black6 Posted May 10, 2021 Author Share Posted May 10, 2021 On 5/7/2021 at 3:03 PM, toutenglisse said: Hi, here is an example with DCS script. It uses this function : DCS func isTargetDetected - DCS World Wiki - Hoggitworld.com In my example the RWR detection of SAM site radar by a wingman is evaluated every seconds, and displays a message when the SAM is RWR detected (which also stops the evaluation). You can adapt it to your need (name of "target" unit to be detected, name of "detecting" unit, and type of detection : radar, visual, etc...), also the "do" function when detected in my example is in the script, but you can change the line that displays text to instead activate a flag - example : trigger.action.setUserFlag( "2", true ) , and then add a trigger to do whatever you want when the flag n°2 gets activated. test-RWR-detection-message.miz 8.64 kB · 8 downloads Many thanks for your help. Now it works just like i wished. Now, I´m able to adapt it for any purpose i need. Syria_000.miz Link to comment Share on other sites More sharing options...
WelshZeCorgi Posted May 11, 2021 Share Posted May 11, 2021 (edited) Wait, it's tied to the AI wingman's RWR? Cause AI wingmen can do some crazy shit, pop up and get detected while your own plane is doing NOE flying just fine. I want to do something similar except with clients in coop multiplayer. Edited May 11, 2021 by WelshZeCorgi Link to comment Share on other sites More sharing options...
Ducksen Posted May 14, 2021 Share Posted May 14, 2021 +1 And to be honest this would make things delightful. Problem is it should not be triggered by the radar beam simply hitting your aircraft. It has to be modeled so you are identified as an aircraft and not ground clutter. And tall order coming here; distinguish if it sees a confirmed hostile or just an unknown or friendly. So we can inside the editor just set that up and have aircraft launch from airbases. 1 Link to comment Share on other sites More sharing options...
Northstar98 Posted May 14, 2021 Share Posted May 14, 2021 (edited) On 5/14/2021 at 7:50 PM, Ducksen said: +1 And to be honest this would make things delightful. Problem is it should not be triggered by the radar beam simply hitting your aircraft. It has to be modeled so you are identified as an aircraft and not ground clutter. And tall order coming here; distinguish if it sees a confirmed hostile or just an unknown or friendly. So we can inside the editor just set that up and have aircraft launch from airbases. AI RADARs almost certainly don't take in clutter into effect; so long as it's within the scan zone, has a radial velocity over a threshold it can see it so long as LOS isn't blocked, with some compensation such that the RADAR behaves as it were on a spherical Earth, despite DCS' flat Earth maps. This is something that was fairly easy to see in the sensors.lua file, but that along with several others was hidden as part of the 2.7 update. Edited April 24, 2022 by Northstar98 formatting Modules I own: F-14A/B, Mi-24P, AV-8B N/A, AJS 37, F-5E-3, MiG-21bis, F-16CM, F/A-18C, Supercarrier, Mi-8MTV2, UH-1H, Mirage 2000C, FC3, MiG-15bis, Ka-50, A-10C (+ A-10C II), P-47D, P-51D, C-101, Yak-52, WWII Assets, CA, NS430, Hawk. Terrains I own: South Atlantic, Syria, The Channel, SoH/PG, Marianas. System: GIGABYTE B650 AORUS ELITE AX, AMD Ryzen 5 7600, Corsair Vengeance DDR5-5200 32 GB, Western Digital Black SN850X 1 TB (DCS dedicated) & 2 TB NVMe SSDs, Corsair RM850X 850 W, NZXT H7 Flow, MSI G274CV. Peripherals: VKB Gunfighter Mk.II w. MCG Pro, MFG Crosswind V3 Graphite, Logitech Extreme 3D Pro. Link to comment Share on other sites More sharing options...
Boshar67 Posted May 23, 2021 Share Posted May 23, 2021 Is there a local "DetectingCoalition" vs. the DetectingUnit? I am trying to set a flag when any Blue coalition aircraft is detected by EW radar. Link to comment Share on other sites More sharing options...
timothyboss Posted June 7, 2021 Share Posted June 7, 2021 On 5/7/2021 at 5:38 AM, Black6 said: Hi, I miss a trigger in mission editor, which would react on target detection (radar/visual). I imagine something similar like "unit/part of group/ part of coalition in zone" in combination with specific unit. e.g. IF unit(radar) DETECTS unit(target)/part of group/part of coalition DO .... I´am trying to bypass it by lua script, but without any succes yet Yup +1 just give us the trigger back. 1 Link to comment Share on other sites More sharing options...
Fisherman82 Posted November 20, 2021 Share Posted November 20, 2021 Its wierd that this is not available as a trigger in the ME when its possible to do with a simple script Link to comment Share on other sites More sharing options...
gregfp66 Posted November 23, 2021 Share Posted November 23, 2021 Yeah would be really great to set up gci interception and other nasty stuff without using script 1 Link to comment Share on other sites More sharing options...
killerwhale Posted March 6, 2022 Share Posted March 6, 2022 I tested the mission attached but it is laggy, is it because of the code? and the continuous checking of target detection? 1 Link to comment Share on other sites More sharing options...
Exorcet Posted March 7, 2022 Share Posted March 7, 2022 This would be an excellent addition to the ME. Knowing when a given radar, or any radar has detected either a specific group or unit, or anything from the opposite coalition (or even the same coalition) is useful in so many situations. It would allow mission creators to make better use of SAM's and also help deal with the limitations in the current AWACS modeling. 1 Awaiting: DCS F-15C Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files Link to comment Share on other sites More sharing options...
giaco1 Posted March 9, 2022 Share Posted March 9, 2022 Hello Everybody, in the script -------------------------------------------------------- local DetectingUnit = Unit.getByName('P19') local TargetUnit = Unit.getByName('Tiger-1') if Controller.isTargetDetected(DetectingUnit , TargetUnit , Radar) == true then trigger.action.outText('detected by Flat Face', 10) trigger.action.setUserFlag( "11", true ) end ------------------------------------------------------- If possible to change Unit.getByName with a Coalition (BLU, RED or NEUTRAL)? thanks for support [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
gmangnall Posted April 4, 2022 Share Posted April 4, 2022 Here is what I used where EWR-1 is the radar. I amHarrier1-1and my 2 wingmen are Harrier1-2 and Harrier1-3 local DetectingUnit1 = Unit.getByName('EWR-1') local TargetUnit1 = Unit.getByName('Harrier1-2') local TargetUnit2 = Unit.getByName('Harrier1-2') local TargetUnit3 = Unit.getByName('Harrier1-3') if Unit.getByName('Player-1'):isExist() then if Controller.isTargetDetected(DetectingUnit1 , (TargetUnit1 or TargetUnit2 or TargetUnit3) , Radar) == true then trigger.action.setUserFlag( "1", false ) trigger.action.setUserFlag( "2", true ) end else end The mission starts by activating flag1 and the script runs continuosly until a detection which turns off flag1 and thus stops the script. Flag2 then lets you action "other stuff" Link to comment Share on other sites More sharing options...
Darkenmass Posted April 24, 2022 Share Posted April 24, 2022 Maybe i am dumb but you can use vanilla code to do it, just add a trigger zone as big as the radar detection zone, and use the unit/coalition/group inside zone trigger..... Link to comment Share on other sites More sharing options...
Northstar98 Posted April 24, 2022 Share Posted April 24, 2022 (edited) 1 hour ago, Darkenmass said: Maybe i am dumb but you can use vanilla code to do it, just add a trigger zone as big as the radar detection zone, and use the unit/coalition/group inside zone trigger..... That's pretty unworkable for mimicking a RADAR I'm afraid. Assumes targets will be detected at the maximum range of the RADAR (or at least what DCS thinks the maximum range of a RADAR should be) or in other words, doesn't account for RCS at all. Doesn't account for LOS. Doesn't account for radial velocity (at least for doppler based RADARs - be they pulse-doppler or CW). Doesn't account for any kind of jamming. DCS' RADAR modelling outside of playable modules (and out of those, only a few have high-fidelity RADAR modelling, with one being notably superior to everything else), just using unit inside zone would effectively reduce any kind of fidelity. Edited April 24, 2022 by Northstar98 1 Modules I own: F-14A/B, Mi-24P, AV-8B N/A, AJS 37, F-5E-3, MiG-21bis, F-16CM, F/A-18C, Supercarrier, Mi-8MTV2, UH-1H, Mirage 2000C, FC3, MiG-15bis, Ka-50, A-10C (+ A-10C II), P-47D, P-51D, C-101, Yak-52, WWII Assets, CA, NS430, Hawk. Terrains I own: South Atlantic, Syria, The Channel, SoH/PG, Marianas. System: GIGABYTE B650 AORUS ELITE AX, AMD Ryzen 5 7600, Corsair Vengeance DDR5-5200 32 GB, Western Digital Black SN850X 1 TB (DCS dedicated) & 2 TB NVMe SSDs, Corsair RM850X 850 W, NZXT H7 Flow, MSI G274CV. Peripherals: VKB Gunfighter Mk.II w. MCG Pro, MFG Crosswind V3 Graphite, Logitech Extreme 3D Pro. Link to comment Share on other sites More sharing options...
Elphaba Posted June 22, 2022 Share Posted June 22, 2022 Is there anyway to detect if an AI (Enemy) aircraft has visually or on their own radar, detected a player (or several if multiplayer) aircraft/helo and then fire a trigger action if it does? I'm trying to write a sneaking mission where there are enemy aircraft all over but the weather is crap, so it's possible to sneak past them but I need things to go south if they are detected. It seems like the enemy AI can see through everything and knows everything all the time and doesn't take into account if the player is behind them or behind a hill or the aircraft doesn't have a radar and the weather is crap - they can still see them. Link to comment Share on other sites More sharing options...
Exorcet Posted June 22, 2022 Share Posted June 22, 2022 4 hours ago, Elphaba said: Is there anyway to detect if an AI (Enemy) aircraft has visually or on their own radar, detected a player (or several if multiplayer) aircraft/helo and then fire a trigger action if it does? https://forum.dcs.world/topic/299207-enemy-pilot-vision/?do=findComment&comment=4952431 Awaiting: DCS F-15C Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files Link to comment Share on other sites More sharing options...
Khegrow Posted August 8, 2023 Share Posted August 8, 2023 Gentlemen, I have a question regarding on "how to" make use of these fine lines of codes. So while I used the script and put them into a lua, it seems like they're never evaluated. Script: local DetectingUnit = Unit.getByName('R_EWR_IADS-1-MAYKOP') local TargetUnit = Unit.getByName('TESTOMAT-1') if Controller.isTargetDetected(DetectingUnit ,TargetUnit ,Radar) == true then trigger.action.outText('I CAN SEE YOU!!!', 20) trigger.action.setUserFlag( "10", true ) end /Script But I am at Angels 30, my EWR is screaming that the EWR in question is pinging me, but I don't get the message nor does it seem as if the Flag is being set, as I have an ingame trigger (Switching) to spam me with a debug message. So long story short: Is there a way to continously re-evaluate the script or how to best integrate it into a mission? Thanks in advance Khegrow 1 Link to comment Share on other sites More sharing options...
Recommended Posts