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

#326 2010-05-14 23:25:53

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

Re: Cool custom blocks in Scratch

ps BEST FORUM EVER! i learned soooooo much. THANKS


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

Offline

 

#327 2010-05-14 23:28:38

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

Re: Cool custom blocks in Scratch

how would i fix a glitch in my mod? when i load a project with a 'forever' block, it turns into a 'repeat until obsolete' block. please help! do i have to make a 'compadability mode' like billeyedward's STREAK mod?


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

Offline

 

#328 2010-05-15 03:00:44

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Cool custom blocks in Scratch

Joeman592 wrote:

comp500 wrote:

Can i have:

create sprite [] run code
         (code)
<end>

With the spec?
It creates a sprite named[] and runs the code on it.
Comp500:)

i think the creat sprite is good and then with code would be good too. I'll try to make em but im not very good with squeak so LS97 or nXIII will also have to do it. They are MUCH MUCH(times 9999999999999999999999) better than me.

Me too.


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#329 2010-05-15 03:57:55

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

Re: Cool custom blocks in Scratch

comp500 wrote:

Joeman592 wrote:

comp500 wrote:

Can i have:

create sprite [] run code
         (code)
<end>

With the spec?
It creates a sprite named[] and runs the code on it.
Comp500:)

i think the creat sprite is good and then with code would be good too. I'll try to make em but im not very good with squeak so LS97 or nXIII will also have to do it. They are MUCH MUCH(times 9999999999999999999999) better than me.

Me too.

hmm... use nXIII's script to duplicate it, and then add that broadcast bit to run on clones only. that should be close enough to wha you want

Offline

 

#330 2010-05-15 06:40:15

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Cool custom blocks in Scratch

LS97 wrote:

comp500 wrote:

Joeman592 wrote:

i think the creat sprite is good and then with code would be good too. I'll try to make em but im not very good with squeak so LS97 or nXIII will also have to do it. They are MUCH MUCH(times 9999999999999999999999) better than me.

Me too.

hmm... use nXIII's script to duplicate it, and then add that broadcast bit to run on clones only. that should be close enough to wha you want

Where is the duplicate script? that'll b way cool:)
EDIT:Nevermind.
Comp500

Last edited by comp500 (2010-05-15 12:13:33)


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#331 2010-05-15 08:25:28

Jakey22
Scratcher
Registered: 2008-12-28
Posts: 72

Re: Cool custom blocks in Scratch

Sperry wrote:

Jakey22 wrote:

I need some code for a  <[] contains []> block.

I think it is:

Code:

if: t1 contains: t2
^ (t1 findString: t2)

Does that work?

I tried it and it didn't work, although I might have written the block-specs wrong. also, it is supposed to be a boolean.


http://www.imagebookers.com/gallery/d/2561-1/ubuntu-wallpaper.png http://bullylug.org/linux-penguin.jpg
My website       PENGUINS!!!!!!!!!!!!!!!!!!!!! randomness.

Offline

 

#332 2010-05-15 08:28:03

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: Cool custom blocks in Scratch

Jakey22 wrote:

Sperry wrote:

Jakey22 wrote:

I need some code for a  <[] contains []> block.

I think it is:

Code:

if: t1 contains: t2
^ (t1 findString: t2)

Does that work?

I tried it and it didn't work, although I might have written the block-specs wrong. also, it is supposed to be a boolean.

Code:

if: t1 contains: t2
if (t1 findString: t2) then
^ true
else
^ false

That should work...


http://i46.tinypic.com/dw7zft.png

Offline

 

#333 2010-05-15 08:59:02

pyrodon
Scratcher
Registered: 2010-03-27
Posts: 6

Re: Cool custom blocks in Scratch

Joeman592 wrote:

pyrodon wrote:

Joeman592 wrote:

put it in sensing. Scratch-objects, scritpable sprite(or stage, put it in both)morph, sensing. Put the code in blah blah blah, then go to class and make the spec. do it again for the stage/sprite morph(if you did one or the other first) if you want it to be a bounce at te end, put it in motion.

I tried, but I get the error:

Code:

 Message not understood: Bounds
Symbol(Object)>>error:
[] in PasteUpMorph>>runStepMethods
[] in BlockContext>>ifError:
Symbol(Object)>>error:
Symbol(Object)>>doesNotUnderstand:
ScratchSpriteMorph>>sprite:touching:
ReporterBlockMorph(CommandBlockMorph)>>evaluateWithArgs:
ScratchProcess>>applyPrimitive
ScratchProcess>>evaluateCommandFor:
ScratchProcess>>evaluateFor:

Maybe I have the wrong codes or something. Anyone know a code that they are sure works?

