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

#1001 2010-09-01 10:59:22

calebxy
Scratcher
Registered: 2009-12-31
Posts: 1000+

Re: Cool custom blocks in Scratch

I have no idea how to code in Squeak.  tongue


I'm making my own Doctor Who series!  big_smile  See the first episode here.
And please join Story Zone!  big_smile

Offline

 

#1002 2010-09-01 11:32:56

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

calebxy wrote:

I have no idea how to code in Squeak.  tongue

We're here to help  smile


/* No comment */

Offline

 

#1003 2010-09-01 11:40:31

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

Code:

showMenu: t1 
    | t2 t3 t4 t5 t6 t7 |
    t2 _ self listNamed: t1 ifNone: [^ ''].
    t3 _ self lineCountOfList: t2.
    t4 _ 1.
    t5 _ CustomMenu new.
    t3
        timesRepeat: 
            [t6 _ self getLine: t4 ofList: t2.
            t5 add: t6 asString action: t6.
            t4 _ t4 + 1].
    t5 localize.
    t7 _ t5 startUp.
    ^ t7

This takes the name of a list as an argument and displays a menu containing the items in the list. However, the menu never displays and it just reports nil. Can anybody fix it?

Last edited by TheSuccessor (2010-09-01 11:40:59)


/* No comment */

Offline

 

#1004 2010-09-01 14:27:45

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

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

TheSuccessor wrote:

Code:

spriteExists: t1
World submorphsDo:
   [:t2 | t2 isKindOf: ScratchSpriteMorph ifTrue: [t2 objName = t1 ifTrue: [^ true]]].
   ^ false

I think this would work but as I haven't tried it I don't know.

Thank you. I'll test the code.

It didn't work. I changed it to

Code:

spriteExists: t1
| t87 |
t87 _ self ownerThatIsA: ScratchFrameMorph.
t87 submorphsDo:
   [:t2 | (t2 isKindOf: ScratchSpriteMorph) ifTrue: [(t2 objName = t1) ifTrue: [^ true]]].
   ^ false

and it still didn't work. It always says false. I think that this is closer. Can you help?

Last edited by Billybob-Mario (2010-09-01 14:47:23)

Offline

 

#1005 2010-09-01 16:25:22

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

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

Code:

spriteExists: t1
World submorphsDo:
   [:t2 | t2 isKindOf: ScratchSpriteMorph ifTrue: [t2 objName = t1 ifTrue: [^ true]]].
   ^ false

I think this would work but as I haven't tried it I don't know.

I would try

Code:

spriteExists: n
((ScriptableScratchMorph, ScriptableScratchMorph allSubClasses) collect: [:c | c allInstances]) do: [:m | m objName = n ifTrue: [^ true]].
   ^ false

Last edited by nXIII (2010-09-01 16:26:03)


nXIII

Offline

 

#1006 2010-09-01 17:18:45

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

Re: Cool custom blocks in Scratch

nXIII wrote:

TheSuccessor wrote:

Code:

spriteExists: t1
World submorphsDo:
   [:t2 | t2 isKindOf: ScratchSpriteMorph ifTrue: [t2 objName = t1 ifTrue: [^ true]]].
   ^ false

I think this would work but as I haven't tried it I don't know.

I would try

Code:

spriteExists: n
((ScriptableScratchMorph, ScriptableScratchMorph allSubclasses) collect: [:c | c allInstances]) do: [:m | m objName = n ifTrue: [^ true]].
   ^ false

It says Error

Last edited by Billybob-Mario (2010-09-01 17:19:21)

Offline

 

#1007 2010-09-01 19:02:20

kinker
Scratcher
Registered: 2010-08-01
Posts: 100+

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

Code:

spriteExists: t1
World submorphsDo:
   [:t2 | t2 isKindOf: ScratchSpriteMorph ifTrue: [t2 objName = t1 ifTrue: [^ true]]].
   ^ false

I think this would work but as I haven't tried it I don't know.

Whats the block spec?
<when green flag clicked>
<go to[ my profile
<forever>
<play sound[ come to my profile!
<change{ users who went to my profile }by(1
<end>


Put in the weirdness: http://i54.tinypic.com/zl6fph.pnghttp://img821.imageshack.us/i/gobanim2.gif/kinker style! [url]http://internetometer.com/image/16724.png[/url]♬♫ 92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature. ♫♪

Offline

 

#1008 2010-09-01 20:02:14

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

Re: Cool custom blocks in Scratch

kinker wrote:

TheSuccessor wrote:

Code:

spriteExists: t1
World submorphsDo:
   [:t2 | t2 isKindOf: ScratchSpriteMorph ifTrue: [t2 objName = t1 ifTrue: [^ true]]].
   ^ false

I think this would work but as I haven't tried it I don't know.

Whats the block spec?
<when green flag clicked>
<go to[ my profile
<forever>
<play sound[ come to my profile!
<change{ users who went to my profile }by(1
<end>

That really doesn't matter; I used

Code:

('sprite %s exists?' #b #spriteExists: 'Sprite1')

Offline

 

#1009 2010-09-01 20:29:36

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

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

nXIII wrote:

TheSuccessor wrote:

Code:

spriteExists: t1
World submorphsDo:
   [:t2 | t2 isKindOf: ScratchSpriteMorph ifTrue: [t2 objName = t1 ifTrue: [^ true]]].
   ^ false

I think this would work but as I haven't tried it I don't know.

I would try

Code:

spriteExists: n
((ScriptableScratchMorph, ScriptableScratchMorph allSubclasses) collect: [:c | c allInstances]) do: [:m | m objName = n ifTrue: [^ true]].
   ^ false

It says Error

I got it to work with

Code:

spriteExists: n
ScratchSpriteMorph allInstancesDo: [:m | m objName = n ifTrue: [^ true]].
   ^ false

Thank you for the help. How would I make a block that adds a costume to a sprite from a costume block that reports a costume?

Last edited by Billybob-Mario (2010-09-01 20:34:47)

Offline

 

#1010 2010-09-02 14:49:26

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

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

Billybob-Mario wrote:

nXIII wrote:


I would try

Code:

spriteExists: n
((ScriptableScratchMorph, ScriptableScratchMorph allSubclasses) collect: [:c | c allInstances]) do: [:m | m objName = n ifTrue: [^ true]].
   ^ false

It says Error

I got it to work with

Code:

spriteExists: n
ScratchSpriteMorph allInstancesDo: [:m | m objName = n ifTrue: [^ true]].
   ^ false

Thank you for the help. How would I make a block that adds a costume to a sprite from a costume block that reports a costume?

You deleted the thing I purposely added. You got it wrong:

Code:

spriteExists: n
(({ScriptableScratchMorph}, ScriptableScratchMorph allSubclasses) collect: [:c | c allInstances]) do: [:m | m objName = n ifTrue: [^ true]].
   ^ false

nXIII

Offline

 

#1011 2010-09-02 14:56:33

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: Cool custom blocks in Scratch

nXIII wrote:

Billybob-Mario wrote:

Billybob-Mario wrote:


It says Error

I got it to work with

Code:

spriteExists: n
ScratchSpriteMorph allInstancesDo: [:m | m objName = n ifTrue: [^ true]].
   ^ false

Thank you for the help. How would I make a block that adds a costume to a sprite from a costume block that reports a costume?

You deleted the thing I purposely added. You got it wrong:

Code:

spriteExists: n
(({ScriptableScratchMorph}, ScriptableScratchMorph allSubclasses) collect: [:c | c allInstances]) do: [:m | m objName = n ifTrue: [^ true]].
   ^ false

The code before worked perfect, but your code is in the way, tricking scratchers to use the wrong code.


Marzipan11 must learn to not spoil

Offline

 

#1012 2010-09-02 18:06:38

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

Re: Cool custom blocks in Scratch

Now I'm trying to make a block that takes a reporter block for an image and makes that into a costume and adds it to the sprite. Can anyone help?

Offline

 

#1013 2010-09-02 20:59:14

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Cool custom blocks in Scratch

Um, how do you plan on setting a reporter to a picture?


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#1014 2010-09-02 22:08:20

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

Re: Cool custom blocks in Scratch

Just modifying the preview, it doesn't care what the return value is.
Warning: costumes are not Forms.


nXIII

Offline

 

#1015 2010-09-03 08:24:48

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

Re: Cool custom blocks in Scratch

nXIII wrote:

Just modifying the preview, it doesn't care what the return value is.
Warning: costumes are not Forms.

That's why I got so many errors with mine...

Offline

 

#1016 2010-09-03 13:32:19

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

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

Now I'm trying to make a block that takes a reporter block for an image and makes that into a costume and adds it to the sprite. Can anyone help?

that's actually a really good idea - i looked over that post not thinking it important, but now that i get what you're trying to do it's very interesting. tat could be something to work on for Bingo 1.2.1...

Offline

 

#1017 2010-09-03 14:08:12

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

Re: Cool custom blocks in Scratch

LS97 wrote:

Billybob-Mario wrote:

Now I'm trying to make a block that takes a reporter block for an image and makes that into a costume and adds it to the sprite. Can anyone help?

that's actually a really good idea - i looked over that post not thinking it important, but now that i get what you're trying to do it's very interesting. tat could be something to work on for Bingo 1.2.1...

I already have the costume reporters, now I'm trying to make an [add [ '' ] to costumes] block. [ '' ] is the costume slot representation.

Offline

 

#1018 2010-09-03 14:31:55

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

Re: Cool custom blocks in Scratch

Why not just make reporters which report costumes?


nXIII

Offline

 

#1019 2010-09-03 15:52:15

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: Cool custom blocks in Scratch

sensor yellowButtonPressed or blueButtonPressed doesn't work for me


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#1020 2010-09-03 19:13:00

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

Re: Cool custom blocks in Scratch

nXIII wrote:

Why not just make reporters which report costumes?

I already have. BYOB made that easy. Now I need to have it add these to costumes. I'll post a secret 1.1 beta to help explain. http://dl.dropbox.com/u/6509165/Slash%2 … Beta.image Look at blocks such as 'self'.

Last edited by Billybob-Mario (2010-09-03 19:24:59)

Offline

 

#1021 2010-09-03 20:24:14

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

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

nXIII wrote:

Why not just make reporters which report costumes?

I already have. BYOB made that easy. Now I need to have it add these to costumes. I'll post a secret 1.1 beta to help explain. http://dl.dropbox.com/u/6509165/Slash%2 … Beta.image Look at blocks such as 'self'.

No, I'm saying, you don't NEED a new block shape, just use old-fashioned reporters.


nXIII

Offline

 

#1022 2010-09-04 11:45:07

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

Re: Cool custom blocks in Scratch

nXIII wrote:

Billybob-Mario wrote:

nXIII wrote:

Why not just make reporters which report costumes?

I already have. BYOB made that easy. Now I need to have it add these to costumes. I'll post a secret 1.1 beta to help explain. http://dl.dropbox.com/u/6509165/Slash%2 … Beta.image Look at blocks such as 'self'.

No, I'm saying, you don't NEED a new block shape, just use old-fashioned reporters.

I want to make it easier to not have errors. What I need now is a block for:

[add (costume) to costumes]

where (costume) is the costume slot.

Offline

 

#1023 2010-09-04 14:16:49

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

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

nXIII wrote:

Why not just make reporters which report costumes?

I already have. BYOB made that easy. Now I need to have it add these to costumes. I'll post a secret 1.1 beta to help explain. http://dl.dropbox.com/u/6509165/Slash%2 … Beta.image Look at blocks such as 'self'.

i had a look at Slash 1.1 Beta and it's got loads of blocks copied from Bingo. too bad mostof those you added dont work  lol
but please code the cursor one yourself.  mad

Offline

 

#1024 2010-09-04 15:14:11

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Cool custom blocks in Scratch

Billybob-Mario wrote:

nXIII wrote:

Why not just make reporters which report costumes?

I already have. BYOB made that easy. Now I need to have it add these to costumes. I'll post a secret 1.1 beta to help explain. http://dl.dropbox.com/u/6509165/Slash%2 … Beta.image Look at blocks such as 'self'.

Very secret now, isn't it...  big_smile


/* No comment */

Offline

 

#1025 2010-09-04 15:26:50

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

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

Billybob-Mario wrote:

nXIII wrote:

Why not just make reporters which report costumes?

I already have. BYOB made that easy. Now I need to have it add these to costumes. I'll post a secret 1.1 beta to help explain. http://dl.dropbox.com/u/6509165/Slash%2 … Beta.image Look at blocks such as 'self'.

Very secret now, isn't it...  big_smile

tongue  I was just thinking that...


nXIII

Offline

 

Board footer