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

#576 2010-06-06 15:08:40

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

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

nXIII wrote:

TheSuccessor wrote:

Code:

pointColor: t1
World activeHand showTemporaryCursor: ((Form extent: 5 @ 5 depth: 32) fillColor: t1)

Put this in a custom block spec with a color picker in it. You'll see it works, but when you use it in full screen (but not in normal) and click it makes nasty grey squares come up on the stage. Can anybody fix it?

Yes, the presenter detects damage done and limits redrawing to that area, the cursor may be messing that up; I also find that temporary cursors are deleted when clicking a ScratchPresenterMorph.

I found it works if you give the stage this script:

when stage clicked
set pointer color to [ ].

How would you code this into the method?

In ScratchPresenterMorph's mouseDown: method, I believe (if it has one...)


nXIII

Offline

 

#577 2010-06-06 16:48:00

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

Re: Cool custom blocks in Scratch

midnightleopard wrote:

Bingo is my favourite mod because panther has to many cool but useless features. Bingo has just what I want!

thanks for the great compliment!
i hope you all are enjoying Bingo!

Offline

 

#578 2010-06-06 16:49:58

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

Re: Cool custom blocks in Scratch

Zorbak42 wrote:

Anyone know if it's possible to convert a project made with a mod of Scratch into a .exe and have the mod's extra blocks work? (and if so, how?) I haven't tried, but I assume Jens' Scratch2Exe doesn't work on projects made with mods?

sure!
i have one already made for my customized version of Scratch (i use it for silvisoft silver) although havent thouht of making one for bingo. i can make it as soon as i get home from france (on holiday) and i'll get back to you soon!
(btw, its really easy in fact)

Offline

 

#579 2010-06-06 17:08:27

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

Re: Cool custom blocks in Scratch

Oh, cool! How do you make one? I'd like to make one for my mod.

Offline

 

#580 2010-06-06 17:38:20

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

Re: Cool custom blocks in Scratch

LS97 wrote:

Zorbak42 wrote:

Anyone know if it's possible to convert a project made with a mod of Scratch into a .exe and have the mod's extra blocks work? (and if so, how?) I haven't tried, but I assume Jens' Scratch2Exe doesn't work on projects made with mods?

sure!
i have one already made for my customized version of Scratch (i use it for silvisoft silver) although havent thouht of making one for bingo. i can make it as soon as i get home from france (on holiday) and i'll get back to you soon!
(btw, its really easy in fact)

PLEASE TELL. this would be good if, lets say, you wanted to upload it to addictinggames or something


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

Offline

 

#581 2010-06-06 20:38:41

bigreader
Scratcher
Registered: 2007-08-14
Posts: 100+

Re: Cool custom blocks in Scratch

nXIII wrote:

OK, fine, here is the entire tutorial:
[replace (something) with your category name throughout this entire tutorial]
1. Add (something).gif, (something)Over.gif, and (something)Pressed.gif to the ScratchSkin folder IN THE ROOT DIRECTORY (wherever the VM is).
2. In the VM, open a new workspace (World menu -> open... -> workspace) and type

ScratchFrameMorph readSkinFrom: (FileDirectory default directoryNamed: 'ScratchSkin')

(if this doesn't work your ScratchSkin directory isn't in the right place or isn't named ScratchSkin)
3. Go to ScratchViewerMorph's rebuildCategorySelectors method and add (something) to the end of the small array definition (which looks like this:)

catList _ #(
        motion        control
        looks                sensing
        sound        operators
        pen            variables
        (something)).

Note: In order for the extent (size) of the category buttons to be correctly calculated, I have slightly modified the line that assigns to catButtonsExtent (the ugly arithmetic-looking one):

catButtonsExtent _ ((2 * maxExtent x) + (3 * pad)) @ ((((catList size / 2) rounded) * (maxExtent y + 6)) + 25).

I get several "Unknown Variable - Please correct, or cancel" errors. I went through the first couple with my best guesses, but I don't want to destroy my personal mod! if you could help, that would be awesome!  smile


I'm currently taking a break from Scratch.
Zing - now even easier to install!

Offline

 

#582 2010-06-07 00:32:44

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

Re: Cool custom blocks in Scratch

catagory tutorial that makes sense please!  yikes   smile

Code:

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

PLEASE wrote:

please? i NEED one! mad

Last edited by Joeman592 (2010-06-07 00:38:23)


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

Offline

 

#583 2010-06-07 07:04:08

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Cool custom blocks in Scratch

Joeman592 wrote:

catagory tutorial that makes sense please!  yikes   smile

Code:

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

PLEASE wrote:

please? i NEED one! mad

