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

#1 2010-06-05 10:06:56

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

How to make an <I recieve> block with variables.

Many suggestions have been this block: http://i26.tinypic.com/qyh98y.gif
While we are all waiting on our toes to see if this will be available in Scratch 2.0, there is still a way to do it in Scratch right now. This helps me in a lot of my projects, so I will share my technique. (These are all examples, so you can put these variables in all sorts of different scripts.)

http://imgur.com/Fgmcz.gif
This sets the variable to No, which means "Meow" is not broadcasted yet.
--------
After the fisheye effect is changed and it waits one second, the variable is set to Yes, which means "Meow" is broacasted.
http://imgur.com/QCGps.gif
This script is what you used before, without the features that the variable offers.
http://i49.tinypic.com/2r7bvro.gif
Or you could use this script to make it change when someting is broadcasted and then recieved.
http://imgur.com/YHRb5.gif
--------
These are all the scripts you can use as you would with the "I receive" block.
http://imgur.com/XbrkB.gif

Last edited by coka (2010-06-07 12:45:15)


http://i42.tinypic.com/2rot8c2.png

Offline

 

#2 2010-06-05 10:19:53

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Re: How to make an <I recieve> block with variables.

Yup. I use these a lot!!!  tongue

Offline

 

#3 2010-06-05 10:40:41

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: How to make an <I recieve> block with variables.

Great  big_smile  Hopefully this will make people stop asking for the block.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#4 2010-06-05 10:57:42

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

Re: How to make an <I recieve> block with variables.

juststickman wrote:

Great  big_smile  Hopefully this will make people stop asking for the block.

For beginners this block would be very useful, so I think it still should be implemented, but this is just another way of doing this for now. I agree that there are tons of duplicate threads asking for this block. The Scratch Team knows about it, so no need to keep posting them. Thanks!


http://i42.tinypic.com/2rot8c2.png

Offline

 

#5 2010-06-05 15:05:07

soupoftomato
Scratcher
Registered: 2009-07-18
Posts: 1000+

Re: How to make an <I recieve> block with variables.

This way takes to long for lazy me.  tongue  (Though I do use it)


I'm glad to think that the community will always be kind and helpful, the language will always be a fun and easy way to be introduced into programming, the motto will always be: Imagine, Program, Share - Nomolos

Offline

 

#6 2010-06-05 16:26:42

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: How to make an <I recieve> block with variables.

Very useful! Thank you for sharing this coka!


Hai.

Offline

 

#7 2010-06-05 16:57:54

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: How to make an <I recieve> block with variables.

Very useful, but I think you have something wrong - instead of waiting 1 second after the green flag is clicked and then changing the variable, shouldn't the variable be changed when something is broadcasted? Still, great job - definitely worth reading over for some newer users.

Offline

 

#8 2010-06-05 19:02:35

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

Re: How to make an <I recieve> block with variables.

coolstuff wrote:

Very useful, but I think you have something wrong - instead of waiting 1 second after the green flag is clicked and then changing the variable, shouldn't the variable be changed when something is broadcasted? Still, great job - definitely worth reading over for some newer users.

The variable is the broadcast block, just in "disguise"  tongue  You could use broadcasting too, but why make extra scripts? Just use When flag clicked, forever if <Broadcasted Meow = Yes>... Instead of When I receive. Really, you can do what ever you want. Everyone has a different way of programming.  wink  Thanks for the post!

Last edited by coka (2010-06-05 19:03:17)


http://i42.tinypic.com/2rot8c2.png

Offline

 

#9 2010-06-05 19:10:21

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: How to make an <I recieve> block with variables.

coka wrote:

coolstuff wrote:

Very useful, but I think you have something wrong - instead of waiting 1 second after the green flag is clicked and then changing the variable, shouldn't the variable be changed when something is broadcasted? Still, great job - definitely worth reading over for some newer users.

The variable is the broadcast block, just in "disguise"  tongue  You could use broadcasting too, but why make extra scripts? Just use When flag clicked, forever if <Broadcasted Meow = Yes>... Instead of When I receive. Really, you can do what ever you want. Everyone has a different way of programming.  wink  Thanks for the post!

What I meant was that the variable doesn't change as a result of something being broadcasted; just as a result of the green flag having been clicked.

Offline

 

#10 2010-06-06 18:13:53

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

Re: How to make an <I recieve> block with variables.

coolstuff wrote:

coka wrote:

coolstuff wrote:

Very useful, but I think you have something wrong - instead of waiting 1 second after the green flag is clicked and then changing the variable, shouldn't the variable be changed when something is broadcasted? Still, great job - definitely worth reading over for some newer users.

The variable is the broadcast block, just in "disguise"  tongue  You could use broadcasting too, but why make extra scripts? Just use When flag clicked, forever if <Broadcasted Meow = Yes>... Instead of When I receive. Really, you can do what ever you want. Everyone has a different way of programming.  wink  Thanks for the post!

What I meant was that the variable doesn't change as a result of something being broadcasted; just as a result of the green flag having been clicked.

Do you mean like this?
http://imgur.com/0lDOi.gif

or this?
http://imgur.com/YHRb5.gif

Or something else, I guess I don't exactly understand what you mean.

Last edited by coka (2010-06-06 18:14:48)


http://i42.tinypic.com/2rot8c2.png

Offline

 

#11 2010-06-06 18:21:45

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: How to make an <I recieve> block with variables.

coka wrote:

coolstuff wrote:

coka wrote:


The variable is the broadcast block, just in "disguise"  tongue  You could use broadcasting too, but why make extra scripts? Just use When flag clicked, forever if <Broadcasted Meow = Yes>... Instead of When I receive. Really, you can do what ever you want. Everyone has a different way of programming.  wink  Thanks for the post!

What I meant was that the variable doesn't change as a result of something being broadcasted; just as a result of the green flag having been clicked.

Do you mean like this?
http://imgur.com/0lDOi.gif

or this?
http://imgur.com/YHRb5.gif

Or something else, I guess I don't exactly understand what you mean.

The latter - sorry if I was unclear before.

Offline

 

#12 2010-06-07 12:36:26

coka
Scratcher
Registered: 2007-11-03
Posts: 1000+

Re: How to make an <I recieve> block with variables.

coolstuff wrote:

coka wrote:

coolstuff wrote:


What I meant was that the variable doesn't change as a result of something being broadcasted; just as a result of the green flag having been clicked.

Do you mean like this?
http://imgur.com/0lDOi.gif

or this?
http://imgur.com/YHRb5.gif

Or something else, I guess I don't exactly understand what you mean.

The latter - sorry if I was unclear before.

Really, I think you can use this however you want I guess. I'll edit it a little bit.


http://i42.tinypic.com/2rot8c2.png

Offline

 

#13 2010-06-07 16:47:07

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: How to make an <I recieve> block with variables.

coka wrote:

coolstuff wrote:

coka wrote:


Do you mean like this?
http://imgur.com/0lDOi.gif

or this?
http://imgur.com/YHRb5.gif

Or something else, I guess I don't exactly understand what you mean.

The latter - sorry if I was unclear before.

Really, I think you can use this however you want I guess. I'll edit it a little bit.

Oh, I see. I wasn't looking deep enough into it - thanks for clearing it up! I was thinking that the variable was irrelevant to how the broadcast worked, but I just wasn't looking at the scripts well enough. Silly me...  big_smile

Offline

 

Board footer