This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-12-17 20:13:52

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

What's wrong with this script?

I'm having a problem, and I'm hoping someone has any idea what's happening, because this is confusing me... a lot.

I'm trying to use a list (for the one sprite) and a variable called timer (I can't use the built-in one). There's one item on the list (I'll add more to it later after this), which is "20.1". Then I have a script for the timer that changes every 0.1 seconds by, well, 0.1. Then I have another script saying "wait until item 1 of (list) > timer", and the timer always resets to 0 when the script starts. But as soon as it starts, it thinks that timer is always greater than the item in the list, and the wait until block activates instantly. I've tried putting a "wait 0.1 secs" block first to make sure the timer gets a chance to reset before the wait until blocks starts, and it still starts right away.

I can't tell if there's a problem with scratch, the list, my scripting or I'm just missing something big.  hmm  Any ideas?

Last edited by hmnwilson (2008-12-17 20:14:55)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#2 2008-12-17 21:00:03

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: What's wrong with this script?

The way you've described it: "wait until item 1 of list > timer", if the item in the list is 20.1 and the timer starts at zero, it will trigger instantaneously as 21.1 IS greater than 0.  You probably want "wait until timer > item 1 of list"


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2008-12-17 22:34:00

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: What's wrong with this script?

Wow, do I feel dumb right now  tongue  I put them on the wrong sides, didn't even notice it, and just copied what I had put down into the post.

Last edited by hmnwilson (2008-12-17 22:38:11)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

Board footer