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

#176 2011-02-05 17:40:37

Zolk
New Scratcher
Registered: 2011-02-05
Posts: 4

Re: ITopic: Cool Source code tricks...

nvm figured out

Offline

 

#177 2011-03-26 16:47:01

JaysonNT
New Scratcher
Registered: 2011-02-14
Posts: 5

Re: ITopic: Cool Source code tricks...

I say in the Block Library a blockspec, which I understand, but what is that additional code?

Offline

 

#178 2011-03-26 17:47:43

Chrispaul
New Scratcher
Registered: 2011-03-26
Posts: 1

Re: ITopic: Cool Source code tricks...

New for me , but very interesting

_________________

Offline

 

#179 2011-03-27 07:33:07

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: ITopic: Cool Source code tricks...

JaysonNT wrote:

I say in the Block Library a blockspec, which I understand, but what is that additional code?

That is the code that makes the block function. It is called a "method."

Offline

 

#180 2011-03-29 19:07:47

gamer_6
Scratcher
Registered: 2010-07-20
Posts: 20

Re: ITopic: Cool Source code tricks...

i kind of feel stupid about this but... what's squeak?

Offline

 

#181 2011-03-30 09:04:37

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: ITopic: Cool Source code tricks...

gamer_6 wrote:

i kind of feel stupid about this but... what's squeak?

http://wiki.scratch.mit.edu/wiki/Squeak

Offline

 

#182 2011-04-20 05:17:32

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: ITopic: Cool Source code tricks...

complecated... but cool!


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#183 2011-05-07 23:19:05

mrsrec
Scratcher
Registered: 2010-11-14
Posts: 100+

Re: ITopic: Cool Source code tricks...

billyedward wrote:

This tutorial will give you a basic feel for the MIT squeak editor, and altering Scratch in general. I have tried to include numerous images and such to make it as clear as possible, but feel free to comment with any suggestions.

