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

#151 2010-04-30 18:13:18

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

Re: Cool custom blocks in Scratch

Sparkyasa wrote:

What's the code for the (ascii for[])?

um... asciiFor:


nXIII

Offline

 

#152 2010-04-30 21:31:23

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

Re: Cool custom blocks in Scratch

LS97 wrote:

randalpik wrote:

Ok... so I got rid of the scripts that you said to, and then I alt-clicked the button to duplicate. I alt-clicked on the new button, clicked "change arguments", typed in "dialogs" (that's what I wanted) but the text didn't change. I tried to do that by alt-clicking again and clicking "change label". It gave me an error.

the dialog bit is fine, that's what you need to do. to change the label you need to first drag it around, then shift-click the label and type in what you want. then make sure you embed it into the scratchViewerMorph

I got it a lot farther than before, but I have three questions:

1) how do you embed it in ScratchViewerMorph? When I save the image for end-user and reopen Scratch, the button disappears, although the code's still there.

2) how do you change the color of the button itself?

3) how do you make it so that the button is colored in when it's selected, and not colored in when it's not (like the other buttons)?


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

Offline

 

#153 2010-05-01 03:04:22

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

Re: Cool custom blocks in Scratch

randalpik wrote:

I got it a lot farther than before, but I have three questions:

1) how do you embed it in ScratchViewerMorph? When I save the image for end-user and reopen Scratch, the button disappears, although the code's still there.

2) how do you change the color of the button itself?

3) how do you make it so that the button is colored in when it's selected, and not colored in when it's not (like the other buttons)?

1) that's why you have to embed it. go re-fetch the button from under the scratch window (drag it out of the way) then re-position it where you want, click the red menu button and click embed. then choose ScratchViewerMorph.

2) ask nXIII. i'm also interested in this.

3) to take away the permanent highlight just select the ImageMorph and delete it.

Offline

 

#154 2010-05-01 05:49:10

ypoora
Scratcher
Registered: 2010-01-23
Posts: 7

Re: Cool custom blocks in Scratch

ls,scratch says cursor exists and t1 is false i can choose nil,thiscontext,or true?
Could yo remake the link block code for me?  smile

Offline

 

#155 2010-05-01 07:01:27

Sparkyasa
Scratcher
Registered: 2008-06-27
Posts: 24

Re: Cool custom blocks in Scratch

nXIII wrote:

Sparkyasa wrote:

What's the code for the (ascii for[])?

um... asciiFor:

What's the Squeak code for it? And where should I put the code?


http://internetometer.com/image/12201.png

Offline

 

#156 2010-05-01 07:11:06

Sparkyasa
Scratcher
Registered: 2008-06-27
Posts: 24

Re: Cool custom blocks in Scratch

How do you know where to put the code for blocks?

Last edited by Sparkyasa (2010-05-01 07:22:52)


http://internetometer.com/image/12201.png

Offline

 

#157 2010-05-01 07:21:46

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

Re: Cool custom blocks in Scratch

Sparkyasa wrote:

How do you know where to put blocks?

somewhere before that point should say the category..

Offline

 

#158 2010-05-01 07:23:32

Sparkyasa
Scratcher
Registered: 2008-06-27
Posts: 24

Re: Cool custom blocks in Scratch

LS97 wrote:

Sparkyasa wrote:

How do you know where to put blocks?

somewhere before that point should say the category..

not the specs, the code

Last edited by Sparkyasa (2010-05-01 07:24:47)


http://internetometer.com/image/12201.png

Offline

 

#159 2010-05-01 07:28:30

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

Re: Cool custom blocks in Scratch

ypoora wrote:

ls,scratch says cursor exists and t1 is false i can choose nil,thiscontext,or true?
Could yo remake the link block code for me?  smile

here's a more detailed one then....
in ScriptableScratchMorph, class, blockSpecs, blockSpecks, under the 'control' category, put this code:

Code:

 ('link to %s' #- #doLink: 'http://scratch.mit.edu/')

into the instance section, under 'other ops', replace the code of 'boradcast:' with this:

Code:

doLink: t1 
    Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]

dont worry, you won't overwrite the broadcast block. then turn fillscreen on, try out your new block, and if it works save image for end-user.
Happy linking!

Offline

 

#160 2010-05-01 11:07:59

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

Re: Cool custom blocks in Scratch

LS97 wrote:

randalpik wrote:

I got it a lot farther than before, but I have three questions:

1) how do you embed it in ScratchViewerMorph? When I save the image for end-user and reopen Scratch, the button disappears, although the code's still there.

2) how do you change the color of the button itself?

3) how do you make it so that the button is colored in when it's selected, and not colored in when it's not (like the other buttons)?

