Forum Discussion
Variables within triggers not working consistently
- 2 months ago
Yup, the problem is using the same set of variables on multiple slides...
Variables maintain their value until a trigger changes it. So, as I said above, after the variables change to True on the first slide where they're used, they remain True. And that's why the next slide jumps after viewing just one layer. The conditions on the trigger are met before the user gets to that slide.
So, yes, you need different triggers for each slide. For easier programming (and troubleshooting), I suggest using a naming convention that indicates the slide and the layer. And keep the names as short as possible.
For example, the variables on the first slide could be s1_L1done, s1_L2done, s1_L3done, and s1_L4done. The variables on the second slide could be s2_L1done, s2_L2done, s2_L3done, and s2_L4done. And so on.
It's hard to tell for sure without seeing the .story file. But, based on your description, I'd guess that you're using the same variables—Layer1Visited, Layer2Visited, etc.—in the triggers on every slide.
- That would explain the problem, because all the variables would = True as soon as the user completed the first slide with those triggers.
- The slides would work in preview if you're just previewing one slide at a time, because each preview would start with the variable default of False.
- The fix: use a different set of variables for each slide.
If that's not the case, someone might be able to solve the issue if you upload a .story file.
Here are the best practices for doing that:
- Only include slides that are related to the problem.
- Be sure objects, layers, motion paths, and variables have meaningful names.
- If there is proprietary content, replace or delete it. For example, replace proprietary text with “ipsum lorem” text.