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

#76 2010-04-22 11:23:55

randalpik
Scratcher
Registered: 2008-07-27
Posts: 82

Re: Cool custom blocks in Scratch

I can't figure out how to make the Graphic effect reporter block... can someone help?


My stuff: http://scratch.mit.edu/users/randalpik
Your face: Look at a gopher

Offline

 

#77 2010-04-22 12:01:58

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

randalpik wrote:

I can't figure out how to make the Graphic effect reporter block... can someone help?

Here it is just quickly. i've got hw to do now!

Code:

getEffect: t1 
    filterPack ifNil: [^ 0].
    'blur' = t1 ifTrue: [^ filterPack blur].
    'brightness' = t1 ifTrue: [^ filterPack brightnessShift].
    'fisheye' = t1 ifTrue: [^ filterPack fisheye].
    'color' = t1 ifTrue: [^ filterPack hueShift].
    'colour' = t1 ifTrue: [^ filterPack hueShift].
    'mosaic' = t1 ifTrue: [^ filterPack mosaicCount].
    'pixelate' = t1 ifTrue: [^ filterPack pixelateCount].
    'pointillize' = t1 ifTrue: [^ filterPack pointillizeSize].
    'saturation' = t1 ifTrue: [^ filterPack saturationShift].
    'transparency' = t1 | ('ghost' = t1) ifTrue: [^ self transparency].
    'whirl' = t1 ifTrue: [^ filterPack whirl]

Hope it helps.

Offline

 

#78 2010-04-22 17:06:50

roger-
Scratcher
Registered: 2010-02-13
Posts: 100+

Re: Cool custom blocks in Scratch

