Using "and" "or" conditions on variables
Sep 27, 2012
Hi everybody!
Little trouble: I'm trying to make a button show when different conditions are met.
At the bottom of this link http://storylineauthors.com/?p=655 it's written:
" it says “show conditions” [...] Here you can add a condition. A condition means that this trigger
will only fire if this condition is met. Conditions can be set, based
on a variable, an object or a window. You can also add multiple
conditions to one trigger. These conditions can be combined using AND
(meaning all conditions must apply) or OR (where one or another
condition must apply) commands."
I tried to manage with the show conditions options, but I'm not sure I can understand the syntax, as it may be called.
Can anyone help? Maybe providing a good screenshot?
Grazie!
12 Replies
I wrote that I think
AND and Or only show when you have more than one condition, it can be set to AND or OR
Not sure what you are trying to achieve, any more information
Hey, Mauro!
Using the "AND" and "OR" can have to very different usages.
Let's say I have a form that asks for your age, gender, and country. When the user hits sumbit, I'd like a layer saying you are eligible if you are 35, Female, and live in India. If you aren't all of those things, I want a layer that pops up saying you're not eligible.
So, I would create a trigger (show layer>eligible) with the conditions:
With these AND conditions, the layer will only show up if all conditions are met.
Next, I'd create a trigger (show layer>noteligible) with the conditions:
With these OR conditions, the layer will show up if any of the conditions are not met. Therefore, if the user is 35 and from india but is a male, it will still come up as not eligible.
I hope that helps!
I've got 4 different layers.
I want the user to listen to all of the audio files in all layers.
Only in that case, next and previous buttons are shown.
Here's what I've done:
I've created a variable "time" and every time a layer's audio complete it increases by one.
So, if the user checks all four layers, he can advance.
Here's the problem:
It works, but if the user clicks four times on the same layer (let's suppose it's a difficult topic) the next and previous buttons are shown anyway!
You could make a variable for each layer and set the requirement to 1. That way each of the requirements must be fullfilled. Use the AND condition when setting the four conditions (xxVariable == 1) under the trigger that shows the next button.
Instead of adding 1 to the variable assign a value, e.g. assign 1 on layer 1, 2 on layer 2 etc
Remember to reset the variable on the final next button if you want the user to be able to revisit the content
If you are using buttons to access the layers it would be better to use the visited state of the button instead as conditions can be based on object states
This is probably better practice than using a variable in this case
Thank you Matthew!
I can deal very well with the and/or logic, I've spent years scripting here and there.
My problem is how to say that to Storyline, since it has no script editor.
Which variable has to be put in the Variable field?
And which one in the "On condition" field?
Its not really good practice to use variables for a single slide unless there are really good reasons.
Variables should be used for moving data between slides.
You could also have an off slide object that changes state based on the slides viewed. Really dont think you need any variables in this case
In that case your variable would be both the variable that changes and the condition (what value is it)
Ok, thanks Phil, I think I've misunderstood the trigger wizard.
Now I try with the visited state method
Agree with Phil here. This should work easily with visited state on the Next button.
It works!
By the way, I tried a few days ago the very same thing.
It didn't work because I set as trigger condition "when media completes" in order to bond it to the layer's audio.
This time I tried with "when timeline ends" and it works!
Thanks
This discussion is closed. You can start a new discussion or contact Articulate Support.