Variable not triggering state change

I've built a branched interaction where by at the end the learner is (supposed to be) shown the route they have taken. 

To trigger this, i have used number variables,conditions and states. The button clicked determines a value and  then the value then should determine the state change of a particular state on a later slide. 

However, It's not doing that. The variable is working as i'm checking using %----% but it will not change the state. (I've also moved the variables to the top of the trigger panel)

Anyone any ideas where i'm going wrong?

72 Replies
Phil Mayor

Tracy Parish said:

I thought I was getting to what you needed in my story file.  The first slide they pick a button to set a variable.  The second slide uses that variable to determine which oval is changed to Normal.


Never looked at your file Tracey and I expect it works the same as mine, I think Howie is just not "seeing"the solution because he has been working on it for so long.

I often find it easier to send to someone else at this point or go and do something less boring instead (normally beer).

howard pearson

Phil Mayor said:

Tracy Parish said:

I thought I was getting to what you needed in my story file.  The first slide they pick a button to set a variable.  The second slide uses that variable to determine which oval is changed to Normal.


Never looked at your file Tracey and I expect it works the same as mine, I think Howie is just not "seeing"the solution because he has been working on it for so long.

I often find it easier to send to someone else at this point or go and do something less boring instead (normally beer).


You're probably right. I can't share publicly but how do i share with individuals?

Sarah Spence

Did this get sorted? I am having the same problem with shapes not changing state. I have that they need to change state when the timeline starts if a certain variable is True. The variables are set to true in other scenes. The variables are definitely changing correctly as I've tested that on screen.

Can anyone help?

Thanks

Sarah Spence

Aha Eureka, I figured it out! In the triggers, I had left the 'on object' set to the object I was trying to change the state of. Because of the 'when timeline ends', I needed to set it to 'on object' [slide name].

I hope this helps anyone else with the same issue. How could I not have seen this earlier...

Sarah Spence

Hi Nancy, most are on the timeline from start to finish. Another isn't. But everything is working as it should now that I sorted my triggers to read correctly.

I realise that my Eureka post above needs to be modified ('on object' should read 'object' - I mean the final line above 'On condition'):

Aha Eureka, I figured it out! In the triggers, I had left the 'object' set to the object I was trying to change the state of. Because of the 'when timeline ends', I needed to set it to 'object' [slide name].

Nancy Woinoski

Sarah Spence said:

Hi Nancy, most are on the timeline from start to finish. Another isn't. But everything is working as it should now that I sorted my triggers to read correctly.

I realise that my Eureka post above needs to be modified ('on object' should read 'object' - I mean the final line above 'On condition'):

Aha Eureka, I figured it out! In the triggers, I had left the 'object' set to the object I was trying to change the state of. Because of the 'when timeline ends', I needed to set it to 'object' [slide name].


Great news Sarah. I'm so glad you got it working.

Helene Caura

Hi Sarah

I thought your eureka would be mine too, but it doesn't work.

I have done this many times in the past, and I don't know why it's not working.

I have a variable that becomes TRUE when the timeline starts on layer 5 of slide 3:

Variable changed in layer

and then it should change the state of a text box in the menu (slide 1) to "Done", but it doesn't:

Variable to change state of text box on menu screen

Any idea? I can't think of anything. I changed the settings of the slides to "resume saved state" or "automatically decide", but it doesn't work. Thanks in advance for your help.

Helene Caura

Hi Walt

Here you are. I removed all the text and screenshots. If you click the second block, for example Introduction, then from there move to Overview Tab, click all the layer and go back to the menu, you should see Overview Tab has changed its state to "Done". It's a Storyline 2 file, from a SL1 file.

Thank you in advance for your assistance.

Walt Hamilton

I don't believe it, but I got it to work by deleting the trigger that shows a layer:

Maybe because of the unassigned states in the conditions of this trigger, it caused timing issues.

Anyway, when I deleted this trigger, the Overview Tab changed to Done.

As a side note, I mistakenly started working on the little checkmark for that whole box (Textbox 24), and it wouldn't work until I moved it from the Textbox to the slide.

Holly MacDonald

I'm having a similar issue. I have the a slide set with a number variable. I have "add value" to the variable when each of the 3 buttons that show a layer is clicked, and then the previous button has a trigger to jump to a different slide when the variable is greater than or equal to 3. It works, but when I create a trigger that has the previous button hidden or disabled when the timeline starts if the variable is "0", and another trigger that changes the state of the previous button to normal when it is equal to 3, it does not change state to normal, so the slide becomes locked. I have inserted a reference to the variable and it is counting. When the state change is removed, the slide works as designed. When I add the state change it does not.

No state change:

Add the state change triggers

Am I doing something wrong with the state change? I can't see how but maybe I'm just blind to it. Any advice? I've been pulling my hair out on this!

Holly

Michael Hinze
Holly MacDonald

I'm having a similar issue. I have the a slide set with a number variable. I have "add value" to the variable when each of the 3 buttons that show a layer is clicked, and then the previous button has a trigger to jump to a different slide when the variable is greater than or equal to 3. It works, but when I create a trigger that has the previous button hidden or disabled when the timeline starts if the variable is "0", and another trigger that changes the state of the previous button to normal when it is equal to 3, it does not change state to normal, so the slide becomes locked. I have inserted a reference to the variable and it is counting. When the state change is removed, the slide works as designed. When I add the state change it does not.

No state change:

Add the state change triggers

Am I doing something wrong with the state change? I can't see how but maybe I'm just blind to it. Any advice? I've been pulling my hair out on this!

Holly

Are the slide properties set to 'Reset to initial state'?

Wendy Farmer

Hey Holly

In your case you have a base layer with 3 layers.  When the user goes to a layer and then comes back to the base layer the timeline doesn't restart so using that trigger in specific cases won't work.

Try adding the change to triggers on every layer.  In this case SL will check the variable at layer stage and won't execute until the layer where the 7_3 is visited variable = 3.

If that doesn't work can you share your .story file, happy to take a look for you.

Holly MacDonald

Thanks Wendy - I've just tried it and it didn't work. I also adjusted the slide properties to reset to initial state as Michael suggested. No luck there either.

The variable counts (it adds the value each time the button is clicked) and it locks the previous button correctly UNTIL I add the state change with the previous button. As soon as I added that, the button won't change state, but the trigger to adjust the variable works fine. 

I've reached out to support as I can't share the file. Thanks for your offer of help!