well... i dont... anyway, i don't get what this code is. could you put the actual code without the error messages? then we can see if its wrong

Ok, sorry. Here it is:

Code:

 

sprite: t1 touching: t2 
    | t3 |
    t3 _ t1 bounds intersect: t2 bounds.
    (t3 width > 0 and: [t3 height > 0])
        ifTrue: [^ true].
    ^ false

I got it from LS97's post on page 2. Maybe I even have the block spec wrong, but I'm pretty sure it's right. Plus, the "Bounds" error doesn't seem to have anything to do with a wrong block spec.

Offline

 

#334 2010-05-15 11:28:07

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

Re: Cool custom blocks in Scratch

pyrodon wrote:

Joeman592 wrote:

pyrodon wrote:


I tried, but I get the error:

Code:

 Message not understood: Bounds
Symbol(Object)>>error:
[] in PasteUpMorph>>runStepMethods
[] in BlockContext>>ifError:
Symbol(Object)>>error:
Symbol(Object)>>doesNotUnderstand:
ScratchSpriteMorph>>sprite:touching:
ReporterBlockMorph(CommandBlockMorph)>>evaluateWithArgs:
ScratchProcess>>applyPrimitive
ScratchProcess>>evaluateCommandFor:
ScratchProcess>>evaluateFor:

Maybe I have the wrong codes or something. Anyone know a code that they are sure works?

well... i dont... anyway, i don't get what this code is. could you put the actual code without the error messages? then we can see if its wrong

Ok, sorry. Here it is:

Code:

 

sprite: t1 touching: t2 
    | t3 |
    t3 _ t1 bounds intersect: t2 bounds.
    (t3 width > 0 and: [t3 height > 0])
        ifTrue: [^ true].
    ^ false

I got it from LS97's post on page 2. Maybe I even have the block spec wrong, but I'm pretty sure it's right. Plus, the "Bounds" error doesn't seem to have anything to do with a wrong block spec.

came up with an error for me too. Hmmm.... LS97, could you try to fix it?


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

Offline

 

#335 2010-05-15 11:37:22

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Cool custom blocks in Scratch

ScratchReallyROCKS wrote:

no instance needed

WHY MUST YOU REFER TO THEM AS INSTANCES?!

Gosh, people, learn your vocab! Instances are objects with classes as their data types!

It's called a message or a method.


nXIII

Offline

 

#336 2010-05-15 12:12:57

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Cool custom blocks in Scratch

nXIII wrote:

ScratchReallyROCKS wrote:

no instance needed

WHY MUST YOU REFER TO THEM AS INSTANCES?!

Gosh, people, learn your vocab! Instances are objects with classes as their data types!

It's called a message or a method.

Where's your duplicate code,nXIII?
Comp500

Last edited by comp500 (2010-05-15 12:14:28)


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#337 2010-05-15 17:45:49

Catwalk923
Scratcher
Registered: 2010-01-30
Posts: 47

Re: Cool custom blocks in Scratch

Joeman592 wrote:

Catwalk923 wrote:

HELP!!! I can't find the code grabFromScreen!!! How do I add it? I tried the block, but it does not know what #grabFromSceen means! HELP!!!

are you using scratch 1.3 or 1.4 it might matter. also, try just copying and pasting if you didn't already do that

I have 1.4, and copy what???


ılıll|̲̅̅●̲̅̅|̲̅̅=̲̅̅|̲̅̅●̲̅̅|llılı

Offline

 

#338 2010-05-15 17:57:18

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Cool custom blocks in Scratch

nXIII wrote:

ScratchReallyROCKS wrote:

no instance needed

WHY MUST YOU REFER TO THEM AS INSTANCES?!

Gosh, people, learn your vocab! Instances are objects with classes as their data types!

It's called a message or a method.

Than why is the tab in the VM called 'instances'


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#339 2010-05-15 18:01:59

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Cool custom blocks in Scratch

ScratchReallyROCKS wrote:

nXIII wrote:

ScratchReallyROCKS wrote:

no instance needed

WHY MUST YOU REFER TO THEM AS INSTANCES?!

Gosh, people, learn your vocab! Instances are objects with classes as their data types!

It's called a message or a method.

Than why is the tab in the VM called 'instances'

It's called "instance". BIG DIFFERENCE!


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

#340 2010-05-15 18:06:50

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Cool custom blocks in Scratch

MathWizz wrote:

It's called "instance". BIG DIFFERENCE!

Forget I asked


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#341 2010-05-15 19:25:02

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

Re: Cool custom blocks in Scratch

"'create sprite with name []'" block? and if that is possible, how about "'create sprite with name [] and code' #c" AND how about "'create sprite with name [] , code,' #c and draw costume'" that might be too much... but please try cuz i cant make em


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