1) that's why you have to embed it. go re-fetch the button from under the scratch window (drag it out of the way) then re-position it where you want, click the red menu button and click embed. then choose ScratchViewerMorph.

2) ask nXIII. i'm also interested in this.

3) to take away the permanent highlight just select the ImageMorph and delete it.

OK, I embedded it.

But how do I delete the ImageMorph?


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

Offline

 

#161 2010-05-01 11:25:03

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

Re: Cool custom blocks in Scratch

randalpik wrote:

OK, I embedded it.

But how do I delete the ImageMorph?

select it first and then click the pale pink X 'dismiss'.

Offline

 

#162 2010-05-01 11:35:12

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

Re: Cool custom blocks in Scratch

LS97 wrote:

randalpik wrote:

OK, I embedded it.

But how do I delete the ImageMorph?

select it first and then click the pale pink X 'dismiss'.

OK, thanks!

LS97 wrote:

2) ask nXIII. i'm also interested in this.

There, I asked him. Not like he's going to reply soon. But it's worth a try.


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

Offline

 

#163 2010-05-01 12:03:41

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

Re: Cool custom blocks in Scratch

Sparkyasa wrote:

nXIII wrote:

Sparkyasa wrote:

What's the code for the (ascii for[])?

um... asciiFor:

What's the Squeak code for it? And where should I put the code?

That's an already-existing message, if you don't want it to recognize things like 'space' then you have to make a new message
__________________________________________

randalpik wrote:

I got it a lot farther than before, but I have three questions:

1) how do you embed it in ScratchViewerMorph? When I save the image for end-user and reopen Scratch, the button disappears, although the code's still there.

2) how do you change the color of the button itself?

3) how do you make it so that the button is colored in when it's selected, and not colored in when it's not (like the other buttons)?

