Forum Discussion
Multiple AND and OR conditions in the same trigger
I've run into a scenario when I am implementing a "show layer X" trigger 5 times (with different conditions), when I really should be just using one trigger (with all conditions combined). How does storyline evaluate a trigger with conditions that include both AND and OR statements?
For example :
29 Replies
- GeertDe-RyckeCommunity Member
Hi Alexandro,
What you could do is store the result of your Or condition in a variable with 1 trigger, followed by a second trigger that takes taht variable and applies the AND condition to it
Trigger 1
Or_result = picture 1 OR picture 2
Trigger 2
Show layer = Picture 3 AND Or_result
Hope it helps
Geert
- anoyatisCommunity Member
Hi Geert,
That's exactly what I am trying to avoid (multiple triggers). It works that way, sure, but want to avoid this (there are scenarios where I have to set 5-6 triggers for 6 different elements). 6 triggers instead of 30 would make a difference. - GeertDe-RyckeCommunity Member
Hi Alexandros,
As this is written in c#, I assume it will be evaluate left to right.
Articulate doesn't have the "(" prioritisation, so we can only asume it.
Still using a temporay variable and additional triggers looks more readable for the non-IT person
G.
- JeffSaleCommunity Member
I am trying to do the same thing, I am running into a problem where I cannot even add an "OR" condition on any triggers, because it is always grayed out. Does anyone know why this would happen?
- PhilMayorSuper Hero
Will only work if you have more than one condition
- JeffSaleCommunity Member
Phil to the rescue! Thank you much, Alexandros, I think I figured out a way to do it. What I am doing is creating a dummy variable that is false, using that "And Hide == False" and then adding all of my other "OR" conditions into one trigger. I was going to have to make 15 triggers and now I only need 3
- MikeWohlwendCommunity Member
After trying to make sense of how and's and or's interact when combined into a single trigger, I have gone with Geert's indicated method. It seems that you simply have to break up more complicated functions, which does inflate the number of triggers and the time to create it--but which works!
So Alexandros, in testing my situation over, it seems that the ands and ors combine to break the functionality of the whole thing.
More specifically, I think I saw all elements begin behaving as if they were "or" conditions, regardless of their ordering, etc
- PeterHermanCommunity Member
I can't seem to apply an AND trigger to "Jump to the next slide". I want to jump to the next slide when both the timeline has ended AND the user has clicked Next. Is this possible?
- JustinStaff
Hi, all.
For future Heroes that stumble across this thread, the following Screenr may be useful: