Discuss Scratch

fredbear
Scratcher
5 posts

Make a block options

Can anyone explain in layman terms the make a block options, boolean, string, number and text.
many thanks
(Reposted in script section)

Last edited by fredbear (June 25, 2013 10:07:16)

turkey3
Scratcher
1000+ posts

Make a block options

I'll start with this image

This is an old image but you can still get the message. The block that looks like it has a block in it is the definition script. That defines exactly what the custom block does. The (height) rounded reporter block is a number input. Notice you will see that in the definition script in some places. Now, look at the script to the left of that. It says “jump () pixels” in some places. Whatever number is typed into the perimeters, or the parenthesis, that number will be rendered everywhere in the definition script where you see the (height) number input. So if I type in 25 and run the custom block, 25 will almost invisibly replace the (height) number inputs.

A string input works the same way; whatever you type into the block will be rendered where the input is placed in the definition script. The only difference is that a string is not a number, but a series of characters or letters. But they work the same way.

A boolean input allows you to insert a boolean block into the actual block (booleans are true or false blocks, mainly in sensing), and that boolean statement will be rendered wherever you drag the boolean input to in the definition script.

Text input is just plain text, nothing else. In the image a text input is the word “jump”. It is a void and has no perimeters, but just allows text.

Run without screen refresh just makes the block run in an instant of 0 seconds with no wait between blocks.

In the image above, in the top-right block, where you see (height), you can click on that and drag a copy of it out to place it into the definition script.

Last edited by turkey3 (June 25, 2013 13:44:33)

footsocktoe
Scratcher
1000+ posts

Make a block options

That was a good explanation! What if there is no definition block in the project? I am trying to remix a piano that plays two tunes. The tunes are both make a blocks, but there is no clue as to what is inside them. I assume some kind of note data. But how do I crack open the make a block? I can't remix if I don't know how to make a block like the scratcher did.

The project is Piano Songs by Baron Smith on June 23, 2013

Last edited by footsocktoe (June 30, 2013 08:53:26)

footsocktoe
Scratcher
1000+ posts

Make a block options

Ahhh… I just discovered where the definition blocks are. Should have looked more thoroughly. But thanks! I wouild delete that post if I could.
ErnieParke
Scratcher
1000+ posts

Make a block options

footsocktoe wrote:

Ahhh… I just discovered where the definition blocks are. Should have looked more thoroughly. But thanks! I wouild delete that post if I could.
Yeah, that can happen occasionally. When it does, and you have a reason, just report your post and say that you'd like it removed or something like that. A moderator will take everything from there. ;)

Oh, and if you do have a custom block without a definition, then the custom block will become red and obsolete. Scratch will skip over it whenever it encounters one.

With regards,

ErnieParke

Powered by DjangoBB