randalpik, I am REALLY recommending that you edit the message 'rebuildCategorySelectors' rather than listening to LS97 because he/she doesn't really know how to fix the layout and make the ScratchFrameMorph automatically rebuild itself WITH the new category. Here is my tutorial:
OK, first download ScratchSkin.zip and unzip it to the root folder. Next, copy three images of any category and rename them to your taste (dialogs, dialogsOver, dialogsPressed). Edit them using some color effect tool to make them whatever color you want.
Then reload the skin (see the comment in ScratchFrameMorph's readSkinFrom:).
Lastly, edit the 'rebuildCategorySelectors' method in ScratchViewerMorph and add an even number of categories to the catList definition.

Last edited by nXIII (2010-05-01 12:04:09)


nXIII

Offline

 

#164 2010-05-01 12:11:35

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

Re: Cool custom blocks in Scratch

nXIII wrote:

randalpik, I am REALLY recommending that you edit the message 'rebuildCategorySelectors' rather than listening to LS97 because he/she doesn't really know how to fix the layout and make the ScratchFrameMorph automatically rebuild itself WITH the new category. Here is my tutorial:
OK, first download ScratchSkin.zip and unzip it to the root folder. Next, copy three images of any category and rename them to your taste (dialogs, dialogsOver, dialogsPressed). Edit them using some color effect tool to make them whatever color you want.
Then reload the skin (see the comment in ScratchFrameMorph's readSkinFrom:).
Lastly, edit the 'rebuildCategorySelectors' method in ScratchViewerMorph and add an even number of categories to the catList definition.

It's too late.... I've already deleted the rebuildCategorySelectors according to LS97's instructions, and redownloading Scratch would mean creating those 27 or such new blocks that I compiled all over again.

So taking that into account, do you know how to change the color of the buttons using LS97's method?


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

Offline

 

#165 2010-05-01 14:45:38

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

Re: Cool custom blocks in Scratch

randalpik wrote:

nXIII wrote:

randalpik, I am REALLY recommending that you edit the message 'rebuildCategorySelectors' rather than listening to LS97 because he/she doesn't really know how to fix the layout and make the ScratchFrameMorph automatically rebuild itself WITH the new category. Here is my tutorial:
OK, first download ScratchSkin.zip and unzip it to the root folder. Next, copy three images of any category and rename them to your taste (dialogs, dialogsOver, dialogsPressed). Edit them using some color effect tool to make them whatever color you want.
Then reload the skin (see the comment in ScratchFrameMorph's readSkinFrom:).
Lastly, edit the 'rebuildCategorySelectors' method in ScratchViewerMorph and add an even number of categories to the catList definition.

It's too late.... I've already deleted the rebuildCategorySelectors according to LS97's instructions, and redownloading Scratch would mean creating those 27 or such new blocks that I compiled all over again.

So taking that into account, do you know how to change the color of the buttons using LS97's method?

I am sorry, I will not/cannot help you. My advice: next time, listen to people who actually know their way around the Scratch source code, like Jens, billyedward, or me.


nXIII

Offline

 

#166 2010-05-01 18:07:22

TheGameMaster1231
Scratcher
Registered: 2009-07-24
Posts: 1000+

Re: Cool custom blocks in Scratch

<pick random(  )to(

nXIII wrote:

Sparkyasa wrote:

You're right that the <when i receive[message\/]> would be impossible, but I think [wait until I receive [message\/]] would be possible.

No ... nothing's impossible given time ... but anyways, that actually is quite possible. Without excess time.

Really!?!? Do You Have Any Idea How You Could Make It!?!? I NEED IT!!!!

Offline

 

#167 2010-05-01 18:27:18

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

Re: Cool custom blocks in Scratch

TheGameMaster1231 wrote:

<pick random(  )to([/blocks]

nXIII wrote:

Sparkyasa wrote:

You're right that the <when i receive[message\/]> would be impossible, but I think [wait until I receive [message\/]] would be possible.

No ... nothing's impossible given time ... but anyways, that actually is quite possible. Without excess time.

Really!?!? Do You Have Any Idea How You Could Make It!?!? I NEED IT!!!!

You don't need it, and why the <pick random(  )to([/blocks]


nXIII

Offline

 

#168 2010-05-01 21:35:43

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

Re: Cool custom blocks in Scratch

LS97 wrote:

2) ask nXIII. i'm also interested in this.

He says that we're all doing it wrong and blah blah blah and instead of deleting the rebuildCategorySelectors we should have added to it and blah blah blah. In conclusion, I will try to figure it out myself.


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

Offline

 

#169 2010-05-01 22:27:49

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

Re: Cool custom blocks in Scratch

LOL! I'm creating a normal scratch game and I suddenly have the urge to format my variables as Squeak instances, like stampingLevel: and waitingForSpace: xD


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

Offline

 

#170 2010-05-02 03:20:15

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

Re: Cool custom blocks in Scratch

Sparkyasa wrote:

LS97 wrote:

Sparkyasa wrote:

How do you know where to put blocks?

somewhere before that point should say the category..

not the specs, the code

oh. where you feel like it.

Offline

 

#171 2010-05-02 03:47:43

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

Re: Cool custom blocks in Scratch

hmm... nXIII, i know you're a great Squeaker and i love your show/hide list blocks, but why come onto this thread if you don't like the solutions i find? i'm not trying to make you go away, just saying that you're a bit too... know-it-all. "LS97 did this wrong, that wrong, do this, do that, do it my way it's the good way..."

anyway. where are the images stored?
by the way, i'm a he

Last edited by LS97 (2010-05-02 03:49:08)

Offline

 

#172 2010-05-02 08:55:33

Sparkyasa
Scratcher
Registered: 2008-06-27
Posts: 24

Re: Cool custom blocks in Scratch

LS97 wrote:

Sparkyasa wrote:

LS97 wrote:


somewhere before that point should say the category..

not the specs, the code

oh. where you feel like it.

so it doesn't matter wether you put it in ScratchSpriteMorph, ScratchStageMorph, or ScriptableScratchMorph? and does it matter which one you put the specs in?


http://internetometer.com/image/12201.png

Offline

 

#173 2010-05-02 09:07:23

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

Re: Cool custom blocks in Scratch

Sparkyasa wrote:

so it doesn't matter wether you put it in ScratchSpriteMorph, ScratchStageMorph, or ScriptableScratchMorph? and does it matter which one you put the specs in?

well if you put the spec in spriteMorph then the code has to be in either sprite or scratchMorph. and the spec matters: if you put it in spriteMorph it will show up only in sprites, in stage only in stage, and scratch in everything

Offline

 

#174 2010-05-02 10:28:09

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

Re: Cool custom blocks in Scratch

nXIII wrote:

TheGameMaster1231 wrote:

<pick random(  )to([/blocks]

nXIII wrote:


No ... nothing's impossible given time ... but anyways, that actually is quite possible. Without excess time.

Really!?!? Do You Have Any Idea How You Could Make It!?!? I NEED IT!!!!

You don't need it, and why the <pick random(  )to([/blocks]

Well? could you? because i might need it. it depends.


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

Offline

 

#175 2010-05-02 10:57:29

Sparkyasa
Scratcher
Registered: 2008-06-27
Posts: 24

Re: Cool custom blocks in Scratch

what should the specs be for a block that returns a boolean value that you enter: <<>>


http://internetometer.com/image/12201.png

Offline

 

Board footer