Cruachan Posted December 19, 2017 Share Posted December 19, 2017 Hello All, I've really tried to search and find a way to do this, but I haven't had any luck. I'm creating a CAS mission that is being played very close to the border. When you approach the border you'll get a warning from ATC or AWACS that you are dangerously close... if you cross the border, I'd like to begin AAA or flak around the aircraft which may or may not damage you. In this mission, being aware of the border is a big deal. The Open Conflict server used to do just this... Mirknir created a script if you flew too close to the enemy spawn, suddenly you'd have flak all around you that you might be able to avoid. Here is the post where he discusses that: Protected Zones: https://forums.eagle.ru/showthread.php?p=2492777&highlight=flak#post2492777 I tried doing something like this on my own, but my solution didn't work when flying too high etc... Does anyone have an idea how I might be able to do this? I would really love to pull this off, but in lieu of this approach, at least I can spawn a flight of Migs to do an intercept. Also, I'll ask Mirknir later too after he's had more time off. I'm not exactly sure what the culture is of sharing such scripting gold ;) Cheers, -Cru Link to comment Share on other sites More sharing options...
Cruachan Posted December 19, 2017 Author Share Posted December 19, 2017 Ahh, found a video tutorial talking about this topic: With that said, I think I'd like to use a polygon region for the trigger, but at least now I've got the clue I was looking for... this, plus I think I see how to generate an explosion in space... which possibly I could script to go off on some random value relative to the plane's location. With that said, I think most of that work has been done in the above video. Cheers, -Cru Link to comment Share on other sites More sharing options...
Sedlo Posted December 19, 2017 Share Posted December 19, 2017 Just in terms of making a polygon zone, I finally put the pieces together last week to figure it out. Not sure if you've got it down yet or not, but this is what ya gotta do... Load the mist_4_3_74.lua file into the mission a second or two after mission start. In my case, at mission start, Flag 1 is on. I load MIST into it with "time since flag" = 1 second. Create a unit and create a polygon outlining the zone you want and give it a distinctive name (in my case it's R4808POLY2MILES) Set this unit to late activation. Create the unit you want to violate that zone. In my example, it's DODGE11 Load the zonepolygon script into the mission with a "time since flag". The 900 in my example is the number of the flag that becomes active when DODGE11 violates the polygon. You can set this to whatever number you want. mist.flagFunc.units_in_polygon{ units={'[g][color="Red"]DODGE11[/color]'}, --unit names zone=mist.getGroupPoints('[color="Magenta"]R4808POLY2MILES[/color]'), flag=[color="Lime"]900[/color], interval=20, } Then when your flag is active, you can start your FLAK script. Again, you may already know this, but it's fairly new to me :-) My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
Sedlo Posted December 19, 2017 Share Posted December 19, 2017 I should also point out, I got a lot of help on these forums! I'm just a little dense when it comes to this kind of stuff :-) My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
Destroyer37 Posted December 20, 2017 Share Posted December 20, 2017 Just in terms of making a polygon zone, I finally put the pieces together last week to figure it out. Not sure if you've got it down yet or not, but this is what ya gotta do... Load the mist_4_3_74.lua file into the mission a second or two after mission start. In my case, at mission start, Flag 1 is on. I load MIST into it with "time since flag" = 1 second. Create a unit and create a polygon outlining the zone you want and give it a distinctive name (in my case it's R4808POLY2MILES) Set this unit to late activation. Create the unit you want to violate that zone. In my example, it's DODGE11 Load the zonepolygon script into the mission with a "time since flag". The 900 in my example is the number of the flag that becomes active when DODGE11 violates the polygon. You can set this to whatever number you want. mist.flagFunc.units_in_polygon{ units={'[g][color="Red"]DODGE11[/color]'}, --unit names zone=mist.getGroupPoints('[color="Magenta"]R4808POLY2MILES[/color]'), flag=[color="Lime"]900[/color], interval=20, } Then when your flag is active, you can start your FLAK script. Again, you may already know this, but it's fairly new to me :-) In response to your polygon zone, is that a feature inside of mist or inside of the ME? Specs:Fractal Design Define R5 Black, ASUS ROG Strix Z370-E, Intel Core i5-8600K Coffee Lake @ 5.1 GHz, MSI GeForce GTX 1080ti 11GB 352-Bit GDDR5X, Corsair H110i, G.Skill TridentZ 32GB (2x16GB), Samsung 960 Evo M.2 500GB SSD Link to comment Share on other sites More sharing options...
Sedlo Posted December 20, 2017 Share Posted December 20, 2017 It's a MIST script that you run via the mission editor. I'm not all that technical on how it works, just it does! :-) My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
Cruachan Posted December 20, 2017 Author Share Posted December 20, 2017 Woot! Sedlo, your image where you draw the poly is the last thing I was trying to figure out. I totally get that ;) Destroyer, the ability to detect intrusion into the polygon is a feature of Mist. In my case... the mission is danger-close to the border, which is a no fly zone. Drawing a poly around the border is way better. I've got it working now so that if you stray a bit too far, you get lit up. But, I haven't done it with the polys yet... that's coming now ;) Cheers! Link to comment Share on other sites More sharing options...
Kiptanoi Posted April 23, 2020 Share Posted April 23, 2020 Just in terms of making a polygon zone, I finally put the pieces together last week to figure it out. Not sure if you've got it down yet or not, but this is what ya gotta do... Load the mist_4_3_74.lua file into the mission a second or two after mission start. In my case, at mission start, Flag 1 is on. I load MIST into it with "time since flag" = 1 second. Create a unit and create a polygon outlining the zone you want and give it a distinctive name (in my case it's R4808POLY2MILES) Set this unit to late activation. Create the unit you want to violate that zone. In my example, it's DODGE11 Load the zonepolygon script into the mission with a "time since flag". The 900 in my example is the number of the flag that becomes active when DODGE11 violates the polygon. You can set this to whatever number you want. mist.flagFunc.units_in_polygon{ units={'[g][color="Red"]DODGE11[/color]'}, --unit names zone=mist.getGroupPoints('[color="Magenta"]R4808POLY2MILES[/color]'), flag=[color="Lime"]900[/color], interval=20, } Then when your flag is active, you can start your FLAK script. Again, you may already know this, but it's fairly new to me :-) Thanks for this..... The code worked fine, and I got flag 900 as true when my unit enter the zone.... But how to make the flag to false when I turn around and fly outside the zone? Could I add a else in the code or something? And what does: interval=20 do? Link to comment Share on other sites More sharing options...
xXMustangXx Posted April 24, 2020 Share Posted April 24, 2020 Thanks for this..... The code worked fine, and I got flag 900 as true when my unit enter the zone.... But how to make the flag to false when I turn around and fly outside the zone? Could I add a else in the code or something? And what does: interval=20 do? Add: toggle=True underneath interval=20 Link to comment Share on other sites More sharing options...
Phantom_Mark Posted April 24, 2020 Share Posted April 24, 2020 I just used regular trigger zones all linked into a master rule set , in my example I have an outer buffer zone down the Iranian coast , if you enter that the AI cold start, take off and then intercept and escort you, and you also receive ATC warnings etc, After several warnings the ATC issues a final warning then the escort issues a warning then they go hot if you haven't left.........I also have an inner zone where the ground defences go hot instantly.......all using no LUA or scripts etc. Been a lot of work but I want to do everything without scripts, because scripts seem to have a habit of breaking in my experience of DCS, due to updates. Link to comment Share on other sites More sharing options...
Phantom_Mark Posted April 25, 2020 Share Posted April 25, 2020 (edited) Just in terms of making a polygon zone, I finally put the pieces together last week to figure it out. Not sure if you've got it down yet or not, but this is what ya gotta do... Load the mist_4_3_74.lua file into the mission a second or two after mission start. In my case, at mission start, Flag 1 is on. I load MIST into it with "time since flag" = 1 second. Create a unit and create a polygon outlining the zone you want and give it a distinctive name (in my case it's R4808POLY2MILES) Set this unit to late activation. Create the unit you want to violate that zone. In my example, it's DODGE11 Load the zonepolygon script into the mission with a "time since flag". The 900 in my example is the number of the flag that becomes active when DODGE11 violates the polygon. You can set this to whatever number you want. mist.flagFunc.units_in_polygon{ units={'[g][color="Red"]DODGE11[/color]'}, --unit names zone=mist.getGroupPoints('[color="Magenta"]R4808POLY2MILES[/color]'), flag=[color="Lime"]900[/color], interval=20, } Then when your flag is active, you can start your FLAK script. Again, you may already know this, but it's fairly new to me :-) What would you replace DODGE11 with , if you wanted to make it a group or coalition ? replace units with "groups" ? what about sides ? Edited April 25, 2020 by Phantom_Mark Link to comment Share on other sites More sharing options...
Sedlo Posted April 25, 2020 Share Posted April 25, 2020 This works with Units, not groups or coalitions. You'd have to check into MIST or MOOSE documentation for that, I'm not sure how to do it. My Youtube Channel MY DCS MISSIONS Link to comment Share on other sites More sharing options...
Phantom_Mark Posted April 25, 2020 Share Posted April 25, 2020 Ok thanks pal :) Link to comment Share on other sites More sharing options...
Recommended Posts