Variable not triggering state change

Jun 18, 2014

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
Jenny Carter

Hi Howie,

Sounds like a neat interaction.

I've worked a lot with variables and states and what I've noticed that if you have too much going on - sometimes they seem to get "confused".

I'm not sure if I completely understand your scenario, but is there a way you can simplify it?

Also, on the "later slide" you refer to, is the graphic and state on that slide?  Do you have it as a separate layer?  Maybe it's just not recognizing it.

Do you have a sample you can post? 

Howie Pearson

Above are two screenshots. This is the same slide but i thought it'd be clear if i used 2.  The variables are number variables.

All the ovals have states which are all hidden. Depending on the route taken through the scene the states of the ovals should change depending on the route they take. If they take a good route the variable scores at 1 point, Average 2 and bad 3 at each stage. That will then determine which oval appears. There are connector lines built into each oval state and the purpose of which are to link to the last part of the journey. 

Michael Hinze

I'm taking a guess here that your variables, e.g. Initial Response and Loss are changed n previous screens BEFORE you arrive at this screen. In that case, the triggers would not work because the 'When Variablexyz changes' option is limited to the screen where the variable is changed. Try setting your triggers to 'When timeline starts'.

Tracy Parish

Howie:

Do it this way.  Change the state of the ovals when the timeline starts if the variable is equal to X.  

Rather then if the variable has changed....change the state.  (It's almost as if there isn't a "when to do this" in your version).  In mind it's triggered "WHEN" the timeline starts I want the ovals to appear as......

Howie Pearson

Michael Hinze said:

I'm taking a guess here that your variables, e.g. Initial Response and Loss are changed n previous screens BEFORE you arrive at this screen. In that case, the triggers would not work because the 'When Variablexyz changes' option is limited to the screen where the variable is changed. Try setting your triggers to 'When timeline starts'.


That's right Michael. When they choose the option, the variable is only adjusted by clicking on the next button on the feedback slide for that choice. 

I've tried your suggestion but unfortunately that doesn't work either

Howie Pearson

Tracy Parish said:

Follow the way the first trigger is set up in my picture above.  (I messed up the other 2 as well).

Here it is fixed up as a file example.


Thanks for that Tracey. That is similar to what i have done. The only difference is that the buttons they choose to adjust the value are on different slides

Howie Pearson

Phil Mayor said:

If the variable changes on other slides then you cannot use a when variable changes trigger as it need to change on that slide.

As Michael suggests you need to use when timeline starts triggers for that slide


Hi Phil.

I'm not sure if I understand. what I have done is to create a number variable and that is given a value when clicking on the button on specific feedback slide. 

Then on the final slide that value comes through in the %text box. The triggers on the final slide then set to change the states on that value.

Are you saying then that all I need to do is change the trigger that allocates the value from the button to timeline starts?

Phil Mayor

To use the when variable changes action, the variable must change on that slide.  If the variable changes on a different slide but you want a layer or state to change/show based on the value of that variable then you need to use the when timeline starts trigger and add a condition for that variable value.

You would need to change the trigger to when timeline starts (make it the slide and not the object) and add a condition for the variable value (you may already have this bit set up.

Howie Pearson

Phil Mayor said:

To use the when variable changes action, the variable must change on that slide.  If the variable changes on a different slide but you want a layer or state to change/show based on the value of that variable then you need to use the when timeline starts trigger and add a condition for that variable value.

You would need to change the trigger to when timeline starts (make it the slide and not the object) and add a condition for the variable value (you may already have this bit set up.


Thanks Phil. I've tried that and that and unfortunately it still doesn't work. 

Howie Pearson

Phil Mayor said:

Hi Howie look at this file I just built for you

Slide 1 shows correct use of when var changes trigger use

Slide 2 shows correct use of on timeline change triggers

You must have something wrong


I can't see what is wrong from what you've shown me. I've changed all of them over to timeline starts from click on the button. The %text box is showing both on the slide and the final slide that it's changing. The variables on the last slide are recognising them at all. 

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