Discuss Scratch

monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

kenny2scratch wrote:

Hey!

The scratchblocks plugin has been updated since this topic was started, so I'll give you a few updates:

First, cstart, celse and cend seem not to have any effect anymore. Take a look:
[scratchblocks]
test cstart :: cstart
...
test celse :: celse
...
test cend :: cend
[/scratchblocks]
makes
test cstart :: cstart
...
test celse :: celse
...
test cend :: cend
.
The only way to make your own C blocks now is to use curly braces {}, like this:
[scratchblocks]
test cstart {
...
} test celse {
...
} test cend
[/scratchblocks]
test cstart {
...
} test celse {
...
} test cend
which (to me, since I've worked with JavaScript) makes a lot more sense.

Second, directly because of this, curly braces {} don't work as block inputs anymore, see:
[scratchblocks]
here is a block with what used to be a block input {block}
[/scratchblocks]
here is a block with what used to be a block input {block}
so instead. you can actually use parentheses () and inside them specify that the input is a block!
[scratchblocks]
here is a block with what is now a block input (block :: stack) :: control // 'cause I want to differentiate the colors
[/scratchblocks]
here is a block with what is now a block input (block :: stack) :: control // 'cause I want to differentiate the colors

Third, to control the type of a “if – else – finally” block, you just put the :: at the end, like this:
[scratchblocks]
test cstart {
...
} test celse {
...
} test cend :: control
[/scratchblocks]
test cstart {
...
} test celse {
...
} test cend :: control

Finally, here is a rewrite of @theonlygusti 's code, the way I think he meant it to be:
[scratchblocks]
when gf clicked :: operators hat
wait until (this block :: looks stack) turns purple {
say hi! :: sound stack
} and then {
use the colors {
to make life :: motion stack
} :: custom-arg
} finally :: extension
stop :: grey cap
[/scratchblocks]
when gf clicked :: operators hat
wait until (this block :: looks stack) turns purple {
say hi! :: sound stack
} and then {
use the colors {
to make life :: motion stack
} :: custom-arg
} finally :: extension
stop :: grey cap
@theonlygusti , I respect you for being the only one I've found that actually deliberately explained all the scratchblocks techniques. Here is an update for everyone who reads this topic!
Another thing: you can now set blocks to other colors. For example, to make a block black or white:
[scratchblocks]
::#000000
::#ffffff
[/scratchblocks]
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.

Last edited by monstermash3 (Dec. 30, 2016 01:07:46)

dawidkrainski
Scratcher
100+ posts

ITopic: Everything you never knew about [scratchblocks]!

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Hmm… I didn't knew that!
Tropic
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

dawidkrainski wrote:

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Hmm… I didn't knew that!
monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

Tropic wrote:

dawidkrainski wrote:

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Hmm… I didn't knew that!
Yeah, it doesn't seem to even be on the Wiki page yet, so it must be pretty new.
jokebookservice1
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

monstermash3 wrote:

Tropic wrote:

dawidkrainski wrote:

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Hmm… I didn't knew that!
Yeah, it doesn't seem to even be on the Wiki page yet, so it must be pretty new.
It was introduced in the new version of scratchblocks3. I didn't notice that it wasn't on there, hopefully it will be added (I'll edit it tomorrow if nobody does so before me)
asivi
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

I do not understand the reason for this topic being in Help with Scripts, i think that this would must moved to [scratchblocks] OFFICIAL testing topic

Last edited by asivi (Dec. 31, 2016 00:16:17)

kenny2scratch
Scratcher
500+ posts

ITopic: Everything you never knew about [scratchblocks]!

Hello again, people!
Thanks to the posts after mine for a few things I had forgotten about.

duckboycool wrote:

But you can still do something like;
When {When gf clicked} clicked::events hat
[scratchblocks]
When {When gf clicked} clicked::events hat
[/scratchblocks]
To make them go inside other blocks.
@duckboycool, this is because you specified that the block has to be a hat block. Without the “hat” in “events hat”, the block would become a C block. If you put what was originally a block input into a block then the block you put it into will become a C block unless you specify its type.
[scratchblocks]
When {When gf clicked} clicked::events hat
[/scratchblocks]
makes
When {When gf clicked} clicked::events hat
while
[scratchblocks]
When {When gf clicked} clicked::events
[/scratchblocks]
makes
When {When gf clicked} clicked::events

Second

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
[scratchblocks]
::#000000
::#ffffff
[/scratchblocks]
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Thanks, @monstermash3, for reminding me about this. Yes, you can set blocks to specific RGB hex colors. Enjoy.

That's all!
;
monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

asivi wrote:

I do not understand the reason for this topic being in Help with Scripts, i think that this would must moved to [scratchblocks] OFFICIAL testing topic
There can't be topics within topics…

kenny2scratch wrote:

Second

monstermash3 wrote:

Another thing: you can now set blocks to other colors. For example, to make a block black or white:
[scratchblocks]
::#000000
::#ffffff
[/scratchblocks]
::#000000
::#ffffff
Just use the hexadecimal code instead of a category.
Thanks, @monstermash3, for reminding me about this. Yes, you can set blocks to specific RGB hex colors. Enjoy.

That's all!
;
Yay, it got added to the OP!

sakafitrady wrote:

You dont have to put > and )! They also added a special new diamond block! And black!
((((((((((((((((((((((((
<<<<<<<<<<<<<<
<(<(<(<(<(
Uh… isn't that the same?
jokebookservice1
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

What I think asivi meant was the contents of the OP be added to the other topic.
asivi
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

@monstermash3
Just asking myself how this is useful for people having issues with a project script.

sakafitrady wrote:

You dont have to put > and )! They also added a special new diamond block! And black!
((((((((((((((((((((((((
<<<<<<<<<<<<<<
<(<(<(<(<(
monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

theonlygusti wrote:

Remember, use the proper testing topic to try out your new-found skills: http://scratch.mit.edu/discuss/topic/14778/

theonlygusti wrote:

Remember, only use this topic to follow along with the tutorial, ask for questions and suggest things I missed.

To test out your newly acquired skills, use this stickied topic by jvvg http://scratch.mit.edu/discuss/topic/14778/

Those links are to the old one. Here's the new one:
https://scratch.mit.edu/discuss/topic/219704/
monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

The OP still does not seem to mention color pickers.
theonlygusti
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

I think all aspects of the new [scratchblocks] plugin have been covered in the OP. Thus, bumping for update!
monstermash3
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

theonlygusti wrote:

I think all aspects of the new [scratchblocks] plugin have been covered in the OP. Thus, bumping for update!
Yay! You added color pickers. Finally.
dvargasews
Scratcher
500+ posts

ITopic: Everything you never knew about [scratchblocks]!

I'm having problems with scratchblocks.
Sprite1: define one thing//local custom block
Sprite1: define one thing ::custom ::hat
Sprite1: define one thing ::hat ::custom
Sprite1: define one thing ::hat ::custom//local custom block
define something else//global custom block
Sprite1: define one thing//Sorry, but [scratchblocks] is not cooperating.
[/scratchblocks]
What's your advice for this?

Last edited by dvargasews (Jan. 9, 2017 23:23:40)

theonlygusti
Scratcher
1000+ posts

ITopic: Everything you never knew about [scratchblocks]!

dvargasews wrote:

I'm having problems with scratchblocks.
Sprite1: define one thing//local custom block
Sprite1: define one thing ::custom ::hat
Sprite1: define one thing ::hat ::custom
Sprite1: define one thing ::hat ::custom//local custom block
define something else//global custom block
Sprite1: define one thing
What's your advice for this?
It's because you're using the :: notation twice. Just type :: one time:

Sprite1: define one thing ::custom hat

Last edited by theonlygusti (Jan. 9, 2017 23:24:51)

Powered by DjangoBB