That's as much sense as it's going to make. If you can't handle the source code, then don't make a mod.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#584 2010-06-07 12:41:38

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

Re: Cool custom blocks in Scratch

nXIII wrote:

TheSuccessor wrote:

nXIII wrote:


Yes, the presenter detects damage done and limits redrawing to that area, the cursor may be messing that up; I also find that temporary cursors are deleted when clicking a ScratchPresenterMorph.

I found it works if you give the stage this script:

when stage clicked
set pointer color to [ ].

How would you code this into the method?

In ScratchPresenterMorph's mouseDown: method, I believe (if it has one...)

In order to do this, I would need to check if the mouse was a 5x5 square. How would I detect this?


/* No comment */

Offline

 

#585 2010-06-07 12:43:08

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

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

TheSuccessor wrote:

How can you do the opposite of (ascii for []) i.e. (from ascii [])?  hmm

Important. xCubed 1.0.0 is nearly finished, and I want this block in it. Also, how do you publish your own version of Scratch?

Tell me, please.


/* No comment */

Offline

 

#586 2010-06-07 13:43:55

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Cool custom blocks in Scratch

henley wrote:

Joeman592 wrote:

catagory tutorial that makes sense please!  yikes   smile

Code:

AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

PLEASE wrote:

please? i NEED one! mad

That's as much sense as it's going to make. If you can't handle the source code, then don't make a mod.

Thats a brillant reason. Iv been so wanting to tell people that!


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#587 2010-06-07 15:13:36

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

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

TheSuccessor wrote:

TheSuccessor wrote:

How can you do the opposite of (ascii for []) i.e. (from ascii [])?  hmm

Important. xCubed 1.0.0 is nearly finished, and I want this block in it. Also, how do you publish your own version of Scratch?

Tell me, please.

PLEASE!!!


/* No comment */

Offline

 

#588 2010-06-07 16:51:06

feet
Scratcher
Registered: 2009-07-24
Posts: 21

Re: Cool custom blocks in Scratch

Joeman592 wrote:

N-e-e-d-a-c-a-t-a-g-o-r-y-l-e-s-s-o-n

Me too and I D K what they're talking about  mad


Everything is blasphemy until it's proven wrong. -Feet

Offline

 

#589 2010-06-08 13:57:25

taddl
Scratcher
Registered: 2009-03-08
Posts: 100+

Re: Cool custom blocks in Scratch

record sound = recordSound


http://blocks.scratchr.org/API.php?action=projects&type=newest&return=image&user=taddl
http://blocks.scratchr.org/API.php?user=taddl&action=projects&type=newest&return=text&num=1

Offline

 

#590 2010-06-08 15:15:24

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

Re: Cool custom blocks in Scratch

TheSuccessor wrote:

TheSuccessor wrote:

TheSuccessor wrote:

How can you do the opposite of (ascii for []) i.e. (from ascii [])?  hmm

Important. xCubed 1.0.0 is nearly finished, and I want this block in it. Also, how do you publish your own version of Scratch?

Tell me, please.

PLEASE!!!


/* No comment */

Offline

 

#591 2010-06-10 04:10:16

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

Re: Cool custom blocks in Scratch

Zorbak42 wrote:

Anyone know if it's possible to convert a project made with a mod of Scratch into a .exe and have the mod's extra blocks work? (and if so, how?) I haven't tried, but I assume Jens' Scratch2Exe doesn't work on projects made with mods?

ok!
i'm back and ready to tell you!
take Jens' sratch2exe 'compiler' folder.
go to 'kit'.
this folder is similar to the scratch one, don't you agree?
rename runtime.image to runtime.backup
add you own image and rename it runtime.image
important! this image should be a COPY of the original, not dragged into the folder.
open that image in scratch.exe by dragging it onto it.
open the system browser in your program.
go to ui-panes, frameMorph, menu/button actions, quitScratch, and replace that code with

Code:

 quitScratch
    self closeMediaEditorsAndDialogs ifFalse: [^ self].
    self stopAll.
    Smalltalk snapshot: false andQuit: true

and click accept.
save the image, and try it on a project made with your mod!

Last edited by LS97 (2010-06-10 04:10:56)

Offline

 

#592 2010-06-10 05:32:18

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

Re: Cool custom blocks in Scratch

another little question...
how do you code a C block?

Offline

 

#593 2010-06-10 12:23:40

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

Re: Cool custom blocks in Scratch

LS97 wrote:

another little question...
how do you code a C block?

m, kay...

