Sliders and Layers

Mar 21, 2023

I am creating a slider function which will open and navigate through layers. Although this example has dual sliders, that is not the issue, as I've had this same problem on another project with a single slider. Here is a link to the slide with the 10 layers.
The build: When a slider is released, the trigger opens the next layer where there is a separate pair of sliders prepared in the locations where the former layer completed. From locations 0 - .5 - 1 - 1.5 - 2, there are 10 layers of 10 combinations of these numbers. The layer & slide properties say "When Revisiting, reset to initial state"

The example: (True of all layers) When on layer E, the user drags the slider from 1 to 1.5 and that opens layer F. If the user drags the new slider from 1.5 to 1, they DO return to layer E as planned, but...

The problem: When returning to a layer which has already been adjusted by the user, the layer is not reset to initial state; the layer is instead saving the recent/final state of the slider.

The questions: Is there a better way to build the dual-sliders so they won't cross/intersect without needing multiple layers? OR is there a better way to reset the layer to its initial state? OR does "reset to initial state" only work when the slide resets, too? Or am I misunderstanding the idea/plan/concept for "reset to initial state" for layers?
Thank you! Love your product.

7 Replies
Adam Macaluso

To be clear in the example link: If you ever see the "circle with arrows (CWA)", the grey circle should always start on top of that. If you drag/drop the grey circle on top of the CWA, the layer won't change because there is no trigger for it. Only if you drag the circle off of the CWA, the layer will change.

Adam Macaluso

Found a solution provided by Phil Mayor 6 years ago (I promise I looked before I posted)
https://community.articulate.com/discussions/articulate-storyline/resetting-a-slider-interaction-when-a-partipant-revisits-a-slide-layer-they-have-previously-viewed to reset the variables on each layer. This works perfectly although I don't love the need for it (variable initial value being reset to initial state should cover that).
I do leave open my community questions for if there's a better way to do dual-sliders.

Walt Hamilton

Not knowing exactly what you want/need, nor what you took from Phil to use, I will offer a suggestion.

In the first place, when you go from base layer to layer, or layer to layer, and need to preserve a slider's setting, best design practice is to place the slider on the base, and allow it to show through on each layer. That allows you to design once, create once, and the only triggers you need are to show a specific layer when the slider is a specific value. In fact, I'm pretty sure if the slider is on the base, and can be clicked from any layer, all its trigger can be placed on the base. Next best practice  (generally a poor second) is to create sliders on layers, but to have them all refer to the same variable. A lot more work, but if it is needed, at least the sliders behave consistently and predictably.

To answer your question about variables being reset by "Return to initial state", if that were to happen, variables would be worthless. The purpose of variables is to carry information from one spot or time in the project to another. If anything other than you creating triggers could change them, they would not be reliable enough to use. Sliders change, not by states, but to match the value of the variable they reference. They are tied together. If you change the variable, or the slider thumb, the other changes to match it.

Adam Macaluso

Hey Walt, Thank you so much for replying!
First, What I understood from Phil's response is that for each layer I should start with a trigger to set (reset) the variable value to it's "initial" value. That way, returning to the already-visited layer will always reset the slider to it's initial value.
Second, You have a great point about "reset to initial state" shouldn't reset variables. I simply didn't recognize that the "initial" value and the "Variable" value are shared. I imagined that the initial would always be static, and the variable value would be a separate variable. I DO understand how it works, and why, but I didn't expect it until you suggested it.
Third, You have a great point with the base layer slider (in other projects, I usually do smaller layers interacting with the base layer). But unless I'm missing something about how to build/design sliders, it would leave one significant problem. I must forbid the left slider ever crossing over the right slider. So if the left is at value=0, and the right is at value= 0.5, what would prevent the left slider from sliding up above value=0.5 and crossing over the right slider. If there is a way to create that function, then I'd totally prefer that! Potentially making the left slider's "end" value equal to the right slider (minus 0.5). But I don't know if you could use triggers or if-functions to assign the start/end values of the sliders. (unless you know?)
Fourth, Once I see that the variable's "initial" value is a modifiable variable, I'm going to play with the second (generally poor) option. That only makes sense to me now that I understand that the initial value is tied to the variable value. I expect this would function better because the scorm is juggling fewer variables (resetting etc), so it should be smoother to run if it's built/tested well.
Thank you again for your explanations. If it's not clear, I like to deeply use Storyline for all it can do (I don't build 2D interactive powerpoints, I attempt to build deeply interactive software tools).

Walt Hamilton

So is the purpose of the layers only to show the different options of where the sliders can be set? I was envisioning the layers showing additional information based on the setting of the sliders.

As to your third point, that's fairly easy. Build two sliders on top of each other, each with its own variable. Add this trigger: "Set VariableA to VariableB when VariableA changes if VariableA >= VariableB"  and this one: "Set VariableB to VariableA when VariableB changes if VariableB <= VariableA". That will keep them from crossing.

To keep them .5 apart: "Set VariableA to VariableB when VariableA changes if VariableA >= VariableB", "Subtract .5 from VariableA when VariableA changes if VariableA = VariableB"    and these: "Set VariableB to VariableA when VariableB changes if VariableB <= VariableA", "Add .5 to VariableB when VariableB changes if VariableB = VariableA". 

Adam Macaluso

Walt, you are a gentleman and a scholar (and also a Hero). That is a great way to make it function. I will be able to easily replace the layers with the image (covered in blue) on the right instead of the whole-screen-layer. I eagerly look forward to using these 2 triggers.
I never considered those in tandem. Set A to =B (if A>B) then Subtract .5 from A (if A=B). <3