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

#1 2007-10-25 06:21:33

Pikachanian
Scratcher
Registered: 2007-10-25
Posts: 22

in-script receive block.

i think that for another version of scratch you should have a receive block that can go inside a script.  sad


Hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi hi @:0
(Look at the end of it to see Elvis.)
I'm only 11, and I have an IQ of 124! According to 3 different tests!

Offline

 

#2 2007-10-25 07:35:25

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: in-script receive block.

Hi Pikachanian, I'm curious in what it is exactly you can't do in the current implementation, i.e. why would you need a receive block inside a script instead of an event hat?


Jens Mönig

Offline

 

#3 2007-10-25 10:44:30

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: in-script receive block.

I don't quite see how a recieve block in a script would work.  The script would have to "jump" to the receive block (since broadcasts are events and don't "persist").  In this case, it would be pretty much acting like a "Hat" anyway.

The desired result could probably be obtained by having the script test the value of a global variable (a variable available to all sprites, which is the default).  If another Sprite/Script changes the variable, the Script in question can react to this "silent broadcast".

Offline

 

#4 2007-10-25 11:10:53

beny
Scratcher
Registered: 2007-07-24
Posts: 100+

Re: in-script receive block.

yes, now evreyones wanting it, i was porblay the first who wanted it


more people like the letter B than the letter A!
i'm going for 250 posts!

Offline

 

#5 2007-10-25 20:02:05

relyt12101
Scratcher
Registered: 2007-05-19
Posts: 500+

Re: in-script receive block.

See http://scratch.mit.edu/forums/viewtopic.php?id=717. I wanted this since, like, a long time ago!


http://img392.imageshack.us/img392/2860/pspbanneregg089deiy0.png

Offline

 

#6 2007-10-26 00:06:10

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: in-script receive block.

Sorry to disappoint the "I thought of it first" folks, but this idea has been kicking around longer than the web site.  I don't think I was the first to suggest a test for having received a message, but I have an email I sent to the scratch team during beta testing
(18 Dec 2006)
...
5) Need a repeat..until loop.  There are a lot of times that                                                                               
       we'd like to run something "forever", only not quite.                                                                                 
       For example, in a dnace routine, it would be nice to have                                                                             
       repeat                                                                                                                                 
            broadcast start_beat                                                                                                             
            wait <beat>                                                                                                                       
       until receive dance_over                                                                                                               
       I'd be happy if receiving the message always                                                                                           
       terminated the loop, no matter where in the body you are.                                                                             
       Right now there is no way out of a forever loop, other than                                                                           
       by stopping all scripts.                             

They did eventually put in the repeat-until, but not the test for receiving a message.

Offline

 

Board footer