Discuss Scratch
- Discussion Forums
- » Suggestions
- » Custom c blocks and hat blocks
- dhdguysg
-
100+ posts
Custom c blocks and hat blocks
Hello again!
As you saw my last post about pen blocks maybe, I was getting good support, I hope those blocks will come to life, Anyways, Lets get to the subject
I have been looking through a lot of the posts in this thread, Seeing all of the support, I decided to update this post (my english was so bad for it I can't even.)
So here it is!
As you saw my last post about pen blocks maybe, I was getting good support, I hope those blocks will come to life, Anyways, Lets get to the subject
I have been looking through a lot of the posts in this thread, Seeing all of the support, I decided to update this post (my english was so bad for it I can't even.)
So here it is!
Custom C blocks
(because custom hat blocks would probably be useless)
So C blocks are really useful, but a lot of people hate having to just re-create their conditional (c-block) functions as it makes code messier.
I've decided to create a post for this feature.
I hope ST reads this.
So I've been working out a way that it works.define cblock etcPretty simple? But how exactly do you create them?
code here
Alright, so you create your new custom block, it has a define. and you put code inside the define, But how does it map out how the c-block will work?
Here's an example.define repeat*2 (int32)So if you've seen what I'm going for (It uses c-blocks and other blocks that'd work with conditionals as the conditional) then you might want to go ahead and support!
repeat (int32)
// in here it'd assume ok this is a c block so we'll use this as part of the c block
end
repeat (int32)
// same for here
end
Now, about my other thing (custom hats) This feature isn't as great, but it is basically just a custom event being pulled, So for example if I have a 3 click event on an object, I can create a custom hat for that.
It'd use event combining and I don't know how exactly it would look in scratchblocks, that's beyond the BB plugin's feature.
Thanks for supporting in advance!
Last edited by dhdguysg (May 6, 2016 16:59:10)
- HOWING
-
500+ posts
Custom c blocks and hat blocks
Hello again!Support? I'm not 100% sure.
As you saw my last post about pen blocks maybe, I was getting good support, I hope those blocks will come to life, Anyways, Lets get to the subject
I have been looking threw obsolete blocks, Some dont have workarounds and they are c blocks or something,
Heres an example of a custom c block define and everythingScratch C block definers+c block examplesThat was pretty easy right??define c block while <stuff :: custom-arg> :: custom hat
Scratch Code [repeat until <not <stuff :: custom-arg>>] //Experimental block for custom code. there's an easier way to make c blocks in the next explanation
//So it asks you to insert scratchblocks code that you'd do in a post inside the experimental block saying: scratch code
when gf clicked
while <mouse down?> :: cstart custom
say [HoodelHoe!]
end :: cend custom
Here's the easier way to set behavior the same way i did up there..define c block while <stuff :: custom-arg> :: custom hatWell that was easy, Now to show you hat blocks, This is also easy
repeat until <not <stuff :: custom-arg>> :: cstart control
end :: cend control
when gf clicked
while <mouse down?> :: cstart custom
say [Easier way!]
end :: cend custom
The red flag is a sprite ingamedefine hat block When red flag clicked :: custom hat //This code is inside the red flagI hope you will support this! Ask me anything but before you ask look if i answered the question already!
if <<mouse down?> and <touching [mouse pointer v]?>>
Code below hat :: grey //This is not in the actual code, it will just run anything below if this statement is true..
end
When red flag clicked :: custom hat
say [I'm clicked!] for (2) secs
Also, you could use this:
...Instead of the grey block “Code below hat”.
- dhdguysg
-
100+ posts
Custom c blocks and hat blocks
Oh okay,Hello again!Support? I'm not 100% sure.
As you saw my last post about pen blocks maybe, I was getting good support, I hope those blocks will come to life, Anyways, Lets get to the subject
I have been looking threw obsolete blocks, Some dont have workarounds and they are c blocks or something,
Heres an example of a custom c block define and everythingScratch C block definers+c block examplesThat was pretty easy right??define c block while <stuff :: custom-arg> :: custom hat
Scratch Code [repeat until <not <stuff :: custom-arg>>] //Experimental block for custom code. there's an easier way to make c blocks in the next explanation
//So it asks you to insert scratchblocks code that you'd do in a post inside the experimental block saying: scratch code
when gf clicked
while <mouse down?> :: cstart custom
say [HoodelHoe!]
end :: cend custom
Here's the easier way to set behavior the same way i did up there..define c block while <stuff :: custom-arg> :: custom hatWell that was easy, Now to show you hat blocks, This is also easy
repeat until <not <stuff :: custom-arg>> :: cstart control
end :: cend control
when gf clicked
while <mouse down?> :: cstart custom
say [Easier way!]
end :: cend custom
The red flag is a sprite ingamedefine hat block When red flag clicked :: custom hat //This code is inside the red flagI hope you will support this! Ask me anything but before you ask look if i answered the question already!
if <<mouse down?> and <touching [mouse pointer v]?>>
Code below hat :: grey //This is not in the actual code, it will just run anything below if this statement is true..
end
When red flag clicked :: custom hat
say [I'm clicked!] for (2) secs
Also, you could use this:...Instead of the grey block “Code below hat”.
And yes you can be sure to support this thing, We'll need this for alot
- Photoguy77
-
100+ posts
Custom c blocks and hat blocks
I definetly support this! It'd make scratch so much nicer to use.
- HOWING
-
500+ posts
Custom c blocks and hat blocks
What block will we use to run the c-block when the condition is true?
- dhdguysg
-
100+ posts
Custom c blocks and hat blocks
You'll use the block you created, But i dont quite understand, Please tell me if this is correct What block will we use to run the c-block when the condition is true?
Okay so you have your definer
define c block Ex (stuff)
repeat until <not <stuff :: custom-arg>>
... :: grey
end
//And your stuff
when green flag clicked
Ex (mouse down?) :: cstart custom
... :: grey //So you'd use the block you created to run if the condition is true, If it wouldnt be true it'd skip the block
end :: cend custom
- Cyoce
-
500+ posts
Custom c blocks and hat blocks
Support. Here's how the custom c-blocks could be created:
Just like the “add ___ input” under options, you could have an “add stack” option.
For example, for making a “while” block:
Couldn’t represent that properly because the “define” formatting is finicky.
Just like the “add ___ input” under options, you could have an “add stack” option.
For example, for making a “while” block:
while ([condition] :: custom-arg) {[stack1] :: custom-arg} :: custom-argSimilarly, you could have “add else”. This would add an else loop.
//would become
while () :: custom-arg cstart
end
//the definition:
repeat until <not<condition :: custom-arg>>
stack1 :: custom-arg
end
Couldn’t represent that properly because the “define” formatting is finicky.
- dhdguysg
-
100+ posts
Custom c blocks and hat blocks
True.. Support. Here's how the custom c-blocks could be created:
Just like the “add ___ input” under options, you could have an “add stack” option.
For example, for making a “while” block:while ([condition] :: custom-arg) {[stack1] :: custom-arg} :: custom-argSimilarly, you could have “add else”. This would add an else loop.
//would become
while () :: custom-arg cstart
end
//the definition:
repeat until <not<condition :: custom-arg>>
stack1 :: custom-arg
end
Couldn’t represent that properly because the “define” formatting is finicky.
I have been making a concept for a while Of how scratch should do it, check it out:

- TehCow
-
50 posts
Custom c blocks and hat blocks
Umm… Code Blocks? What kind of code would we be dealing with? I hope the ST doesn't have to Invent a whole new language for this 

- dhdguysg
-
100+ posts
Custom c blocks and hat blocks
Oh, Code blocks are just inserting scratch block code, for example the code you put in scratchblocks tags, It's just a way for some things, I just did that for fun Umm… Code Blocks? What kind of code would we be dealing with? I hope the ST doesn't have to Invent a whole new language for this

- dhdguysg
-
100+ posts
Custom c blocks and hat blocks
Nice idea for scratchstarter, I'm gonna create one for RoScratch, since the project is gonna take lots of support Umm… Code Blocks? What kind of code would we be dealing with? I hope the ST doesn't have to Invent a whole new language for this
- cwrivera99
-
500+ posts
Custom c blocks and hat blocks
I support the c-loops thing, but there is a workaround for the hat blocks-
when gf clicked
forever
wait until <>
...
end
- dhdguysg
-
100+ posts
Custom c blocks and hat blocks
Um, we still need this feature because your when gf clicked code gets messy instead of just adding custom blocks which is kinda cleaner. I support the c-loops thing, but there is a workaround for the hat blocks-when gf clicked
forever
wait until <>
...
end
- dhdguysg
-
100+ posts
Custom c blocks and hat blocks
Well i could add c with else Support. Here's how the custom c-blocks could be created:
Just like the “add ___ input” under options, you could have an “add stack” option.
For example, for making a “while” block:while ([condition] :: custom-arg) {[stack1] :: custom-arg} :: custom-argSimilarly, you could have “add else”. This would add an else loop.
//would become
while () :: custom-arg cstart
end
//the definition:
repeat until <not<condition :: custom-arg>>
stack1 :: custom-arg
end
Couldn’t represent that properly because the “define” formatting is finicky.
you dont need to add a define for that, It'll just invert your function
while (mouse down?) :: custom cstart
...
else :: custom
...
end :: custom cned
- stickfiregames
-
1000+ posts
Custom c blocks and hat blocks
Support for custom c-blocks. Not sure about hats, because hats respond to events and all events already have a hat associated with them.
- ilikelegos
-
100+ posts
Custom c blocks and hat blocks
Hmm, might work. Maybe 99% percent support. I think this needs a few things worked out first. 

- Discussion Forums
- » Suggestions
-
» Custom c blocks and hat blocks