('blah %b blah'              c               #someSelector)

or

('blah $Boolean$ blah'   c                #someSelector)

if you use my modded version of blockspecs (which I am just about to put in a changeset file and hand out to people in a bit).

Next, go to Scratch-Execution Engine -> ScratchProcess -> private-special-forms

and add a new method there, called someSelector or whatever you used. I can't give you much of a tutorial on doing this because they are special form (AKA have special evaluation rules) and so don't have much of a common structure. My best advice is to look at the other methods in that category.


nXIII

Offline

 

#594 2010-06-10 13:10:20

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

Re: Cool custom blocks in Scratch

nXIII wrote:

LS97 wrote:

another little question...
how do you code a C block?

m, kay...

('blah %b blah'              c               #someSelector)

or

('blah $Boolean$ blah'   c                #someSelector)

if you use my modded version of blockspecs (which I am just about to put in a changeset file and hand out to people in a bit).

Next, go to Scratch-Execution Engine -> ScratchProcess -> private-special-forms

and add a new method there, called someSelector or whatever you used. I can't give you much of a tutorial on doing this because they are special form (AKA have special evaluation rules) and so don't have much of a common structure. My best advice is to look at the other methods in that category.

ok, i'm one step further thanks to you. but i still can't figure out a couple of things:
1. how can you get the data from the block (i.e. the %b from example above)
2. how do you run the nested scripts?

Offline

 

#595 2010-06-10 13:13:32

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

Re: Cool custom blocks in Scratch

LS97; a question for you:

You submitted spme code to the Panther blockshop for the $String$ contains $String$. I saw that the code was the same as mine and you also said you had it in Bingo. Did you make it yourself, or copy mine from earlier in this topic? Don't worry, I am not angry, just curious.


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

Offline

 

#596 2010-06-10 13:15:25

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

Re: Cool custom blocks in Scratch

Sperry wrote:

LS97; a question for you:

You submitted spme code to the Panther blockshop for the $String$ contains $String$. I saw that the code was the same as mine and you also said you had it in Bingo. Did you make it yourself, or copy mine from earlier in this topic? Don't worry, I am not angry, just curious.

lol. i figured it out myself. it's not really hard to guess when the squeak command is what you would expect!

now can you answer my other question?

Last edited by LS97 (2010-06-10 13:17:42)

Offline

 

#597 2010-06-10 13:19:26

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

Re: Cool custom blocks in Scratch

LS97 wrote:

Sperry wrote:

LS97; a question for you:

You submitted spme code to the Panther blockshop for the $String$ contains $String$. I saw that the code was the same as mine and you also said you had it in Bingo. Did you make it yourself, or copy mine from earlier in this topic? Don't worry, I am not angry, just curious.

lol. i figured it out myself. it's not really hard to guess when the squeak command is what you would expect!

now can you answer my other question?

Ok. I dont know the answer to your other question, Ive never programmed C-Blocks. Sorry  sad


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

Offline

 

#598 2010-06-10 13:29:47

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

Re: Cool custom blocks in Scratch

LS97 wrote:

nXIII wrote:

LS97 wrote:

another little question...
how do you code a C block?

m, kay...

('blah %b blah'              c               #someSelector)

or

('blah $Boolean$ blah'   c                #someSelector)

if you use my modded version of blockspecs (which I am just about to put in a changeset file and hand out to people in a bit).

Next, go to Scratch-Execution Engine -> ScratchProcess -> private-special-forms

and add a new method there, called someSelector or whatever you used. I can't give you much of a tutorial on doing this because they are special form (AKA have special evaluation rules) and so don't have much of a common structure. My best advice is to look at the other methods in that category.

ok, i'm one step further thanks to you. but i still can't figure out a couple of things:
1. how can you get the data from the block (i.e. the %b from example above)
2. how do you run the nested scripts?

1. try this code:

Code:

block _ stackFrame expression.
args _ stackFrame arguments.

"evaluate the arguments if we haven't yet"
args size < block argumentCount ifTrue: [^ self evaluateNextArgument].

And the evaluated arguments are stored in "args" as an array.

2. try this code:

Code:

"pop the block itself of the stack"
self popStackFrame.

"evaluate the body (first nested block body)"
self pushStackFrame: (ScratchStackFrame new expression: block firstBlockList).

nXIII

Offline

 

#599 2010-06-10 13:34:06

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

Re: Cool custom blocks in Scratch

@nXIII:
thanks!

although, i have one more question. how do you make the nested blocks repeat until a boolean comes true?

Last edited by LS97 (2010-06-10 15:30:25)

Offline

 

#600 2010-06-10 16:38:37

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

Re: Cool custom blocks in Scratch

oh, and unless you will be including the 'when %b is true' in panther,
can i have some help on how to make it?

Offline

 

Board footer