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


Caravel Forum : DROD Boards : Architecture : Need help on IF/THEN/ELSE Scripting
New Topic New Poll Post Reply
Poster Message
Casebier
Level: Master Delver
Avatar
Rank Points: 284
Registered: 08-03-2005
IP: Logged
icon Need help on IF/THEN/ELSE Scripting (0)  
Okay, I'm trying to put a specific test clause in an NPC, but I'm having no luck figuring it out. This is what I'm trying to get:

IF Player at (10,10)
THEN Goto Label-1
ELSE IF Player at (10,12)
THEN Goto Label-2

btw- There's a solid wall at (10,11), in case that helps.

____________________________
Casebier
--------------------------------
Revisiting old Project: ZelDROD 1 / ZelDROD RPG (If I can ever find the custom graphic files that I made for it.)
01-11-2007 at 08:38 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Chaco
Level: Smitemaster
Rank Points: 3685
Registered: 10-06-2005
IP: Logged
icon Re: Need help on IF/THEN/ELSE Scripting (+2)  
There's no if/then/else. There is if this then go here. then later since you didn't go there then do this.

But yeah, no else command, yeah.

Anyway, what you need to do is put them in a loop like so, since you're only checking once right now.

Label CheckLoop
If ... go to Location1
Wait for player at (x1,y1)
If ... go to Location2
Wait for player at (x2,y2)
Wait 1 turn
Go to CheckLoop
Label Location1
//do stuff
Go to Done
Label Location2
//do different stuff
Go to Done
Label Done


____________________________
Quick links to my stuff (in case you forgot where it was):
Click here to view the secret text


[Last edited by Chaco at 01-11-2007 08:47 PM]
01-11-2007 at 08:45 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Jason
Level: Smitemaster
Rank Points: 1076
Registered: 05-05-2006
IP: Logged
icon Re: Need help on IF/THEN/ELSE Scripting (+1)  
If ... goto Label 1
wait for Player at (10,10)
If ... go to Label 2
wait for Player at (10,12)

Should do it.

____________________________
Play my holds?
01-11-2007 at 08:45 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
coppro
Level: Smitemaster
Rank Points: 1309
Registered: 11-24-2005
IP: Logged
icon Re: Need help on IF/THEN/ELSE Scripting (+1)  
You don't actually need an else command, since the fact that all if statements are also gotos makes it so that code coming after the if is essentially an else statement.
01-12-2007 at 11:32 PM
View Profile Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Need help on IF/THEN/ELSE Scripting
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.9
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.