Change state based on two variables = to true

Aug 27, 2012

Hi everyone,

I have a slide that has two variables (unlocked and unlocked2) and two layers. On the base layer are two hotspots that need to be clicked. When the learner clicks a hotspot it changes the corresponding variable to True.

After a user clicks both hotspots both variables are set to "true".

Now, I want a "next" button I've created to change from a hidden to normal state when both variables are true. However, despite having a trigger that says "Change state of button 1 to normal when unlocked changes on condition unlocked == Equal to True AND unlocked2 == Equal to true, it only works when the hotspot for unlocked is clicked first.

If I reverse the order I can see that both are set to true but the button doesn't appear. What am I missing here? I've attached the slide so you can check it out.

Thanks for any help you can offer!

17 Replies
Annie Jean

Hi Graham,

I have looked at your file and changed a few things.

I have put the trigger on the layers to "When the user clicks the marker".

That way, when the user is done reading the feedback and clicks on it, the variables are looked at to make sure it responds to the trigger conditions.

Hope it helps and don't hesitate to post back if you need further information.

Annie

Annie Jean

Hi Graham,

Since English is not my first language, I will do my best to give you the information I have.

As for why it worked only when clicking unlock first I cannot give you extra info about that but it probably had to do with the action required to activate the trigger (the "When" if you prefer).

Why mine worked? Because of the "When".

The variables are changed directly when an action is completed but they are not validated unless an action tells Storyline to do so (it is not continually validated in real-time).

So what I have done is ask myself, what action should make the next button appear and the way you set your layers just allowed me to add the trigger to the marker since it is the last action done on the slide and it is done after the variable is changed.

Since it was all on the same slide, I had to find an action.

You could have also used states and transparent shape (add a fill with 100 % transparency, not "no fill") to achieve this since you were working all on the same slide.

This is the "beauty" of working with SL, there are many ways to reach your goals.

Hope and helps and don't hesitate if it is not clear of if you need further information.

Have a nice day!

Annie

Phil Mayor

Annie's, advice is as usual correct and good and her English as ever is much better than my French

Just thought I would chime in because I don't think variables in this project are really best practice, you do not leave the slide and because of this it would be best to use States.

You may say that hotspots cannot have states, but i would use a transparent shape and add a visited state, this in my mind is a more elegant design.  During the Beta we were advised to use states instead of variable where possible.

My rule is when navigating through a slide use states and when moving from slide to slide use variables.  Obviously this doesnt always hold but in this example states would be more elegant and would do the job just as well.

Toni Krasnic

@Phil

I tried using the transparent shapes with visited states, but it doesn't work. Please see attached.

What I'm trying to do is have folks go through five different tracks (as shown by different colors on the pyramid) that eventually lead back to the pyramid slide. Only when all five tracks are completed can they move on to the rest of the material.

I'm not sure why it's not working. Thanks for any help you can offer!

Annie Jean

Hi Toni,

I took a look at your file and you don't need any variable since what you are looking at is all on the same slide.

If I had to do it here is what I would do :

 - Show layer False when user clicks the Next Button if shape 1 is not equal to visited, OR shape 2 is not equal to visited, OR shape 3... and so on

- Jump to next slide when user clicks the Next button if shape 1 is equal to visited, AND shape 2 is equal to visited, AND shape 3... and so on.

As for why it doesn't work the way you did it right now it is because you ask the Variable to change according to the state ot the shapes but you are not involving any action in it to tell Storyline to look at the state. You could do it with variable saying

- change VARIABLE when user clicks the Next button if shape 1 is equal to visited, AND shape 2 is equal to visite, AND ... so on!

You really need to involve an action in a trigger in order for it to look at states or other conditions you would have integrated.

Hope it helps, don't hesitate to post back if you need further information.

Annie

Toni Krasnic

Thanks for such a fast response!

@Annie - I did what you instructed but it still doesn't work (see attached), perhaps because there's no state change. Are the hotspots somehow preventing the shapes from changing their state?

I only used the hotspots to have the hand show when user goes over the area. Perhaps I should delete the hotspots and stick with shapes? Thanks.

Graham Fox

Here's what I've learned from this thread and just in general:

  • Remember, Same slide = use states, multiple slides and tracking between those slides = use variables.
  • Don't base a change or check off just the variable changing, it never seems to work. Variable checks need to be tied to mechanics that will change and get checked. Start and end of timelines, opening and closing layers, changing states, clicking something etc.
Annie Jean

Hi Phil,

From what I understood Toni wants to track the visited states of each pyramid sections. Since the states will be looked at when the user clicks the next button and the slide is set to "Resume saved state", even though the triggers take you to another slide instead of layer, it shouldn't have any impact on the conditions defined.

Do I make sense?

Have a nice weekend Phil... it is coming way faster for you than me

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