Aginor Posted August 12, 2011 Posted August 12, 2011 (edited) Hi there! I'm trying to build triggers in order to remove groups from the mission after they have landed. First I just let them vanish after a certain time, which works, but I have to know the time the units will be in their hangars, and if something delays their landing, they even disappear in flight, which doesn't look good. So I did the following (test scenario is just two F16 in flight, coming in for landing): Units are called Unit1 and Unit2, the group is named Group1 Trigger 1: When Unit1 Speed is below 1 and when Unit2 Speed is below 1 then set Flag1 Trigger 2: When Unit1 Speed is above 0 or when Unit2 Speed is above 0 then clear Flag1 Trigger 3: When Flag1 is true deactivate Group1 As you can see the flag1 is set when both units aren't moving at the same time and the flag1 is cleared when at least one of them is moving. This works, but it has at least two obvious flaw: - I have to set another condition to make sure the flight is not removed at mission start or while holding short waiting to takeoff. That's the simple part, I would set the time near the ETA of the flight at the airfield. - When the units have landed and are taxiing to their hangar there is the possibility that they have to wait for something and will thus disappear on the taxiway. To avoid the second problem I have tried to do the following: I added "TIME SINCE FLAG" with 120 seconds to Trigger 3, so the group will be deactivated once both units have stopped moving for 120 seconds. However this does not work. So either I'm using the command wrong or something is buggy. Is that a bug and/or does someone have a solution for that? Edited August 12, 2011 by Aginor DCSW weapons cheat sheet speed cheat sheet
Sleem Posted August 12, 2011 Posted August 12, 2011 I am not certain but I think time since flag is really time since flag set, not cleared.
Aginor Posted August 12, 2011 Author Posted August 12, 2011 well that's ok because the deactivation of the group should occur when the flag is set. At the moment I am trying to set the flags a bit different, I'm debugging my script using signal flares. Looks funny but works (or is there a possibility to see the flags, a debug mode of some sort?) I think the timer has a problem with clearing a flag. Maybe it does not know which time to use if there is more than one event setting the flag to true. I'm trying now to either use numeric values or to use another flag to trigger additional actions. I'm also trying the ONCE vs. CONTINUOUS attributes of the trigger. Btw: Does anybody know what FRONT CONDITION is? I can't find it in the manual. DCSW weapons cheat sheet speed cheat sheet
Grimes Posted August 12, 2011 Posted August 12, 2011 It sounds like it should work, as long as you are using Switched Conditions at least. Using Once or continous would essentially break it. You can clear and reuse a flag as many times as you want. Time since flag can also be reused, the timer is reset/stopped to zero whenever you clear the flag it is associated with. Where is Front Condition listed at? An alternative method would be to use "Part of Group in Zone" with the zone being the end of the runway. Simply set a flag to be true. Once>Tme since flag is 5 minutes> Deactivate Group You are simply giving the AI a set period of time to land and taxi to parking, then you turn em off. I'd recommend this method if you can't get the other way to work. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Aginor Posted August 12, 2011 Author Posted August 12, 2011 (edited) Hi again! I think I figured it out. I just forgot something stupid, but then I thought about it and it makes sense. I'm writing in pseudo-code now, I think you will understand it. If not I can write it like it looks in the game. ************************ Trigger 1: Continuous IF Unit1 Speed is below 1 AND IF Unit2 Speed is below 1 AND IF Flag1 is false THEN set Flag1 I have to check that the Flag is false before doing anything, otherwise the event will fire all the time and reset the timer, so it will never reach 300 seconds. Trigger 2: Continuous ( IF Unit1 Speed is above 0 AND IF Flag 1 is true ) OR ( IF Unit2 Speed is above 0 AND Flag1 is true ) THEN clear Flag1 There are no brackets ingame but I figured out that it works this way. Therefore you have to have "AND Flag1 is true" twice, accompanying both of the expressions before and after the OR Trigger 3: Once IF Flag1 is true AND mission time is after XXXX seconds AND time since Flag1 was set is 300 THEN deactivate Group1 ************************* Known bugs: When time XXXX has already passed and there is a problem while taxiing - for example a "traffic jam" for more than 300 seconds - the planes will disappear on the taxiway. This can be good though, I had sometimes units standing there facing each other for hours.... Where is Front Condition listed at?FRONT CONDITION is listed in the same field as ONCE, CONTINOUS and MISSION START. Edited August 12, 2011 by Aginor DCSW weapons cheat sheet speed cheat sheet
Grimes Posted August 12, 2011 Posted August 12, 2011 Are you using Black Shark? Because switched condition was known as front condition up till the FC2 release I think. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
LostOblivion Posted August 12, 2011 Posted August 12, 2011 Yeah, why the heck did ED revert to calling switched conditions to front conditions in DCSW 1.1.0.9? It makes more sense calling it switched conditions... Nice plane on that gun... OS764 P930@4 MBUD3R M6GB G5870 SSDX25 CAntec1200 HTMHW
Grimes Posted August 12, 2011 Posted August 12, 2011 Lol, I guess my game didn't patch 100% correct as its still called Switch Condition. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Aginor Posted August 13, 2011 Author Posted August 13, 2011 (edited) Ok, so front condition means switch condition. (Im using A10 1.1.0.9) But what does it do and how is it used? EDIT: Nevermind, I found it in the manual. It basically does what I did manually it seems :D Edited August 13, 2011 by Aginor DCSW weapons cheat sheet speed cheat sheet
Recommended Posts