Managing Retries
Nov 13, 2014
Hello heroes! Can you guys check my logic to make sure I'm headed in the right direction or not? I've just created a game, and at the end you have the option to play again. However, I would like to limit the number of times you can play again so people are spending all of their training time on this one game. Here's what I'm thinking. Please tell me if it's right:
- create a number variable
- create another trigger on the replay button that adds 1 to the variable
- create a condition on the trigger that says jump to slide x if variable is less than or equal to y
10 Replies
Jessica,
You might want to check out this tutorial or this thread on the same topic.
Best of luck!
Bobbi
Hi Jessica
It should work exactly as you wrote.
I don't know how your game is built and if you created any other variables. If you did, please remember to reset your variable when revisiting the slide.
Oh! That’s a good point, Joanna. Thanks for pointing that out. How do I reset my other variable back to zero? I'll check out that link right now, Bobbi. Thanks.
To adjust variable back to zero, create an "adjust variable" trigger that executes when timeline starts.
One other thing that I think is important to point out (mentioned in the thread i posted above) is the order of your triggers. If you notice in the the thread, the user was having an issue with the variables not changing, due to the order of the triggers.
It depends what type of variable you used.
1. If there's a true/false variable - set the trigger to:
adjust variable: (name of your variable) = value (your starting value - true or false) when timeline starts
2. if there's a true/false variable - set the trigger to:
adjust variable: (name of your variable) = value (your starting value - probably 0) when timeline starts
Give me a shout if you need any further help :)
Oh....of course lol. That was a silly question :-) Thank you both!
Hello again. So I have this half way working. All the logic is working until the end when you've reached the threshold for retries. Would you ladies mind checking this out and see where I went wrong?
Hi Jessica,
It looks like the trigger on your try again layer is causing the problem. You currently have a condition on there to only play again if "replay" is less than three. Keep in mind that triggers fire from top to bottom. So the reason that it's getting stuck is that the variable increments higher right before you ask it to jump. So it's increasing from 2 to 3 and then the next trigger says to jump if the variable is less than 3 (which is no longer the case since the variable just incremented to 3 a nanosecond earlier).
The key is to remove that condition on the layer trigger. The base layer triggers are already telling SL which layer to show so you don't need that condition on the layer level.
I hope this helps!
Mike
Try this.
Thanks, Mike!
This discussion is closed. You can start a new discussion or contact Articulate Support.