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


Caravel Forum : DROD Boards : Architecture : Scripting question
New Topic New Poll Post Reply
Poster Message
robin
Level: Smitemaster
Avatar
Rank Points: 842
Registered: 09-01-2004
IP: Logged
icon Scripting question (0)  
I've searched the forum a bit, but did not found a clear answer.

I'm experimenting with some scripting,
I'm want to do a "portable orb" thing, like in JtRH.
And it works, but not as it should be.

I use:
Click here to view the secret text


So when the player steps on the square, the door opens.
But I have 6 squares around that door,
they all (6) work, but when the door is opened,
and when stepped on one (or more) of the other 5,
it still activates the item.

How can I prevent that?
It should be working like in JtRH

greetings robin

____________________________
Click here to view the secret text

06-09-2012 at 09:36 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
Jatopian
Level: Smitemaster
Rank Points: 1842
Registered: 07-31-2005
IP: Logged
icon Re: Scripting question (+1)  
Use "Wait for player at" instead?

____________________________
DROD has some really great music.
Make your pressure plates 3.0 style!
DROD architecture idea generator
06-09-2012 at 12:38 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Fang
Level: Master Delver
Avatar
Rank Points: 175
Registered: 07-25-2008
IP: Logged
icon Re: Scripting question (+2)  
You should use "wait for entity (player)" instead, and make a rectangle around the door's location. Put the "activate item at (30,3)" then input the script "wait while entity (player)" and cover the entire screen with this selection rectangle.

This should allow the script to activate the item whenever you get close to the door while disabling it after the door is activated until the player returns to the room. If you want to make it one use, replace "wait while entity (player)" with "End".

Actually, here's the script I just made for that. You'll just have to change the coordinates of "wait for entity" and "wait while entity" or remove it to replace it with "End" like I said.

Wait for entity Player 29,2,31,8
Activate item at 30,3
Wait while entity Player 0,0,37,31


____________________________
"Imagination is more important than knowledge." -Albert Einstein

[Last edited by Fang at 06-09-2012 02:19 PM]
06-09-2012 at 01:47 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Shendy
Level: Master Delver
Rank Points: 132
Registered: 07-01-2010
IP: Logged
icon Re: Scripting question (0)  
I don't think we need to use the "Wait while entity (player)", since the script will not repeat unless we use "Labels".
06-09-2012 at 02:25 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Fang
Level: Master Delver
Avatar
Rank Points: 175
Registered: 07-25-2008
IP: Logged
icon Re: Scripting question (0)  
Hm, perhaps that's right. Still, the line about waiting while entity would stop the script no matter what so if you run into trouble you can include it.

____________________________
"Imagination is more important than knowledge." -Albert Einstein

[Last edited by Fang at 06-09-2012 03:18 PM]
06-09-2012 at 03:18 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1300
Registered: 06-14-2005
IP: Logged
icon Re: Scripting question (+2)  
ah, not quite. I think you might want this if the orb is reusable:

Label Start
  If ... 
        Wait for entity Player 4,24,4,29
     If ... 
           Wait for door to Close,2,28
        Activate item at 1,26
     If End 
  If End 
  Wait 0
  Go to Start


[Last edited by Someone Else at 06-10-2012 04:16 PM]
06-10-2012 at 04:15 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
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Scripting question
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.