Let's begin with the blank gray screen of squeak. First left click on that gray, select “open…,” and select “Scratch/Streak”.
This opens a draggable-around Scratch/Streak window.
To resize hold alt and click on the window, and drag the “http://docs.google.com/File?id=dfbw6jtq_5dcbq9sgj_b”pin.
OK, now do the same as above, but this time select “browser” from the “open” list.
This opens the system browser, what most of the programming will go in to:
http://docs.google.com/File?id=dfbw6jtq_6g8wb8ffw_b
The little green circle allows you to resize this window. Just hover over the edge to get it. The X quits the window, the “O” minimizes, and the paper opens the window options. You’ll notice the 4 navigation panes above, and the coding pane below. These let you navigate and change the hierarchy of Scratch/Streak. The “instance|?|class”
Is for the 3 main categories. “Class” generally defines that an object exists, whereas instance defines what it does. ? is for comments, which don’t work. Lets get started. Navigate as follows: 1 Scratch-Objects, 2 ScriptableScratchMorph, 3 Class, 4 Scratch, 5 Blockspecs:
http://docs.google.com/File?id=dfbw6jtq_7g2h7smz6_b
See how I highlighted “(‘if %b’ #c #doIfElse)”? This is the basic syntax for defining the existence of a block. There is:
• opening bracket
• single quote
• The text to be displayed on the block, input areæ represented by %letter, such as %n is a numerical inserter, %b is Boolean. Here's the full list:

Code:

a:attribute of another sprite, such as X position or size.
b:a boolean inserter
c:a colour picker that shows the menu.
C:a colour picker that doesn't
d: the sprite direction menu/numerical inserter.
D: the menu for midi drums
e: The broadcast message menu
f: math function menu (with sin, abs, etc.)
g: menu for the different graphic effects.
h: numerical sensor board selector menu
H: boolean sensor board selector menu
i: midi instrument menu/numerical inserter
k: menu for the names of the different keys, used in the key sensor blocks.
l: menu with the costume names of the given sprite.
L: list name menu.
m: sprite list
n: numerical inserter
N: note name menu/inserter
s: string inserter
S: sound selector menu
v: variable labels menu
y: menu used to delete either a number of the last value or all of a list.

• Single quote
• “#” sign.
• Letter representing the block type, - being a normal command block, b is Boolean, r a reporter, c is a bar.
• “#” sign.
• Message to be corresponded in the instance side.
• This may be followed by Another one or few stand alone numbers, # followed by a number, or value in single quotes. These define the default value of the inserters.
• Closing bracket.
The message can also define special forms, such as the above’s corresponding function tells how to do the else bar.
What we now want to do is go over to “obsoleteBlockSpecs.”
Highlight each section…
http://docs.google.com/File?id=dfbw6jtq_8hgcctqcb_b
And Copy/Paste into the corresponding section of “blockSpecs”: (See that ‘numbers’ before? All following this will show under numbers.
http://docs.google.com/File?id=dfbw6jtq_9gp3qj8qg_b
Now right click “accept”
http://docs.google.com/File?id=dfbw6jtq_10fc4ndbhf_b
Et Voila! You’ve resurrected an “obsolete” block!
Repeat this process for the rest. These blocks will work in normal Scratch/Streak, they’ll just be red.
Now that we have the obsoletes’, lets try some other cheats. Go to:
1 Scratch-Objects, 2 ScratchSpriteMorph, 3 Class, 4 Scratch, 5 Blockspecs:
http://docs.google.com/File?id=dfbw6jtq_11gjcfqxhr_b
See in the single quotes of both where it’s says 'color'?
Change this to, say saturation: http://docs.google.com/File?id=dfbw6jtq_12mfv7z8j9_b
Which, when accepted, gives this: http://docs.google.com/File?id=dfbw6jtq_13dhrqhmfp_b, Which produces this:
http://docs.google.com/File?id=dfbw6jtq_14fhp7krfn_b
Neat,eh? Try setting it to blur, pointillize, or water as well!
One more thing: go back to 1 Scratch-Objects, 2 ScriptableScratchMorph, 3 Class, 4 Scratch, 5 Blockspecs, and find the equals block: http://docs.google.com/File?id=dfbw6jtq_15ftx4x6gx_b. See the
‘#- #-‘? This means that the two inserters will be blank. If, however, you put a string into them (replacing the dash), then they will be forced to hold it. How scratch does this is to “temporarily” make it a square string inserter. (http://docs.google.com/File?id=dfbw6jtq_16ck3hc4hb_b) You could also change the “%n” to a “%s” which is the “code” for a string inserter, but that would render it incompatible with normal Scratch/Streak. Using the above methods you can also make entirely new blocks: http://docs.google.com/File?id=dfbw6jtq_17zfzs5fgb_b
And force stuff into other blocks:
http://docs.google.com/File?id=dfbw6jtq_19g3fbvmhp_b

Another thing you can do is:
Drag a block out to the gray, and Alt+click it.
http://docs.google.com/File?id=dfbw6jtq_207s5gjkgp_b
Click the red menu icon, and select change colour…
Edit as you wish… And use in your Scripts!
http://docs.google.com/File?id=dfbw6jtq_21drvvf8ds_b
http://docs.google.com/File?id=dfbw6jtq_22dmrfrqdp_b
Certain other blocks can only easily be gotten by going to the version of Scratch/Streak it came from. The 1.2beta comment block is an example:
http://docs.google.com/File?id=dfbw6jtq_23crr4pwd4_b
It’ll show up red in everything after 1.1, gray in 1.2beta. It is obsolete before 1.2.

Hope this helps in your endeavor to utilise the scratch source code!
I will make a more advanced collection of information soon, for those who want to continue.

<when[ This Makes Sense ]

<change{ one of the things i've understood! }by(1)


This Makes No Sense  roll


Scratchy Scratcher Scratched Scratch Scratches When He Scratchy Scratches Scratch Projects. These Scratch Projects Were Started From Scratch.
http://internetometer.com/image/37716.png

Offline

 

#184 2011-05-08 10:15:54

MarioLuigi2009
Scratcher
Registered: 2009-12-26
Posts: 63

Re: ITopic: Cool Source code tricks...

I can't change the variable and list colors. Also, the top of every hat block stays the same.  hmm


http://mag.racked.eu/mcimage/i349/Achievement++get%21/Slammin+Salmon/mca.pnghttp://mag.racked.eu/mcimage/i5007/Achievement++get%21/Smile+for+the+camera/mca.pnghttp://mag.racked.eu/mcimage/i54/Achievement++get%21/Storin+dirt.../mca.pnghttp://www.minecraftanonymous.com/assets/banners/banner_78.png

Offline

 

#185 2011-05-09 16:42:18

legomany3448
Scratcher
Registered: 2010-08-30
Posts: 36

Re: ITopic: Cool Source code tricks...

Com'on, I want the real blocks!  Can you give me all the blockspecs and codes and stuff all at once?  I really want those blocks!  Please?!?   neutral

EDIT: Better yet, you could add them to my website at http://customblocks.weebly.com/scratch-blocks.html.  (Scroll to the bottom of the page.)

Last edited by legomany3448 (2011-05-09 16:46:17)


¿uʍop-ǝpısdn pɐǝɹ noʎ uɐɔ
Click here to get EPIC custom blocks on Scratch!

Offline

 

#186 2011-05-14 16:59:27

meowza
Scratcher
Registered: 2010-08-24
Posts: 11

Re: ITopic: Cool Source code tricks...

I changed the color of one of the blocks and made it transparent!

Offline

 

#187 2011-06-10 11:56:55

TuragaTreeko
Scratcher
Registered: 2011-04-24
Posts: 100+

Re: ITopic: Cool Source code tricks...

I only learned how to Squeak three days ago. And I have been at the block library a lot, and I would like to ask, in the library there is a block to change the color of the list watcher, but I need to know what I need to edit to turn it into a block to change the color of the variable watcher.

This is the list watcher color changer. What do I need to change to make it work for the variable watcher instead?

Blockspec:

    ('set the list blocks color to %c' #- #setListBlockColorSelf:)

Code: (place under sensing ops)

    setListBlockColorSelf: t1
        ListBlockColor _ t1


http://goo.gl/RDqKF

Offline

 

#188 2011-06-11 14:05:26

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: ITopic: Cool Source code tricks...

It only works because the list blocks' color is stored in a variable. If you edit Scratch-Objects -> ScriptableScratchMorph -> block specs -> blockSpecColorDic: (something like that) to change the variable block color, it will also change the watcher color.

Offline

 

#189 2011-06-13 19:23:27

pokemongardevoir
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: ITopic: Cool Source code tricks...

I don't have Scriptable Scratch Morph- Scratch- Blockspecs!


http://i48.tinypic.com/n50dt.gifhttp://tiny.cc/oj6plwhttp://tiny.cc/creepforum
My website has been approved by the Scratch Team.  (^_^)

Offline

 

#190 2011-06-19 15:40:30

pokemongardevoir
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: ITopic: Cool Source code tricks...

I tried adding a block and it didn't work!


http://i48.tinypic.com/n50dt.gifhttp://tiny.cc/oj6plwhttp://tiny.cc/creepforum
My website has been approved by the Scratch Team.  (^_^)

Offline

 

#191 2011-06-23 10:01:35

designer45
Scratcher
Registered: 2011-01-17
Posts: 500+

Re: ITopic: Cool Source code tricks...

What version of Scratch does this use, 1.2, 1.3, or 1.4?


http://www.uploadup.com/di-JOV6.jpg
Grr, I had no life outside of Miscellaneous. (lol jk) Click here to read my pokemon fanfiction! As of this update, jslomba has 2012 posts.

Offline

 

#192 2011-06-23 10:03:40

designer45
Scratcher
Registered: 2011-01-17
Posts: 500+

Re: ITopic: Cool Source code tricks...

pokemongardevoir wrote:

I tried adding a block and it didn't work!

You might not be using the correct version of Scratch.


http://www.uploadup.com/di-JOV6.jpg
Grr, I had no life outside of Miscellaneous. (lol jk) Click here to read my pokemon fanfiction! As of this update, jslomba has 2012 posts.

Offline

 

#193 2011-06-29 16:20:42

meowza
Scratcher
Registered: 2010-08-24
Posts: 11

Re: ITopic: Cool Source code tricks...

can you help me make a 'touching color any' block?

Offline

 

#194 2011-06-30 15:03:27

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: ITopic: Cool Source code tricks...

sad . Can you explain what the gray, select open means? I thought you meant file, then open and then select Scratch/Streak but it wasn't in there. What do you mean then?


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#195 2011-07-04 23:00:34

EzekielE
Scratcher
Registered: 2010-09-26
Posts: 100+

Re: ITopic: Cool Source code tricks...

Can someone tell me an easy way to add more options to when key pressed blocks. That will work online like in web wizard?


http://mag.racked.eu/cimage/i2260/Achievement++get%21/Find+a+Disk/mca.pnghttp://ezekielelin.com/1x1Gif/image.php

Offline

 

#196 2011-07-05 07:25:50

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: ITopic: Cool Source code tricks...

cool. i wanted to know how to do this so i can make a scratch mod and now i can!


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&amp;display=small

Offline

 

#197 2011-07-05 11:33:04

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: ITopic: Cool Source code tricks...

Saturated won't work. sad

Offline

 

#198 2011-07-07 18:40:45

Ur-86
Scratcher
Registered: 2009-08-20
Posts: 64

Re: ITopic: Cool Source code tricks...

This is so cool. It would be awesome if someone uploaded a project with all of these blocks

Offline

 

#199 2011-07-08 09:32:43

benjamindragonpants
Scratcher
Registered: 2011-03-03
Posts: 78

Re: ITopic: Cool Source code tricks...

Really cool (although my head hurts after reading this. lol)

Offline

 

#200 2011-07-08 21:50:31

poemon1
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: ITopic: Cool Source code tricks...

please, i need the blocks for my mod reply on 'i need help with my mod' topic, under advanced i will give MAJOR credit


http://i47.tinypic.com/rrqe13.gif

Offline

 

Board footer