Hello! This is my first time posting on the forums!
I'm fairly new to Twine and I've only made two text adventure games in it so far. I recently decided to make a quiz game similar to the impossible quiz. (Except only with regular questions for the moment.) I wanted to have the player have lives so at the begining of the game it silently sets $lives to 5. Then on Question 1. At the bottom of the screen it prints $lives in a font. I wanted it so that if the player clicks on a wrong answer it will stay on that page and the life variable is 1 less. I guessed on how to do that and I made the first wrong answer look like this.
[[Wrong Answer <<set $lives = $lives -1>>|Question 1]]
However that made the lives diplay as 4 before the link had been clicked. How do I make it so that it subtracts lives and stays on the question? My temporary solution is to have the player be taken to a seperate passage saying wrong where they can either choose to quit or try again. I would prefer that it worked the other way. Does anyone know the solution?
Comments
I'm super sleepy so I'm not going to be as much help as I'd like, but this is such a simple question I'm sorry it's went this long without an answer.
I think setter-links are all you need: [[Wrong Answer|Question 1][$lives -= 1]]
Hope that helps!