I'm trying to set up a "
combination"
puzzle. I wanted to use orbs but couldn't figure a way to make it work. I've been making headway with multi-use pressure plates instead. Basically the player has to step on 4 plates in the correct order, then strike an orb. If done correctly, the gates will open. I set this part up with NPC's that add or subtract 1 to a variable as the player steps on each plate. Here is one example, although each is slightly different depending on which plate is stepped on:
Click here to view the secret text
×Label Start
Imperative 1
Wait for entity Player x,y,x,y
If ...
Wait until var "Combination" = 1
Set var "Combination" + 1
Else
Set var "Combination" - 1
If End
Go to Start
When the puzzle is done correctly, the variable will equal 4. After the orb is struck another NPC checks if the variable = 4, and if it does, it opens the door.
Click here to view the secret text
×Label Start
Imperative 1
Wait for event Player activates orb
If ...
Wait until var "Combination" = 4
Go to Activate
Else
Go to Start
If End
Label Activate
Activate item at a,b
So far, so good. This first part works perfectly, if the player executes the puzzle correctly /the first time./
My problem is this: I want to have the puzzle "
reset"
after striking the orb, so that the player does not have to exit the room to try again. Currently I set up an NPC with the following script in an attempt to reset the combination variable to zero:
Label Start
Imperative 1
Wait for event Player activates orb
Wait 1
Set var "
Combination"
= 0
Go to Start
This doesn't work. I've been trying to figure this out for hours, but seeing as I know almost nothing about scripting it's probably time for me to ask for help. Help? Is there another way to zero out a variable, or is there some other problem? Thanks.