Offline

 

#342 2010-05-15 22:08:23

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Cool custom blocks in Scratch

ScratchReallyROCKS wrote:

nXIII wrote:

ScratchReallyROCKS wrote:

no instance needed

WHY MUST YOU REFER TO THEM AS INSTANCES?!

Gosh, people, learn your vocab! Instances are objects with classes as their data types!

It's called a message or a method.

Than why is the tab in the VM called 'instances'

instance, and that means they are INSTANCE METHODS. That means they are specific to an instance, rather than class methods, which are sent to the class itself, not an instance.


nXIII

Offline

 

#343 2010-05-16 03:21:15

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Cool custom blocks in Scratch

Catwalk923 wrote:

Joeman592 wrote:

Catwalk923 wrote:

HELP!!! I can't find the code grabFromScreen!!! How do I add it? I tried the block, but it does not know what #grabFromSceen means! HELP!!!

are you using scratch 1.3 or 1.4 it might matter. also, try just copying and pasting if you didn't already do that

I have 1.4, and copy what???

are you running the code in the stage?? if you are try using it in a sprite.

Last edited by comp500 (2010-05-16 03:22:36)


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#344 2010-05-16 05:41:38

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

Re: Cool custom blocks in Scratch

too lazy too find the quote...
the sprite touching sprite reports if two sprites are touching, but it cant be the sprite the code's in and it cant be the mouse, nor can it be blank. otherwise it works. 100% sure about it.

Offline

 

#345 2010-05-16 16:25:40

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

Re: Cool custom blocks in Scratch

PANTHER IS OUT!!!

It lets you go into the code to find how a block is made.

Sadly, the "received?" block doesn't work, so we'll have to go without it until the panther team fixes the bug. I might add that a lot of the watchers cause an error  tongue

Anyway, this is really exciting!!!  big_smile


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

Offline

 

#346 2010-05-16 17:57:25

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

Re: Cool custom blocks in Scratch

so what would be a code for forever if else?


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

Offline

 

#347 2010-05-16 18:05:12

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: Cool custom blocks in Scratch

randalpik wrote:

PANTHER IS OUT!!!

It lets you go into the code to find how a block is made.

Sadly, the "received?" block doesn't work, so we'll have to go without it until the panther team fixes the bug. I might add that a lot of the watchers cause an error  tongue

Anyway, this is really exciting!!!  big_smile

It does work, like this:

When =/ clicked
broadcast something


When I receive something
wait (5)

PUT HAT HERE
wait until something is recieved
DO SOMETHING HERE


After the 'when I receive ___" script is done, it reports false, that's what wait 5 is for.


http://i46.tinypic.com/dw7zft.png

Offline

 

#348 2010-05-16 18:06:23

climber59
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: Cool custom blocks in Scratch

<forever>
<if>
<else>
<end>

Just put an if-else in a forever loop.

Last edited by climber59 (2010-05-16 18:06:53)


Check out my projects if you have a chance.

Offline

 

#349 2010-05-16 18:56:50

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

Re: Cool custom blocks in Scratch

When Sep explained it, I think I get it now.

Ok, here is the code (credit to Panther team, I guess that I have to say that now that Sep is monitoring the forum. Oh, and nxIII threatened to sue me if I didn't put this: "Panther is developed by the scratch users Sparks, nXIII, Sperry, SeptimusHeap, MathWizz, and Markyparky56 and is based on Scratch from the MIT media labs." I mean, seriously? Do I really have to put all the members of the panther team? Anyway...):

Code:

eventReceivedNamed: t1 
    | t2 t3 |
    self isSprite ifTrue: [^ (self ownerThatIsA: ScratchStageMorph)
            eventReceivedNamed: t1].
    t2 _ self scripts
                select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]].
    t2 _ t2 asOrderedCollection.
    self
        submorphsDo: [:t5 | (t5 isKindOf: ScriptableScratchMorph)
                ifTrue: [(t5 scripts
                        select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]])
                        do: [:t6 | t2 _ t2 copyWith: t6]]].
    t3 _ t2 select: [:t4 | t4 scratchProc notNil].
    ^ t3 size > 0

And, for the squeak noobs in the forum, here is the spec:

Code:

('%e received?' #b #eventReceivedNamed:)

That should work. I didn't test the spec.

Last edited by randalpik (2010-05-16 21:08:03)


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

Offline

 

#350 2010-05-16 21:06:04

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

Re: Cool custom blocks in Scratch

nXIII wrote:

I think you have to say that because I CAN SUE YOU IF YOU DON'T

ok, ok (edits post) but still, you can't sue me:
(1) you don't know where I live
(2) I'm under 18
(3) panther is free anyway


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

Offline

 

Board footer