Jump to content

Trigger conditions - order of processing?


scrapple

Recommended Posts

In what order would the trigger conditions shown below be processed? From what I'm seeing in my mission it seems that the second and third statements are being  AND'ed first, and then the results of that are being OR'ed with the first statement. I intended for the OR condition to be evaluated first. Is there a way to do that? 

 

Trigger conditions.jpg


Edited by scrapple
Link to comment
Share on other sites

Clone the FLAG condition and place one on each of the OR branches

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

5 hours ago, Rudel_chw said:

Clone the FLAG condition and place one on each of the OR branches

Thank you, I will do that. So I guess the general rule when a trigger has multiple conditions is that all of the (implied) AND’s get processed first, then the OR’s. 

Link to comment
Share on other sites

2 minutes ago, scrapple said:

Thank you, I will do that. So I guess the general rule when a trigger has multiple conditions is that all of the (implied) AND’s get processed first, then the OR’s. 

No, it should be processed top down. First it checks If Unit 1 is in Zone then it checks again if Unit 2 is in Zone, so basically the AND Flag is true is irrelevant, as soon as Unit 1 is in Zone. That condition will trigger the action no matter the state of the flag.

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

1 hour ago, shagrat said:

No, it should be processed top down. First it checks If Unit 1 is in Zone then it checks again if Unit 2 is in Zone, so basically the AND Flag is true is irrelevant, as soon as Unit 1 is in Zone. That condition will trigger the action no matter the state of the flag.

 

Are you sure about this? The DCS 2020 Manual says:

 

"When multiple trigger conditions are set, they operate with an "AND" operator. In other words,
all of the conditions must be true for the trigger to be activated."

 

So, the flag being True or not is very relevant.

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

1 hour ago, Rudel_chw said:

 

Are you sure about this? The DCS 2020 Manual says:

 

"When multiple trigger conditions are set, they operate with an "AND" operator. In other words,
all of the conditions must be true for the trigger to be activated."

 

So, the flag being True or not is very relevant.

You misunderstood, if the first unit is in the Zone the trigger is already activated, so only if the first unit is not in Zone the flag is true becomes relevant. All conditions separated by an OR need to check each condition again, combined by AND, so (Unit1 in Zone AND Flag true) OR (Unit2 in Zone AND Flag true) is required if I interpreted the intent correctly.

 

In the example the Flag true condition is not relevant for Unit1.

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

2 hours ago, shagrat said:

All conditions separated by an OR need to check each condition again, combined by AND, so (Unit1 in Zone AND Flag true) OR (Unit2 in Zone AND Flag true) is required if I interpreted the intent correctly.

 

Rudel's proposed solution is pictured below, which I think is the same as what you are saying. Although, it does seem to me that this an example of the ANDs being evaluated before the OR, rather than a strict top to bottom evaluation. I don't know if that holds true in general. Maybe we need the ability to add parentheses in the Condition field to force the evaluation order we want. 😀 Thank you all for your help!

Trigger conditions-2.jpg

  • Like 1
Link to comment
Share on other sites

40 minutes ago, scrapple said:

 

Rudel's proposed solution is pictured below, which I think is the same as what you are saying. Although, it does seem to me that this an example of the ANDs being evaluated before the OR, rather than a strict top to bottom evaluation. I don't know if that holds true in general. Maybe we need the ability to add parentheses in the Condition field to force the evaluation order we want. 😀 Thank you all for your help!

Trigger conditions-2.jpg

Top down still applies. All conditions in the list are AND, until you group them into an OR. AFAIK it would check condition 1 than 2 until it finds an OR then evaluate for all conditions until now are true and execute the action, if the result of any condition is false it continues after the OR and checks all conditions in the next block until there is another OR or end of the condition block.

Stupid me, totally missed Rudel's first post. Yes of course that is the exact same what I meant. 😄


Edited by shagrat
Auto correct corrected
  • Like 1

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

38 minutes ago, scrapple said:

...  Maybe we need the ability to add parentheses in the Condition field to force the evaluation order we want. ..

 

 

I'm already used to this pre-defined order, where the AND is implicit and is evaluated first, so I don't really miss the parentheses 🙂

 

... but I would love it, if ED added a NOT checkbox that allowed us to have the condition be true if it is not true .. currently I need to use two trigger statements for this:

 

- One to test for Condition = True, then set a Flag.

- Test if Flag is False then do whatever I needed to do if the Condition was False.

 

But all in all I'm quite pleased with this trigger language, it is in fact one of DCS most useful features ... I know that LUA Scripting is more powerful, but too close to traditional object programming ... I'd rather be flying than doing LUA scripting 😄

 

Best regards

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...