Forum Discussion

MichaelCarlino-'s avatar
MichaelCarlino-
Community Member
2 months ago

Looping States using number variable and button trigger.

Hello all so here is what I am trying to do.  I have a variable X that is a number value.  I have a layer that has a list of names and as the value of variable goes up or down it changes name.  When it hits the limit of course it will to the beginning or end.  This all works fine.  This list also has what I will call group headers. Like ABC, DEF is part of the list and gets highlighted as the numbers go up and down. The issue I have is that you can push another button that jumps to each header when you click up and down.  So I have set up triggers to say when you hit the right arrow change variable x to 1o if x is one. And then when it gets to the last header when you press the right arrow button it's supposed to jump back to the top.  So let's say the last number is 30.  So the trigger is to change x to 1 when the right arrow is pressed if x = 30.  Well, what happens when they push the right button when x is 30 it's supposed to go to 1 but goes to 1o instead.  I have tried playing with the trigger stack and can't get it to do what I want. 

 

Any thoughts on how to make this work right I have attached my storyline file to see what I have setup 

  • Good call to attach  the .story file. That helps a lot.

    Unfortunately, I am in a spot where I won’t have access to SL until tonight, but maybe I can make a guess that will get you moving again.

    Remember that when there are several actions that share the same initiator (like when arrow is pressed), when that initiator occurs, all of those actions are implemented (depending on any conditions they may have individually). They are processed in order, and without regard to whether  any previous action has or has not met its conditions.

    So the first thing you need to check is that the triggers are fired on arrow push. and not a variable change. That would cause them to never stop changing.

    The second thing is to be sure the “1 changes to 10” trigger is in the list before the “30 changes to 1” trigger, because they are processed in the order they are on the list. If “change 30 to 1” is first, then when it reaches “change 1 to 10”, it would respond exactly the way you describe.

    There are other problems that could cause that same behavior, but I’d have to look at the innards to know.

    • MichaelCarlino-'s avatar
      MichaelCarlino-
      Community Member

      Thanks for the suggestions Walt.  I have looked at the order of the triggers and all seem to be good.  

  • Thanks Walt, that worked.  I was wondering if a true/false trigger would need to be added