Announcement: Why not try our official idea generator for inspiration when making puzzles?


Caravel Forum : DROD Boards : Architecture : How to Reset a Variable? (Is it possible?)
New Topic New Poll Post Reply
Poster Message
noma
Level: Smitemaster
Avatar
Rank Points: 1594
Registered: 11-22-2006
IP: Logged
icon How to Reset a Variable? (0)  
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

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

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.
06-03-2010 at 02:26 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Dischorran
Level: Smitemaster
Avatar
Rank Points: 3408
Registered: 09-10-2005
IP: Logged
icon Re: How to Reset a Variable? (+1)  
When in doubt, add "Wait 0" commands to characters after they do something that isn't moving, to make them continue to the next turn. Your monitoring characters may need them; I think I had to do that for the combination room in Beethro's Brain.

It also might be easier to play around with nested If statements rather than using a bunch of characters - wait for orb strike, if player is adjacent to correct orb wait for next orb strike, if not go back to start.

____________________________
Click here to view the secret text

06-03-2010 at 03:16 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
noma
Level: Smitemaster
Avatar
Rank Points: 1594
Registered: 11-22-2006
IP: Logged
icon Re: How to Reset a Variable? (0)  
Okay, that is really weird. Wait 0 after they did something didn't help at all. I had to put it right at the top, after the "Start" label on all characters. And now it works. Thanks!

Label Start
Wait 0
Imperative 1
Wait for entity Player x,y,x,y
Set var "Combination" - 1
Go to Start

06-03-2010 at 03:59 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : How to Reset a Variable? (Is it possible?)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.