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
Matthew Graham

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:

  • ageSubmit == 35
  • AND genderSubmit == Female
  • AND countrySubmit == India

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:

  • ageSubmit != 35
  • OR genderSubmit != Female
  • OR countrySubmit != India

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!

Mauro Gaiotto

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!

Mauro Gaiotto

Matthew Graham said:

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:

  • ageSubmit == 35
  • AND genderSubmit == Female
  • AND countrySubmit == India

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:

  • ageSubmit != 35
  • OR genderSubmit != Female
  • OR countrySubmit != India

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!


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?

This discussion is closed. You can start a new discussion or contact Articulate Support.