Forum Discussion

JoshWatson's avatar
JoshWatson
Community Member
2 years ago

Sliders and Adjusting Fill States

Help! In this activity I want the audience to slide the, well, sliders as responses to "fill" the coffee cup on the right (hidden shape with various states). I'm able to get the sliders to fill in single increments independently and collectively fill the shape. However if I pull back on the slider (example: move the first one from 4-5 to 0-1) then it continues to fill. What I need it to do is adjust the states based on the amounts--so slide to a lower level and it subtracts from the fill state while still being able to fill if slid forward again. 

Hope that makes sense! All help greatly appreciated. 

    • JoshWatson's avatar
      JoshWatson
      Community Member

      Thank you, Judy! I did see your reply there in my search and it definitely helped a bit, but I’m still struggling with how to translate the concept to a full state. Maybe I’m overthinking it, but the toggling didn’t seem to allow for fill state changes by increments

      • JudyNollet's avatar
        JudyNollet
        Super Hero

        Let me try to clarify.

        Moving any of your sliders should toggle a T/F variable.

        The triggers that change your coffee cup to the appropriate state would run whenever that toggling variable changes.

        In other words, the value of the T/F variable doesn't matter. It just lets the program know that a slider moved, which means the state of the cup has to be changed based on the new set of slider values. 

        If you did it like my example, you would use multiple triggers for changing the state of the cup: one for each possible combination of slider values. (In my demo, the triggers were showing different layers. But the same idea works for showing different states.)

        • Each trigger would have conditions that check for one of the possible combinations of slider values. Thus, the triggers' format would be something like this:

        Change the state of [the cup] to [this state]

        When the [Toggle variable] changes

        If [classes variable] = [this value]

        and [hours variable] = [this value]

        and [responsibility variable] = [this value]

        • Some combinations might result in the same "fill" level of the cup. But since the user can only move one slider at a time, they would see the level go up or down before possibly returning to a given level. 

        Obviously, you need to plan in advance how each combination will "fill" the cup. Refer to that when you're working on the triggers. Having meaningful names for objects, states, and variables will help.

        Alternately, you could this: 

        • Have a number variable to track the sum of the slider values. 
        • When each slider moves, have triggers that do this: 
          • One trigger to set the [Sum variable] to 0. 
          • One trigger to add [classes variable] to [Sum variable]
          • One trigger to add [hours variable] to [Sum variable]
          • One trigger to add [responsibilities variable] to [Sum variable]
          • Multiple triggers that change the state of the cup based on the value of the Sum variable.
    • JudyNollet's avatar
      JudyNollet
      Super Hero

      FYI: You replied while I was updating my previous comment with an alternate programming strategy. So it's a bit different than before -- with an easier method that might work for you. 😄

  • I vote for the alternate method, and here’s a tip that Judy and I both use to create fewer triggers. Place all the triggers she listed on a layer, and set their “When” clause to “When timeline starts on this layer”. put nothing on the layer, set it NOT to hide other layers, set its timeline to .1 sec, and set it to hide itself when its timeline ends. That way, every time you show it, it runs the triggers and shuts down. On the base slide, show the layer when [classes] changes, when [hours] changes, and when [responsibilities] changes.

  • As usual, Walt's advice is golden.  🏆

    Yes, the alternate method is better for the how-much-coffee situation.

    • The original method I was clarifying is based on a situation that uses a different image for each combination of slider values.
    • Since the amount in the coffee cup might be the same for different combinations of slider values, each state with a given level of fill could correlate with the sum of the three slider variables. 

    And, yes, using an invisible layer is a great idea. (I even posted about their power: https://community.articulate.com/discussions/articulate-storyline/tip-the-incredible-power-of-invisible-layers).