Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : "Wait for player to touch me" event fires once & for all
New Topic New Poll Post Reply
Poster Message
Jatopian
Level: Smitemaster
Rank Points: 1842
Registered: 07-31-2005
IP: Logged
icon "Wait for player to touch me" event fires once & for all (0)  
Make an NPC with the following commands:
Appear
Wait for player to touch me
Speech "Player touched me once."
Wait for player to touch me
Speech "Player touched me again."
The intuitive behavior would be that the second line of speech would happen only when the player has bumped the NPC twice. This is not the case: Once the player touch event has happened once, subsequent such commands are virtually ignored and the proceding instructions are processed without waiting for another player touch.

____________________________
DROD has some really great music.
Make your pressure plates 3.0 style!
DROD architecture idea generator

[Last edited by Jatopian at 08-09-2007 01:18 AM : removed empty lines]
08-09-2007 at 01:18 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3118
Registered: 06-11-2007
IP: Logged
icon Re: "Wait for player to touch me" event fires once & for all (+1)  
This has been brought up before.

It's important to remember that "Wait for player to touch me" holds true throughout the entire turn it's activated on. Hence, you should use a Wait 0 Turns command to delay the next wait until the next turn.
08-09-2007 at 01:24 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Kwakstur
Level: Smiter
Avatar
Rank Points: 385
Registered: 05-05-2006
IP: Logged
icon Re: "Wait for player to touch me" event fires once & for all (0)  
Yes. The "Wait 0 turns" command is the DROD equivalent to the "root." thing that you see in languages like Action Script.

You need to use the command a lot, but it's too hard to describe where.
Adding it in seemingly random spots will make programs work. And, eventually, you will always be putting it in the right spots and never in the wrong ones. But even then, you won't know why or when you add it.

Except for the few people who actually do know why you add them in the places you do. But I generally stay away from those people, 'cause they're aliens.

____________________________
Also known as ExpHP everywhere else.

[Last edited by Kwakstur at 08-09-2007 01:39 AM]
08-09-2007 at 01:37 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Chaco
Level: Smitemaster
Rank Points: 3624
Registered: 10-06-2005
IP: Logged
icon Re: "Wait for player to touch me" event fires once & for all (+1)  
Actually, this is true for *all* events - if you want to wait for three monsters to be stabbed, you need to have your character wait a turn between those three waitings.

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


[Last edited by Chaco at 11-25-2007 03:55 PM]
08-09-2007 at 02:04 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
Jatopian
Level: Smitemaster
Rank Points: 1842
Registered: 07-31-2005
IP: Logged
icon Re: "Wait for player to touch me" event fires once & for all (+1)  
08-09-2007 at 02:32 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Mattcrampy
Level: Smitemaster
Avatar
Rank Points: 2388
Registered: 05-29-2003
IP: Logged
icon Re: "Wait for player to touch me" event fires once & for all (0)  
So, how then would you ensure that a script only fires if Beethro both walks onto a particular square and stabs a monster?

____________________________
What do you call an elephant at the North Pole?
Click here to view the secret text

08-09-2007 at 05:06 AM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Kwakstur
Level: Smiter
Avatar
Rank Points: 385
Registered: 05-05-2006
IP: Logged
icon Re: "Wait for player to touch me" event fires once & for all (+1)  
Mattcrampy wrote:
So, how then would you ensure that a script only fires if Beethro both walks onto a particular square and stabs a monster?
That could be done with nested if commands.

But, oh, would you look at that? In order to use If commands in a loop, you have to use Wait 0 Turn(s). It strikes again!

____________________________
Also known as ExpHP everywhere else.

[Last edited by Kwakstur at 08-09-2007 08:16 AM]
08-09-2007 at 08:16 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: "Wait for player to touch me" event fires once & for all (+1)  
Jatopian wrote:
Well that's silly.
Not if you want to check the same occurrence at multiple places. Just think of events lasting the whole turn (why should they be cleared after a they're successfully waited for?), and the "Wait for..." commands to finish immediately if the condition is already true when they're executed.

If you want several of them, you need to wait for the next turn in-between. Makes perfect sense.

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(
08-09-2007 at 08:51 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Bugs : "Wait for player to touch me" event fires once & for all
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.