TheTrooper Posted July 20, 2019 Share Posted July 20, 2019 Hi All, I'm working on a ROE Intercept mission. Is there a way to determine if the Player or Players group fires within a trigger zone? Also, how do you set the mission as a failure for a campaign if that's the case? (broken Rul of engagement) ----------------------------------------------- Intel® Core™i7 Quad Core Processor i7-6700 (3.4GHz) 8MB Cache | 32GB HyperX FURY DDR4 2133MHz | MSI GeForce RTX 2070 ARMOR 8G |SSD 1TB 970 EVO Plus M.2 Link to comment Share on other sites More sharing options...
Bunny Clark Posted July 21, 2019 Share Posted July 21, 2019 You can use the MISSILE IN ZONE condition and set it to the weapon types the player is carrying. Add an action to the same trigger to set a flag to true, then use that flag to determine mission success in scoring how ever you'd like to. Oil In The Water Hornet Campaign. Bunny's: Form-Fillable Controller Layout PDFs | HOTAS Kneeboards | Checklist Kneeboards Link to comment Share on other sites More sharing options...
TheTrooper Posted July 21, 2019 Author Share Posted July 21, 2019 You can use the MISSILE IN ZONE condition and set it to the weapon types the player is carrying. Add an action to the same trigger to set a flag to true, then use that flag to determine mission success in scoring how ever you'd like to. Thanks, i don’t see an option for guns though? ----------------------------------------------- Intel® Core™i7 Quad Core Processor i7-6700 (3.4GHz) 8MB Cache | 32GB HyperX FURY DDR4 2133MHz | MSI GeForce RTX 2070 ARMOR 8G |SSD 1TB 970 EVO Plus M.2 Link to comment Share on other sites More sharing options...
Sedlo Posted July 21, 2019 Share Posted July 21, 2019 Add this script prior to your engagment will result in Flag 200 becoming true whenever the gun is fired: Handler = {} function Handler:onEvent(event) if event.id == world.event.S_EVENT_SHOOTING_START and event.initiator == Unit.getByName('UZI 11') then trigger.action.setUserFlag('200', true) end end world.addEventHandler(Handler) Make sure to change the UZI 11 above to whatever your UNIT Name is. So you could have whenever flag 200 is true, AND the player is within a zone, something will happen. My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
Sedlo Posted July 21, 2019 Share Posted July 21, 2019 Same thing for missiles, just change the event: Handler = {} function Handler:onEvent(event) if event.id == world.event.S_EVENT_SHOT and event.initiator == Unit.getByName('UZI 11') then trigger.action.setUserFlag('201', true) end end world.addEventHandler(Handler) 1 My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
Sedlo Posted July 21, 2019 Share Posted July 21, 2019 To reset the condition, do another one that says like, Time since Flag 200 is on 60 seconds > Flag 200 off. My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
TheTrooper Posted July 21, 2019 Author Share Posted July 21, 2019 Same thing for missiles, just change the event: Handler = {} function Handler:onEvent(event) if event.id == world.event.S_EVENT_SHOT and event.initiator == Unit.getByName('UZI 11') then trigger.action.setUserFlag('201', true) end end world.addEventHandler(Handler) Does that stil work for a group as opposed to a unit? WHere would I put that code? ----------------------------------------------- Intel® Core™i7 Quad Core Processor i7-6700 (3.4GHz) 8MB Cache | 32GB HyperX FURY DDR4 2133MHz | MSI GeForce RTX 2070 ARMOR 8G |SSD 1TB 970 EVO Plus M.2 Link to comment Share on other sites More sharing options...
Sedlo Posted July 21, 2019 Share Posted July 21, 2019 Haven't tried it with group vs unit, but maybe... Put it in as a Do Script soon after mission start (or whenever you want). My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
Sedlo Posted July 21, 2019 Share Posted July 21, 2019 Here's a test mission where you can see where the code goes.FIRING SCRIPTS.miz My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
Hardcard Posted July 21, 2019 Share Posted July 21, 2019 (edited) Does that stil work for a group as opposed to a unit? WHere would I put that code? Yes, you can check whether the shooting units belong to specific groups. But keep in mind that these events are triggered by individual units, not groups. Handler = {} function Handler:onEvent(event) if event.id == world.event.S_EVENT_SHOOTING_START and event.initiator:getGroup():getName() == " name of the group to check " then -- To check for additional groups, just copy/paste the second condition (from and to the second " ) and change the group name trigger.action.setUserFlag('200', true) end if event.id == world.event.S_EVENT_SHOT and event.initiator:getGroup():getName() == " name of the group to check " then -- To check for additional groups, just copy/paste the second condition (from and to the second " ) and change the group name trigger.action.setUserFlag('201', true) end end world.addEventHandler(Handler) -- If you need to check many groups at a time, you might be better off working with sets, though This script can be loaded with a MISSION START trigger, if you want. Edited July 22, 2019 by Hardcard [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
TheTrooper Posted September 4, 2019 Author Share Posted September 4, 2019 (edited) Sorted! Thakns. Add this script prior to your engagment will result in Flag 200 becoming true whenever the gun is fired: Handler = {} function Handler:onEvent(event) if event.id == world.event.S_EVENT_SHOOTING_START and event.initiator == Unit.getByName('UZI 11') then trigger.action.setUserFlag('200', true) end end world.addEventHandler(Handler) Make sure to change the UZI 11 above to whatever your UNIT Name is. So you could have whenever flag 200 is true, AND the player is within a zone, something will happen. Edited September 4, 2019 by TheTrooper ----------------------------------------------- Intel® Core™i7 Quad Core Processor i7-6700 (3.4GHz) 8MB Cache | 32GB HyperX FURY DDR4 2133MHz | MSI GeForce RTX 2070 ARMOR 8G |SSD 1TB 970 EVO Plus M.2 Link to comment Share on other sites More sharing options...
Recommended Posts