Discuss Scratch
- Discussion Forums
- » Suggestions
- » Custom c blocks and hat blocks
- dhdguysg
- Scratcher
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
- Scratcher
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
- Scratcher
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
- Scratcher
100+ posts
Custom c blocks and hat blocks
I definetly support this! It'd make scratch so much nicer to use.
-Photoguy77
“Without enjoying, one will never truly learn” ~Flome
“Finding happiness starts in you” ~ProdigyZeta7
- dhdguysg
- Scratcher
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
- Scratcher
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
- Scratcher
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:
- RPFluffy
- Scratcher
1000+ posts
Custom c blocks and hat blocks
Nice suggestions!
Support!
Support!
Nothing Is EVER 100%, that is just an assumption.
Some important links: Here and here or need help click Here. Eats followers, Loves helping people.
My “..” and “…” are not spelling mistakes, it means that they are ways of telling someone that I can continue more about it and that the sentence isn't ended the best way. I like putting new indents and lines so I can split up what I am talking about.
Some important links: Here and here or need help click Here. Eats followers, Loves helping people. Check this MMO out! Kiwi = Support WHAT THAT'S IMPOSSIBLE: Through the drop down ;)if <> :: control cstart
else :: control
end
- Epicness123
- Scratcher
1000+ posts
Custom c blocks and hat blocks
Semi-support
Sadly, my kumquats were eaten by an evil forum signature.
- dhdguysg
- Scratcher
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
- Scratcher
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
- Scratcher
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
when this block is clicked::sensing hat//FYI, this is my old account that I no longer use. My current account is @DaSpudLord.If you are reading this… Then congratulations! You have found the part of my signature that was eaten by a kumquat! (On a side note, you are probably in a kumquat's stomach.) Now get out of the kumquat's stomach and go do something productive with your life. Like playing this game over and over again. Very productive.
forever {do (a [scratch v]::events ring)::sound}::extension cstart
say [what the...?] in (the language of [the moon people v]::red)::control
create [spontaneous v] explosion in [a flea's stomach]::motion
That's not right...::cend
- dhdguysg
- Scratcher
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
- Scratcher
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
- ilikelegos
- Scratcher
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.
Hi! I'm a computer science student who learned coding on Scratch!
- Discussion Forums
- » Suggestions
- » Custom c blocks and hat blocks