BrzI Posted December 9, 2020 Posted December 9, 2020 Hi folks, I want to deactivate a group after it has launched all of it's missiles. Tried by setting : Defined missile in defined Zone > flag 1 increase by 1 (repetitive) then Flag 1 value equals 12 > deactivate group but it does not work. Thanks for any tips.
dark_wood Posted December 9, 2020 Posted December 9, 2020 The SAM site is inside Zone? Cause maybe it already detect missiles inside. Try to do a little debug: under flag increase value add a message to all, so you can check if condition is true. And move SAM outside zone - maybe surround it with several small zones, one for each direction...
Rudel_chw Posted December 9, 2020 Posted December 9, 2020 (edited) 10 hours ago, BrzI said: Tried by setting : Defined missile in defined Zone > flag 1 increase by 1 (repetitive) then Flag 1 value equals 12 > deactivate group but it does not work. make sure that the zone is not too large, or else if the sam battery fires a second missile while the previous one is still in zone then it wont be counted. Edit: This sample is from one of my missions, you can see that the detection Zone is fairly small .. just enough to count one launch but not the next. Edited December 9, 2020 by Rudel_chw For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
BrzI Posted December 11, 2020 Author Posted December 11, 2020 Yeah, I figured out that the zone needs to be small. That solution works well for missiles that do not launch vertically (unlike the S300). Then I see exactly what you mention - some launches do not get counted. I am going to try defining really small zones for every launcher in the site...That ought to give more accurate results... Thanks/
BrzI Posted December 11, 2020 Author Posted December 11, 2020 Well, guess there is a bug in here somewhere - I defined a small 20m zone around each S-300 launcher...but it regularly misses registering one or two out of a full complement of 24 missiles. I simply cannot get all 24 flag value changes to register... tried making small changes to zone size and moving zones slightly...no joy... Thanks
Sedlo Posted December 12, 2020 Posted December 12, 2020 Keep in mind that those triggers are checked once every second, only. It might not register in a 20 metre zone because the missile may have transited it within that once second window. A script may be the answer here. My Youtube Channel MY DCS MISSIONS
Sedlo Posted December 12, 2020 Posted December 12, 2020 (edited) Here is a script that will help you accomplish what you're going for.... This will increase the value of Flag 1 by one each time a missile is fired by the units named LAUNCH 1, LAUNCH 2, LAUNCH 3, LAUNCH 4, LAUNCH 5 or LAUNCH 6. The important thing is to make sure you input the UNIT names of the missile launcher(s) into the script, not the group See attached mission file for an example of this script in use. The flag value will increase by one each time a missile is fired. Once 5 missiles are fired, the group deactivates. (Thanks to Hardcard for helping me with this a while ago) Handler = {} function Handler:onEvent(event) if event.id == world.event.S_EVENT_SHOT and event.initiator == Unit.getByName('LAUNCH 1') or Unit.getByName('LAUNCH 2') or Unit.getByName('LAUNCH 3') or Unit.getByName('LAUNCH 4') or Unit.getByName('LAUNCH 5') or Unit.getByName('LAUNCH 6') then flag_value = trigger.misc.getUserFlag('1') trigger.action.setUserFlag('1', flag_value + 1) end end world.addEventHandler(Handler) MISSILE LAUNCH SCRIPT.miz Edited December 12, 2020 by Sedlo 1 My Youtube Channel MY DCS MISSIONS
Rudel_chw Posted December 12, 2020 Posted December 12, 2020 14 minutes ago, Sedlo said: Here is a script that will help you accomplish what you're going for.... thanks a lot, seems very useful and simple. 1 For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar Mobile: iPad Pro 12.9" of 256 GB
feefifofum Posted December 14, 2020 Posted December 14, 2020 (edited) Awww Sedlo beat me to the quick event handler....that's my new favorite answer that everyone seems to need Edited December 14, 2020 by feefifofum 1 THE GEORGIAN WAR - OFFICIAL F-15C DLC
Recommended Posts