Druid_ Posted October 6, 2011 Posted October 6, 2011 (edited) I've had a few questions with reference to the powerful but rarely used mission trigger system in the ME. There are some great things you can do here without resorting to lua. I've included a few examples in a .miz. First what are TRIGGERED ACTIONS? Click on its icon (next to route) and you will see all those actions that are also available at any waypoint. The difference is that these actions are available at anytime through use of 'set rules for triggers' rather than just at a waypoint on the units/groups route. An example ----------- Problem: You want a convoy B to halt when it gets too close to convoy A infront. Solution: Set a moving trigger zone (say 2000) and place near lead unit of convoy B. Click on convoy Bs TRIGGERED ACTIONS icon 1) ADD --> Perform Task/HOLD i.e. a HOLD action for the convoy 2) in CONDITION tick IS USER and increase flag value from default zero to 1 3) in STOP CONDITION tick IS USER and increase flag value to 2 Now in your 'set rules for triggers' add the following SWITCHED CONDITION (convoy A stop)--UNIT IN MOVING ZONE -------- FLAG ON 1, FLAG OFF 2 , AI TASK convoy A / 1. Hold -?/? SWITCHED CONDITION (convoy A go) ---UNIT OUTSIDE MOVING ZONE -- FLAG OFF 1, FLAG ON 2 , AI TASK convoy A / 1. Hold -?/? ---------------------------------------TIME SINCE FLAG 1,10 So now whenever convoy B is within 2000m of convoy A it will stop & will only move off when it's outside 2000m for more than 10 seconds again. Important: always set your flags before you make the AI TASK action, you can if you want, clear them a couple of seconds afterwards if needed(don't do so immediately else you will experience unpredictable results with some task actions). Also for actions with a CONDITION & STOP CONDITION its good practice to set both flags every time you call AI TASK xxxx. In the attached mission I also show how you can control ground units through the F10 radio menu. examples include stop & start a convoy moving, control their ROE. Order Tanks to fire at point North or South of their position. The opportunities are endless. Would you like a follow me vehicle to take you to the runway threshold? then triggered actions and trigger rules with some clever flag handling allow it (got an example if anyones interested).Triggered_Actions_Use.miz Edited October 12, 2011 by Druid_ 3 i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
dooom Posted October 6, 2011 Posted October 6, 2011 Thanks Druid. I began playing with this recently in my effort to get an infantry fight to occur... I still think a wiki or even a heavily monitored thread with examples written just like this post would be awesome. ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 "This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL
HotFish Posted October 8, 2011 Posted October 8, 2011 Druid, first of all, Thank you! Your example is very (means VERY!) helpfull and inspiring. I can easily agree, that detailed ME manual of triggers, triggered actions and advisory examples included would be helpfull and would bring this great sim to new level. The info of using ME triggers, cockpit parameters and arguments should not be "top secret" any more; I hope ED can reveal these tempting features soon. :thumbup: * Asus P8Z68-V * i5-2500k * gtx580 1536MB * 16GB RAM * Corsair Force 3 SSD 120 + 240 GB * Western Digital Caviar Green 1 TB HD * TrackIR 5 & ProClip * BenQG2222HDL @ 1920x1080 * win 10 64bit * Thrustmaster Hotas Warthog * Saitek Pro Flight Combat Rudder Pedals *
JEFX Posted October 8, 2011 Posted October 8, 2011 Hi Druid and thanks for those very inspiring examples… I really believe that ED should have given many more of those examples for us to start mission editing from! I want to ask your help because, even if I have read all the necessary tools in the GUI manual and I have studied your mission in details… there still is one topic that I really want to setup and cannot program it to work the way I dream: Goal : set a CAP group at a WP (say no 1, which is its actual # 0…) and let it wait there doing a circular orbit. Then, assign it some more WPs, say no 2 to the east and no 3 to the west and call upon their help via the F10 menu if one encounters enemy air threat. My goal is to set up a complex randomized mission in which I can meet some surprise air threat and call the friendly CAP to help me, and do it to a specific area (thus the various WPs). I made it this way : New Airplane Group : F-15s, CAO, WP 1 (0) is starting point WP 2 (1) is in the north WP 3 (2) is in the west WP 4 is a last WP since it seems that there needs to be another WP after the one that interests us??? I did assign the following triggered actions (which by the way should be named actions TO BE triggered… : Command : SWITCH WAYPOINT from current to WP 1 (which means 2…)… condition is user FLAG 1 Command : SWITCH WAYPOINT from current to WP 2 (which means 3…)… condition is user FLAG 2 And I made the following triggers: ONCE…Random (100)… Radio Item add (GO TO STP 2)… FLAG 1 ONCE…Random (100)… Radio Item add (GO TO STP32)… FLAG 2 Switched… FLAG is true (1)… AI TASK (new airplane group/switch WP from current to 2) And also action : FLAG OFF (1) Switched… FLAG is true (2)… AI TASK (new airplane group/switch WP from current to 3) And also action : FLAG OFF (2) And it is not working… I even tried to assign the New Airplane Group a SET FREQUENCY command at the start of its flight plan to make sure I call upon its help on the right frequency (but I don’t think that it is a must ???) What am I doing wrong? It is not working.. Thanks JEFX [sIGPIC][/sIGPIC] In DCS I fly jets with thousands of pounds of thrust... In real life I fly a humble Cessna Hawx XP II with 210 HP :D
JEFX Posted October 8, 2011 Posted October 8, 2011 Just to make this clear, guys, I would like to be able to order an Air group to orbit at a certain point and then, when I order it , to have them go to one or the other wp of their flight plan and do a task, and perhaps, order them to stop attacking and go to yet another WP of their Flight plan and orbit there again until I need them again at another Wp, and so on... is that clear? thanks Jean-Francois [sIGPIC][/sIGPIC] In DCS I fly jets with thousands of pounds of thrust... In real life I fly a humble Cessna Hawx XP II with 210 HP :D
Druid_ Posted October 9, 2011 Author Posted October 9, 2011 (edited) SWITCH WAYPOINT is best utilised at a Waypoint for this purpose. However, you can use triggered actions but he will immediately turn towards switched waypoint rather than wait until he has reached the next WP on his route. In fact if you use switch waypoint in triggered actions it says 'switch <current wp> to WPnumber' which is a little different to the waypoint version. I did this in my first mission Op Talisker with a CAP of 2 F15Cs. You are almost there and your thinking is along the correct lines. First select the waypoint you want the CAP to hold at, click add and set an Orbit Hold (circular or race-track) with a STOP CONDITION say flag 9 (you've used 1,2,3 & maybe 4). then, in set rules for triggers SWITCHED CONDITION -- flag 1 ON OR flag 2 ON OR flag 3 ON -- SET FLAG 9 ON so any of your radio calls will firstly allow the aircraft to leave the orbit HOLD then after the Hold command place ALL of your SWITCH WAYPOINT commands. Now an additional problem may exist if you have CAP set as a Perform Task action at waypoint 0 (btw its there by default for CAP aircraft) of your CAP flight because as soon as they identify a threat , off they will go to intercept regardless of your nice code. So delete it! CAP action at WP 0 that is. When they are at the switched waypoint add a CAP action there instead. This means they will head there and only go on CAP once they get there. You could also play around with ROE to make sure. After the waypoint place another with a switched action back to your Orbit waypoint. So once he's dealt with the threat he'll head back there. Lastly place a trigger zone around your CAP orbit and switched condition CAP is outside Zone set flags 1,2,3,4 & 9 to zero again, ready for the next time they get called. You might want to remove the radio items also until he is back in the CAP orbit. Lastly, there is no way that I know of to stop the AI from engaging and do something else once they have started, so you will have to wait until they have finished their task and the list is updated, i.e. they will conduct the next item in the action list. You could also set up an orbit at each switched waypoint but it will make your trigger rules a little more complex, but it is possible. If you get really stuck , I'll whip up an example. Its always best to attempt it first yourself though as it re-enforces the learning process making future forays a little easier. Edited October 9, 2011 by Druid_ i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
JEFX Posted October 9, 2011 Posted October 9, 2011 Thanks Druid for this very detailed and informative answer! There is one thing that I find non logical : it has been said and it is clear that (for a particular group) each WP has its associated actions (such as switch WP) but that TRIGGERED ACTIONS (the button just to the right of the one for the ROUTE in the ME) are actions that are general to the whole flight plan and can be triggered anywhere (and not at a particular WP)... Why is SWITCH WAYPOINT in that list if it cannot happen elsewhere than at a WP? By the way, I understand the logics when you say that it has to be at a WP to switch WP, but I had understood like : abandon whatever you are flying to and GO TO such WP... That does not exist, I understand? thanks I will give it a try when I can in the next few days and report back! [sIGPIC][/sIGPIC] In DCS I fly jets with thousands of pounds of thrust... In real life I fly a humble Cessna Hawx XP II with 210 HP :D
JEFX Posted October 9, 2011 Posted October 9, 2011 (edited) OK I gave it a try this morning and I think I did all what you suggested right, Druid, but... it is not working... The F-15 doesnt leave its orbit upon my F10 command, can you review my .miz file please? EXPERIMENT CAP AND RADIO ITEMS.miz edit: DRUID HAS POSTED A VERSION LOWER IN THE THREAD WITH CORRECTIONS and I have posted myself a version that works also. This one here is bad, and I leave it here so that other people can learn the same way I just did, thanks to DRUID thanks a lot! Edited October 9, 2011 by JEFX [sIGPIC][/sIGPIC] In DCS I fly jets with thousands of pounds of thrust... In real life I fly a humble Cessna Hawx XP II with 210 HP :D
VFA41_Lion Posted October 9, 2011 Posted October 9, 2011 I'd also love a post explaining how to use and what to type in the CONDITION box for start/stop conditions of waypoint actions. :(
JEFX Posted October 9, 2011 Posted October 9, 2011 Hi HPO, I am still struggelling with this one topic (switch waypoint command) but I must say that I cannot suggest enough that you download Druid's example and examine it, it is very inspiring and pedagogical. [sIGPIC][/sIGPIC] In DCS I fly jets with thousands of pounds of thrust... In real life I fly a humble Cessna Hawx XP II with 210 HP :D
Druid_ Posted October 9, 2011 Author Posted October 9, 2011 (edited) JEFX ok I shall list the changes which will hopefully make it easier to follow:- 1) Took out all trigger actions for switched condition & orbit as per my post#6 above they don't work (also agree they shouldn't be selectable from list) 2. Added same switched conditions after orbit action at orbit waypoint 2. 3. Added set flag 9 true -->allows exit from CAP orbit 4. Added search&engage and moved trigger zones slightly, as AI takes a while to respond to spawning units 5. Removed references to flag 4 and removed some redundant flag setting trigger rules. Good effort though. Hopefully will work now. Have a look and let me know if you have trouble following it. See below for 2 examples and some more advice (read mission briefs for written info on mission coding/structure).EXPERIMENT CAP AND RADIO ITEMS.miz Edited October 9, 2011 by Druid_ i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
Druid_ Posted October 9, 2011 Author Posted October 9, 2011 (edited) CAP examples and problems with CAP aircraft. Lets say we have a single F15 on CAP and you set him with a CAP task at a Waypoint (WP). He will search for targets when he gets to CAP WP and on detection will intercept, once he has dealt with ALL targets he detected he will go for the next waypoint or action set under the CAP task. Its a good idea to set the CAP off at some point and there are a few methods to do so. One is to place a WP after the CAP WP and on the stop condition of the CAP task switch it of based on current WP (its at the bottom of the condition list) This won't always work if targets keep popping up whilst he has started his CAP action. ONLY when he can see no more targets will he move onto next waypoint which issues a CAP stop command. So an alternative is on the CAP waypoint stop condition, put in a time limit of your choosing. You can then get rid of the stop CAP waypoint afterwards. Another method is to use ROE weapons Hold in triggered actions which activates based on a condition set in trigger rules. Another favourite method of mine is to use 'Search then engage' & set a max distance, rather than 'CAP'. This is definately more predictable and easier to control than CAP but unfortunately less realistic & sometimes less effective. check out the example mission. cap control cap example The second example miz uses search then engage with a 30nm max distance set and a stop condition of 5 minutes. This way we can spawn all enemy aircraft and the F15 will ignore them as long as his flight path will not pass within 30nm of the enemy within 5 minutes of reaching the search & engage action waypoint. Notice however that you have to place a search then engage at each search waypoint i.e. TGT N, TGT W & TGT S. Also if you want the F15 to go back to an area he has visited previously then you will have to reset any flags that enabled you to do so earlier. check out cap control S&E example EDIT: Search & Engage max distance not working properly, see here . Use search & Engage group or unit instead.CAP control CAP example.mizCAP control S&E example.miz Edited October 11, 2011 by Druid_ i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
Druid_ Posted October 9, 2011 Author Posted October 9, 2011 Finally, for a bit of fun. Ever confused on which way to taxi to the runway? Check this miz outfollowme test.miz i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
JEFX Posted October 9, 2011 Posted October 9, 2011 HOW TO MAKE A CAP ORBIT THAT CAN BE CALLED UPON SEVERAL TIMES TO SEVERAL LOCATIONS I was struggeling with this and I want to thanks DRUID for his help! This is an experiment to use radio commands (F10) to get a CAP aircraft orbiting and waiting for the call to go to a specific area in order to give support. There are 3 areas (N, E, W) and each has a Mig that is triggered when the CAP F-15 approaches (this is just to test the concept) The idea is that in a large mission, with many randomized threats, one could plan a few CAP and SEAD groups orbiting and be called upon for help in predefined areas when necessary. (in this experimental mission, our own Hawg is on the runway, just in order to give the F10 commands) Bear in mind that the CAP aircraft has to finish its hunt AND go through the next waypoint before it will come back automatically tp the Orbit waypoint. In a next step, one should probably have the radio message disappear when the CAP aircraft is not in its safe orbit. EXPERIMENT CAP AND RADIO ITEMS.miz (now it works very nicely) Thanks Druid [sIGPIC][/sIGPIC] In DCS I fly jets with thousands of pounds of thrust... In real life I fly a humble Cessna Hawx XP II with 210 HP :D
JEFX Posted October 9, 2011 Posted October 9, 2011 oops, Druid, while I was fooling around to make it work, I didnt notice that you had replied. Thanks, I will look at it, can you check my new version, I think it is good now and it does work very well, thanks to your help. Jean-Francois [sIGPIC][/sIGPIC] In DCS I fly jets with thousands of pounds of thrust... In real life I fly a humble Cessna Hawx XP II with 210 HP :D
Druid_ Posted October 9, 2011 Author Posted October 9, 2011 (edited) Took a look and all looks good, nice one! By the way, I understand the logics when you say that it has to be at a WP to switch WP, but I had understood like : abandon whatever you are flying to and GO TO such WP... That does not exist, I understand? I may have confused you earlier on this. You CAN use switch waypoint in triggered actions but it does mean you have to have more trigger rules and AI TASK calls as a result. Also the CAP aircraft will not sequence the current WP but will turn immediately towards the switched waypoint. However, there is a bug in DCS patch 09 in that if you issue another AI Task switch waypoint after already having done so without the aircraft having reached a waypoint then DCS will crash. Only 1 problem I see with your miz though and thats the CAP command. You don't deactivate it, so anytime a target appears, even if he's in the CAP orbit, he will head off and intercept/attack. See my previous posts on this. I guess the method you choose will depend on what you are trying to achieve. There is usually more than 1 way to reach a solution, especially when it gets complex. Edited October 10, 2011 by Druid_ DCS crash bug addition. i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
Druid_ Posted October 11, 2011 Author Posted October 11, 2011 Beware of using Switch Waypoint in triggered actions, you could cause DCS to crash. I've submitted a report on this here . Thanks to JEFX I've been digging into this a little more recently. i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
Speed Posted October 11, 2011 Posted October 11, 2011 Beware of using Switch Waypoint in triggered actions, you could cause DCS to crash. I've submitted a report on this here . Thanks to JEFX I've been digging into this a little more recently. Thanks for letting us know about this. In the interim, I suppose it sounds like a switch waypoint Lua function that never CTDs could be possible. Anyway, this is a great guide; triggered actions are under-utilized. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
Druid_ Posted October 13, 2011 Author Posted October 13, 2011 (edited) Hey Speed, I would be interested in a switch waypoint lua function but am hoping to avoid lua as we both know, its not everyone cup of tea. +++--------------- [bUG NOTE] I thought that maybe a better way to utilise a FAC in a moving vehicle would be to place the FAC engage group commands in the Triggered Actions rather than load them up at various waypoints. I thought it would be simple but everytime I loaded the miz up it crashed when the AI TASK engage group commands were triggered. It turns out that when you place an engage group command into triggered actions, you cannot have a Condition (in my case it was a flag set) in the advanced actions for engage group else DCS crashes. Now this isn't a problem and tbh I almost why, since the flag condition can/should just be placed in the trigger rules condition instead. e.g. ONCE -- FLAG 1 ON -- AI TASK <convoyfac /1. FAC ENGAGE GROUP> More testing required on this but I think the message to all here is beware of triggered actions as they can be responsible for a crash (the crash file description isn't much help either). Doesn't mean its not worth using them, just know that they might be the culprit and investigate. Edited October 13, 2011 by Druid_ i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q
Recommended Posts