Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : General : What isn't working?
New Topic New Poll Post Reply
Poster Message
DyRsOfDh14
Level: Delver
Rank Points: 56
Registered: 12-01-2007
IP: Logged
icon What isn't working? (0)  
I were doing something like TCB: Lowest Proper 2N
I put an NPC with a lot of 'Wait for door to open at ()'
I want that when all the doors open in a determined order, another command activates
But when I try it, the command activates just if I open all the doors, but in any order, I want it to open in a determined order for the command to start, understand?
Thanks
05-05-2010 at 06:58 PM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
Watcher
Level: Smitemaster
Avatar
Rank Points: 902
Registered: 02-04-2003
IP: Logged
icon Re: What isn't working? (+3)  
The problem is that the command "Wait for door to open at ()" does not wait until the door changes from open to closed. It just waits for the door to be open. If the door is already open when the script gets to this command, then it does not wait at all. So once all the doors are open, the script just continues through all the "Wait for door to open at ()" commands and reaches the last part. What you want instead is something like this:

Label "Loop 1"
 Wait 0
 If..
  Wait for door to open at (1,1)
 Goto "Loop 2"
 If..
  Wait for door to open at (3,3)
 Goto "Wrong"
 If..
  Wait for door to open at (5,5)
 Goto "Wrong"
 If..
  Wait for door to open at (7,7)
 Goto "Wrong"
 If..
  Wait for door to open at (9,9)
 Goto "Wrong"
 Goto "Loop 1"
Label "Loop 2"
 Wait 0
 If..
  Wait for door to open at (3,3)
 Goto "Loop 3"
 If..
  Wait for door to open at (5,5)
 Goto "Wrong"
 If..
  Wait for door to open at (7,7)
 Goto "Wrong"
 If..
  Wait for door to open at (9,9)
 Goto "Wrong"
 Goto "Loop 2"
Label "Loop 3"
 Wait 0
 If..
  Wait for door to open at (5,5)
 Goto "Loop 4"
 If..
  Wait for door to open at (7,7)
 Goto "Wrong"
 If..
  Wait for door to open at (9,9)
 Goto "Wrong"
 Goto "Loop 3"
Label "Loop 4"
 Wait 0
 If..
  Wait for door to open at (7,7)
 Goto "Right"
 If..
  Wait for door to open at (9,9)
 Goto "Wrong"
 Goto "Loop 4"
Label "Wrong"
 Speech "Nope, wrong."
 End
Label "Right"
 Wait for door to open at (9,9)
 Speech "Congratulations!"


Here, each loop waits for you to open one of the doors. If you open the right one, it jumps to the next loop; if you open the wrong one it tells you so and ends the script.

____________________________
Today the refrigerator, tomorrow the world!
05-05-2010 at 10:07 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
DyRsOfDh14
Level: Delver
Rank Points: 56
Registered: 12-01-2007
IP: Logged
icon Re: What isn't working? (0)  
Thank you very much o.o
05-06-2010 at 12:13 AM
View Profile Send Private Message to User Visit Homepage Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : General : What isn't working?
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.