Can you make a show/hide timer block? It should be simple...  I am only a beginner at hacking scratch so I might not be able to make it (right now I am looking at the "stuff" of the show/hide variable/list block


Food is Fat. Fat is power.
        I am almighty.

Offline

 

#79 2010-04-22 17:15:59

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Cool custom blocks in Scratch

Just set a variable to the timer and use the hide/show variable blocks.


You can now reach me on Twitter @johnnydean1_

Offline

 

#80 2010-04-22 21:39:15

randalpik
Scratcher
Registered: 2008-07-27
Posts: 82

Re: Cool custom blocks in Scratch

LS97 wrote:

randalpik wrote:

I can't figure out how to make the Graphic effect reporter block... can someone help?

Here it is just quickly. i've got hw to do now!

Code:

getEffect: t1 
    filterPack ifNil: [^ 0].
    'blur' = t1 ifTrue: [^ filterPack blur].
    'brightness' = t1 ifTrue: [^ filterPack brightnessShift].
    'fisheye' = t1 ifTrue: [^ filterPack fisheye].
    'color' = t1 ifTrue: [^ filterPack hueShift].
    'colour' = t1 ifTrue: [^ filterPack hueShift].
    'mosaic' = t1 ifTrue: [^ filterPack mosaicCount].
    'pixelate' = t1 ifTrue: [^ filterPack pixelateCount].
    'pointillize' = t1 ifTrue: [^ filterPack pointillizeSize].
    'saturation' = t1 ifTrue: [^ filterPack saturationShift].
    'transparency' = t1 | ('ghost' = t1) ifTrue: [^ self transparency].
    'whirl' = t1 ifTrue: [^ filterPack whirl]

Hope it helps.

Thanks! I now have 18 hacked blocks  big_smile


My stuff: http://scratch.mit.edu/users/randalpik
Your face: Look at a gopher

Offline

 

#81 2010-04-23 11:02:44

roger-
Scratcher
Registered: 2010-02-13
Posts: 100+

Re: Cool custom blocks in Scratch

johnnydean1 wrote:

Just set a variable to the timer and use the hide/show variable blocks.

Duh! *smacks face*


Food is Fat. Fat is power.
        I am almighty.

Offline

 

#82 2010-04-23 19:50:09

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Cool custom blocks in Scratch

I am trying to make a Clone with name block. It doesn't work. The block looks right, but the function doesn't work. Here is my code:

Code:

cloneWithName: t1 
    | frame stage clone |
    (frame _ self ownerThatIsA: ScratchFrameMorph)
        ifNil: 
            [(frame _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self].
            frame _ frame frame].
    stage _ frame workPane.
    clone _ ScriptableScratchMorph duplicateNoAttach.
    clone objName: self objName , '(t1)'.
    stage addMorphFront: t1

Offline

 

#83 2010-04-23 20:31:44

randalpik
Scratcher
Registered: 2008-07-27
Posts: 82

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

I am trying to make a Clone with name block. It doesn't work. The block looks right, but the function doesn't work. Here is my code:

Code:

cloneWithName: t1 
    | frame stage clone |
    (frame _ self ownerThatIsA: ScratchFrameMorph)
        ifNil: 
            [(frame _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self].
            frame _ frame frame].
    stage _ frame workPane.
    clone _ ScriptableScratchMorph duplicateNoAttach.
    clone objName: self objName , '(t1)'.
    stage addMorphFront: t1

Is the instance in ScriptableScratchMorph?


My stuff: http://scratch.mit.edu/users/randalpik
Your face: Look at a gopher

Offline

 

#84 2010-04-24 03:52:41

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

I am trying to make a Clone with name block. It doesn't work. The block looks right, but the function doesn't work. Here is my code:

Hmm... that doesnt work for me either, but i can't really help you because Scratch just felt like not running that block anymore and no matter what i do it's not running. i hate it when it's so stubborn :p

Offline

 

#85 2010-04-24 07:15:52

Billybob-Mario
Scratcher
Registered: 2008-01-05
Posts: 500+

Re: Cool custom blocks in Scratch

I'm trying to make a clone with name block. It doesn't work. Can anyone help? Here is my code.

Code:

cloneWithName: t1 
    | frame stage clone |
    (frame _ self ownerThatIsA: ScratchFrameMorph)
        ifNil: 
            [(frame _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self].
            frame _ frame frame].
    stage _ frame workPane.
    clone _ ScriptableScratchMorph duplicateNoAttach.
    clone objName: self objName , '(t1)'.
    stage addMorphFront: t1
clone eventReceived: 'Created'.

Offline

 

#86 2010-04-25 12:37:06

Joeman592
Scratcher
Registered: 2010-01-23
Posts: 100+

Re: Cool custom blocks in Scratch

How do I script the control blocks?


http://i.imgur.com/HcAj1.png
http://i.imgur.com/gss7S.gifhttp://i.imgur.com/kbcKt.gifhttp://i.imgur.com/0LteM.gif

Offline

 

#87 2010-04-25 18:09:05

N-Wear
Scratcher
Registered: 2007-08-13
Posts: 100+

Re: Cool custom blocks in Scratch

Nice!


If bread crumbs are better than nothing. And nothing is better than cheese cake. Then, bread crumbs are better than cheese cake!  smile
The following sentence is true. The previous sentence is false.  hmm                              Treat others the way you want to be treated!  big_smile

Offline

 

#88 2010-04-25 20:24:05

randalpik
Scratcher
Registered: 2008-07-27
Posts: 82

Re: Cool custom blocks in Scratch

LS97 wrote:

There's many more types of hat blocks, but i won't include them all.

Actually there's only one more.

Code:

 #E  the "when I receive" hat block

My stuff: http://scratch.mit.edu/users/randalpik
Your face: Look at a gopher

Offline

 

#89 2010-04-25 20:32:18

randalpik
Scratcher
Registered: 2008-07-27
Posts: 82

Re: Cool custom blocks in Scratch

I'm making a tutorial project which goes into the different elements of the source code in more detail. I'll tell you when it's out.

P.S. where's 14 in your signature?  big_smile

Last edited by randalpik (2010-04-25 20:33:14)


My stuff: http://scratch.mit.edu/users/randalpik
Your face: Look at a gopher

Offline

 

#90 2010-04-25 21:18:29

killubear
Scratcher
Registered: 2009-07-14
Posts: 7

Re: Cool custom blocks in Scratch

can some one help me on this...

well i found how to add a inv on the function block in oporators but i cant find the script to make it work

Offline

 

#91 2010-04-26 10:42:41

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

randalpik wrote:

I'm making a tutorial project which goes into the different elements of the source code in more detail. I'll tell you when it's out.

It would be very helpful to include it in this tutorial as a link! please tell me when you're done, thanks!

Last edited by LS97 (2010-04-26 11:53:23)

Offline

 

#92 2010-04-26 13:22:13

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

please, experienced Squeak-ers, how do you handle a 'down key pressed' event for non-block related stuff, like the scolling bars? (hint hint: i'm working on Bingo and trying to make a different scrolling method)

Offline

 

#93 2010-04-26 15:42:27

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Cool custom blocks in Scratch

Hmm - I'm looking at the list in the first post, and the only blocks which I think could be made in BYOB are lowercased (and probably uppercased) and reversed blocks...

Either way, awesome guide!

Last edited by Lucario621 (2010-04-26 15:42:44)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#94 2010-04-26 16:55:16

t-boy
Scratcher
Registered: 2008-05-15
Posts: 21

Re: Cool custom blocks in Scratch

nXIII wrote:

Cloning blocks:
(yay, I made these)
Somewhat simplified because you don't have to send it an event, like Panther.

cloneMe
    | frame stage clone |
    (frame _ self ownerThatIsA: ScratchFrameMorph) ifNil: [(frame _ self ownerThatIsA: OffscreenWorldMorph) ifNil: [^ self] ifNotNil: [frame _ frame frame]].
    stage _ frame workPane.
    clone _ self fullCopy.
    clone objName: (self objName), ' clone'.
    stage addMorphFront: clone.

If you want to send it a broadcast message, add the line

clone eventReceived: 'Created'.

to the end and if the sprite has a 'when I receive [Created]' that will start (in the clone) when it is cloned.
It might not work, I did that off of memory, not copy-paste. (This isn't my computer)

it worked for me...but it isn't very useful because it just acts as a movable stamp. i could drag it manually, but i couldn't control the clone with move ten steps or whatever. it also doesn't go to (0,0).
p.s pretty impressive you can do that off the top of your head.

Offline

 

#95 2010-04-26 20:16:18

recycle49
Scratcher
Registered: 2009-12-21
Posts: 1000+

Re: Cool custom blocks in Scratch

I cant make the blocks, i go to my broser then go through all the steps, but were do i paste the code?


"Every challenge must be met, every battle must be won, and every story will end." -Me
Recycle49 December 09 - November 11 Goodbye

Offline

 

#96 2010-04-26 21:13:20

Zorbak42
Scratcher
Registered: 2009-01-27
Posts: 100+

Re: Cool custom blocks in Scratch

Can you post tutorials for [] reversed and [] uppercase please? Thanks.  wink

Offline

 

#97 2010-04-27 07:45:42

rocket101
Scratcher
Registered: 2009-08-21
Posts: 500+

Re: Cool custom blocks in Scratch

How do you make a (report __) block?

Offline

 

#98 2010-04-27 07:49:12

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: Cool custom blocks in Scratch

recycle49 wrote:

I cant make the blocks, i go to my broser then go through all the steps, but were do i paste the code?

Alt+V, not Ctrl+V.


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#99 2010-04-27 11:43:26

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Cool custom blocks in Scratch

rocket101 wrote:

How do you make a (report __) block?

why would you want to make that?

Offline

 

#100 2010-04-27 11:47:01

Sperry
Scratcher
Registered: 2010-03-09
Posts: 500+

Re: Cool custom blocks in Scratch

LS97 wrote:

rocket101 wrote:

How do you make a (report __) block?

why would you want to make that?

Hmm.. I don't know, unless they wanted to report a boolean.


http://img709.imageshack.us/img709/3252/gobanim2.gifhttp://ls.gd/bo

Offline

 

Board footer