BaD CrC Posted April 16, 2013 Posted April 16, 2013 (edited) Hi Guys, Suppose I write in the ME the following condition: A B [OR] C D [OR] E F How does the ME understands it? 1- (A AND B) OR (C AND D) OR (E AND F) 2- A AND (B OR C) AND (D OR E) AND F 3- (A AND B) OR C AND (D OR E) AND F If answer 2 or 3, then what should I do to have the equation 1- working? Thanks. Edited April 16, 2013 by BaD CrC https://www.blacksharkden.com http://discord.gg/blacksharkden
Grimes Posted April 16, 2013 Posted April 16, 2013 It understands it as the first one. (A AND B) OR (C AND D) OR (E AND F) 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
BaD CrC Posted April 16, 2013 Author Posted April 16, 2013 Great. Thanks a lot Grimes. Would be nice in the future to have those parenthesis available in ME in order to have the possibility to write answers 2 and 3 as well. https://www.blacksharkden.com http://discord.gg/blacksharkden
Grimes Posted April 16, 2013 Posted April 16, 2013 You can do it with lua pretty easily, however it would depend on what exactly you were checking. The only other workaround would be to spread it out over several triggers. For A AND (B OR C) AND (D OR E) AND F Once> B OR C > Flag 1 Increase 1 Once> D or E > Flag Increase 1 Once> Flag 1 = 2 AND A AND F> Do Action For (A AND B) OR C AND (D OR E) AND F Once> D OR E> Flag 1 On Once> C AND F AND Flag 1 True OR A AND B> Do Action 1 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
mjeh Posted April 16, 2013 Posted April 16, 2013 The only other workaround would be to spread it out over several triggers. If I'm not mistaken you can do it with just one trigger aswell. The conditions field won't be pretty and it will take time, but AFAIK it should work. We can use equivalence laws or truth table to do some redux and [OR] the results together. If we go for your example 2, 2- A AND (B OR C) AND (D OR E) AND F which is A ∧ (B ∨ C) ∧ (D ∨ E) ∧ FA and F must always be true, so we can simplify by ignoring them for now, which leaves (B ∨ C) ∧ (D ∨ E) which is what we must test for. Through truth table we see that the following combinations make the expression true; C ∧ E C ∧ D C ∧ D ∧ E B ∧ E B ∧ D B ∧ D ∧ E B ∧ C ∧ E B ∧ C ∧ D B ∧ C ∧ D ∧ E Since we remember A and F must be true we AND in the following to all the subexpressions A ∧ F and now we have all the conditions for which the trigger should fire and we [OR] them together. In the ME it will look like so; A F C E [OR] A F C D [OR] A F C D E [OR] A F B E [OR] A F B D [OR] A F B D E [OR] A F B C E [OR] A F B C D [OR] A F B C D E Now I must admit, my boolean algebra is a bit rusty so maybe there's an easier way. But it should work! Also keep in mind I haven't had my morning coffee yet, so if some error has sneaked its way in there or my logic is false then I apologize and hopefully someone will correct me. :thumbup: Whee, that was fun! 1
Grimes Posted April 16, 2013 Posted April 16, 2013 Don't get me wrong, you certainly can put every possible combination into a trigger condition and it will work. But in this case I think its probably one of those "its not the size that matters its how you use it" scenarios. :) 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
mjeh Posted April 16, 2013 Posted April 16, 2013 Don't get me wrong, you certainly can put every possible combination into a trigger condition and it will work. But in this case I think its probably one of those "its not the size that matters its how you use it" scenarios. :) lol, well put! I agree, my proposed solution certainly wasn't the most elegant one - but it works :megalol:
BaD CrC Posted April 16, 2013 Author Posted April 16, 2013 mjeh, reading your post reminded me my math classes back in university. But this was 20 years ago and my courses notes are probably used by now as compost to feed my parent's garden. Thanks however for the very detailed post and the time you spent to answer. Grimes, yes, good turnaround indeed. Thanks. https://www.blacksharkden.com http://discord.gg/blacksharkden
mjeh Posted April 16, 2013 Posted April 16, 2013 mjeh, reading your post reminded me my math classes back in university. But this was 20 years ago and my courses notes are probably used by now as compost to feed my parent's garden. Thanks however for the very detailed post and the time you spent to answer. My pleasure! I always knew that logic course would be useful one day, I just never imagined it would be in the context of making missions for a flight sim :huh: 1
BaD CrC Posted February 20, 2015 Author Posted February 20, 2015 It understands it as the first one. (A AND B) OR (C AND D) OR (E AND F) Up for this topic. Grimes, now would it work for more than 2 conditions before the [OR]? A B C D [OR] E F G H [OR] I J K L will be understood as (A AND B AND C AND D) OR (E AND F AND G AND H) OR (I AND J AND K AND L) ? Thanks again. https://www.blacksharkden.com http://discord.gg/blacksharkden
Wrecking Crew Posted February 20, 2015 Posted February 20, 2015 My pleasure! I always knew that logic course would be useful one day, I just never imagined it would be in the context of making missions for a flight sim :huh: Best brush up on your geometry, too! :smartass: Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.
Grimes Posted February 20, 2015 Posted February 20, 2015 Your understanding is correct. 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
Recommended Posts