Forum Discussion

KayseeCarrere-a's avatar
KayseeCarrere-a
Community Member
2 hours ago

Reset Number Variable When Revisiting?

I'm creating a game in Storyline. I have set up a number variable to track attempts left. Whenever the variable reaches 0, the a pop-up appears that allows the user to click Try Again to restart the challenge. There are 3 challenges in this game, each with a different number of allowed attempts, so I've set up separate variables for each challenge. 

The issue I'm having is when the user clicks Try Again, it returns to the beginning of the challenge but does not reset the variable even though I have "Reset to initial state when revisiting" selected in the slide properties. Since the challenge spans multiple slides, I do not want to set a trigger that resets the variable on each slide when the timeline starts. There doesn't seem to be a condition available to reset the variable only when revisiting, and it's a hassle to have to restart the entire course instead of just the failed challenge.

Is there any way around this? 

For reference, I've attached a few screenshots of what I'm trying to do. These are separate slides and they are not freeform quiz slides. I'm wondering if making the slides quiz slides might automatically reset the variable?

  • A variable maintains its value until a trigger adjusts it. That's what makes them useful across an entire course. And that's why the "Reset to initial state" option in the Slide Properties doesn't impact variables.

    I agree with Jesse: add a "set variable to 0" trigger to the Try Again button. 

  • JesseWu's avatar
    JesseWu
    Community Member

    Bind resetting variable triggers to Try Again button? How does that sound?