Hello all! Hoping someone can help me out with this, as I've been trying to figure it out for a bit now, and I'm only getting more confused.
I have a secret passage that opens based on a puzzle. It should go like this:
- The player enables the correct items (these are a series of activators: each one enables the next in sequence and disables itself.)
- The player pulls the chain, which activates the secret passage.
- The secret passage checks that the right activators are enabled, and if they are, it opens the door.
- If the right combination is not entered, the door doesn't budge, and the player has to try a new combo, then pull the chain.
For the most part, this is working, but the bit about checking if the right activators are present doesn't seem to want to stop. Once you've pulled the chain, if you enter the right combo, the door opens again without needing a second chain pull.
I've tried to govern this with states: all the work is done in the "Closed" state, which then exits to the "preClosed" or "preOpen" states depending on success. I've attached my full script, but here's the bit that governs that:
If Answered == 1 PlayGamebryoAnimation("Forward", true) ;opens the secret door Utility.Wait(4.5) ;wait until animation finished GotoState("preOpen") Else Debug.Notification("The stones grind against eachother, but nothing happens.") GotoState("preClosed") EndIf
The door does open with the correct combo, so I know this bit is firing, but it seems like maybe the "preClosed" and "Closed" states are running together, instead of switching. How do I get it to stop the "Closed" state, and force the player to start over?