Something breaks when I use Toggle [SOLVED, ish]

Apr 20, 2023

Hey, all,

I was having trouble with the Toggle trigger and have found what seems to be the root of the problem (at least from the user side of Storyline). I looked at some recent forum posts and saw that other people were struggling with the same thing with no solutions, so I kept working through it and managed to find how to deal with it. I’ll start with “how to fix it,” then explain and illustrate what appears to be going on, then how I found it in my use context.

 

Your Problem: Something breaks when I use Toggle.

The Problem: The “Toggle” trigger is wonky for T/F variables.

TL,DR Solution:

Each time you use the Toggle trigger in conjunction with a True/False variable:

  1. Make a new trigger for each variable (don’t copy and paste)
  2. (this is the most important part) Set the variable you’re toggling before you change the Adjust Variable trigger from “set” to “toggle.”

 

Best guess why: The “toggle” trigger is actually two triggers bundled together (the “back” and the “forth”). You can see this when you look at Variables > Use Count before and after you add a Toggle: there are two more uses, not just one. However, the toggle trigger that we interact with only changes the first of the two existing triggers (the “back”), and the second trigger (the “forth”) stays connected to the object it was originally linked to.

Here's a visual rundown, as simplified as possible:

1. Here we have one button, one variable, no triggers, no uses:

One object, one variable, no triggers, no uses

 

2. Adding a standard "adjust variable" trigger to the button and the variable adds one use to the variable (which is how it's supposed to be):

Using the standard Adjust Variable trigger

 

3. But when we switch the Adjust Variable trigger from "Set" to "Toggle," the use count goes up to two ("Toggle" is really two triggers in a trench coat.):

Changing from "set variable" to "toggle variable"

 

4. So now I'm adding a second variable:

Adding a second variable

 

5. If I copy the trigger (which gives the popup shown below) and then change the target variable (not pictured, but...):

Copying the trigger

 

6. (... you can see the trigger in the Trigger list below) My first variable gains a use (for a total of 3), while the new variable only gains one:

variables in the wrong place

 

So, here's the solution.

7. Make a new trigger... :

change target variable first

... and change the target variable before you do anything else. (I've already done it in this picture.)

8. Then you can change it to a Toggle trigger.

then switch to toggle

 

9. And now both variables have the right number of uses, and it all works correctly.

the right man in the wrong place can make all the difference in the world

 

My use case and how I got here: I’m working on a simulation that will provide controlled practice for the engineers in my company to check a complicated document for errors. The premise is that they’ll look at a simulated document in Storyline, and be able to mark the fields that they think have problems. Then, once they’ve gotten through the whole thing, they’ll click “check”, and it will tell them which fields they missed, and why.

I mainly used Toggle triggers: clicking on a field toggles a “hidden” state on an indicator (showing “I think this field is wrong”), and also toggles a T/F variable, which is what the “check” function looks at. (I’m using Toggle because I want them to be able to go back and say “oh, wait, maybe this is okay” as they go, etc.)

I built the interaction, and it would work until I added another page. Then the new page would work, until I added a new page. I double-checked all the triggers and variables and layers and sequences and save states and found all my errors and fixed them, made the settings consistent across the pages, and made sure that everything should work. But I still had the same problems.

I had noticed that one of my variables (I’ll call it V6) had vastly more uses than the others (something like 16 uses when the others all had 2 or 3). After a bit of experimentation I figured out that, when I added a Toggle trigger, it added a use to the variable I wanted, but also a use to V6. With more experimentation, I saw that if I made a new Adjust Variable > Toggle trigger, but changed the variable before I changed the setting from “Set” to “Toggle,” it added two triggers to the correct trigger and none to V6.

I haven’t done research further than this – what other kinds of variables or triggers or whatnot are affected – as I’m still actively working on my project, but hopefully this is helpful for other people struggling (and maybe to the Articulate folks if you’re looking for bugs).

So, again: Make a new trigger for each “toggle T/F,” and choose the variable you want to adjust before you choose “toggle.”

Cheers!

Jaer

4 Replies
Kelly Auner

Hi Jaer,

Welcome to the E-Learning Heroes community!

Thank you for sharing this issue and the current solution here with our team. I'm sure other developers will find this information valuable as well! If you're comfortable sharing your project file, we'd happily test this to troubleshoot further. You can share it here or privately in a support case. We'll delete it from our systems once troubleshooting is complete!