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

#226 2012-05-13 08:19:04

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Block Files

dreamod wrote:

Greenatic wrote:

Dreamod, I tried filing in your patch and got a "Message not understood: scanFrom:" error.   hmm   Do I need to file it into a new Scratch image or my Block Library image?

whoops, I have one exclamation marks too many! Too bad I can't edit my posts, well remove the first exclamation mark on the second line, that should do the trick.

So this is the new patch, fixed?

Code:

'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 13 May 2012 at 11:49:13 am'!
BlockMorph subclass: #CommandBlockMorph
    instanceVariableNames: 'isStop commandSpec argPermutation argMorphs titleMorph receiver selector isReporter isTimed wantsName wantsPossession numberArgFlags '
    classVariableNames: 'ArgMorphsDictionary NotWatcherBlocks '
    poolDictionaries: ''
    category: 'Scratch-Blocks'!
!CommandBlockMorph methodsFor: 'private' stamp: 'dreamod 5/13/2012 11:45'!
isStop
    ^ isStop! !

!CommandBlockMorph methodsFor: 'private' stamp: 'dreamod 5/13/2012 11:45'!
isStop: t1
       isStop _ t1! !

!ScriptableScratchMorph methodsFor: 'blocks' stamp: 'dreamod 5/13/2012 11:48'!
blockFromSpec: t1 color: t2 
    | t3 t4 t5 t6 t7 t8 t9 |
    t3 _ ScratchTranslator translationFor: (t1 at: 1).
    t9 _ CommandBlockMorph argPermutationForSpec: (t1 at: 1)
                withTranslation: t3.
    t4 _ t1 at: 2.
    t5 _ (t1 at: 3) asSymbol.
    t6 _ self defaultArgsFor: t1.
    (#(#E #K #M #S #W ) includes: t4)
        ifTrue: [^ (self hatBlockType: t4)
                color: t2].
    (t4 includes: $c)
        ifTrue: [t5 = #doIfElse
                ifTrue: [t7 _ IfElseBlockMorph new isSpecialForm: true]
                ifFalse: [t7 _ CBlockMorph new isSpecialForm: true]]
        ifFalse: [(t4 includes: $r)
                | (t4 includes: $b)
                ifTrue: [t7 _ ReporterBlockMorph new]
                ifFalse: [t7 _ CommandBlockMorph new]].
    (t4 includes: $b)
        ifTrue: [t7 isBoolean: true].
    (t4 includes: $s)
        ifTrue: [t7 isSpecialForm: true].
    (t4 includes: $u)
        ifTrue: [t7 isStop: true].
        (t4 includes: $y)
        ifTrue: [t7 isStop: true; isSpecialForm: true].
    (t4 includes: $t)
        ifTrue: [t7 isTimed: true].
    (ScriptableScratchMorph isSpriteSpecificTarget: self selector: t5)
        ifTrue: [t8 _ self]
        ifFalse: [t8 _ self ownerThatIsA: ScratchStageMorph].
    ^ t7 argPermutation: t9;
     color: t2;
     selector: t5;
     commandSpec: t3;
     defaultArgs: t6;
     receiver: t8! !

Offline

 

#227 2012-05-13 08:23:34

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Greenatic wrote:

dreamod wrote:

Greenatic wrote:

Dreamod, I tried filing in your patch and got a "Message not understood: scanFrom:" error.   hmm   Do I need to file it into a new Scratch image or my Block Library image?

whoops, I have one exclamation marks too many! Too bad I can't edit my posts, well remove the first exclamation mark on the second line, that should do the trick.

So this is the new patch, fixed?

Code:

'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 13 May 2012 at 11:49:13 am'!
BlockMorph subclass: #CommandBlockMorph
    instanceVariableNames: 'isStop commandSpec argPermutation argMorphs titleMorph receiver selector isReporter isTimed wantsName wantsPossession numberArgFlags '
    classVariableNames: 'ArgMorphsDictionary NotWatcherBlocks '
    poolDictionaries: ''
    category: 'Scratch-Blocks'!
!CommandBlockMorph methodsFor: 'private' stamp: 'dreamod 5/13/2012 11:45'!
isStop
    ^ isStop! !

!CommandBlockMorph methodsFor: 'private' stamp: 'dreamod 5/13/2012 11:45'!
isStop: t1
       isStop _ t1! !

!ScriptableScratchMorph methodsFor: 'blocks' stamp: 'dreamod 5/13/2012 11:48'!
blockFromSpec: t1 color: t2 
    | t3 t4 t5 t6 t7 t8 t9 |
    t3 _ ScratchTranslator translationFor: (t1 at: 1).
    t9 _ CommandBlockMorph argPermutationForSpec: (t1 at: 1)
                withTranslation: t3.
    t4 _ t1 at: 2.
    t5 _ (t1 at: 3) asSymbol.
    t6 _ self defaultArgsFor: t1.
    (#(#E #K #M #S #W ) includes: t4)
        ifTrue: [^ (self hatBlockType: t4)
                color: t2].
    (t4 includes: $c)
        ifTrue: [t5 = #doIfElse
                ifTrue: [t7 _ IfElseBlockMorph new isSpecialForm: true]
                ifFalse: [t7 _ CBlockMorph new isSpecialForm: true]]
        ifFalse: [(t4 includes: $r)
                | (t4 includes: $b)
                ifTrue: [t7 _ ReporterBlockMorph new]
                ifFalse: [t7 _ CommandBlockMorph new]].
    (t4 includes: $b)
        ifTrue: [t7 isBoolean: true].
    (t4 includes: $s)
        ifTrue: [t7 isSpecialForm: true].
    (t4 includes: $u)
        ifTrue: [t7 isStop: true].
        (t4 includes: $y)
        ifTrue: [t7 isStop: true; isSpecialForm: true].
    (t4 includes: $t)
        ifTrue: [t7 isTimed: true].
    (ScriptableScratchMorph isSpriteSpecificTarget: self selector: t5)
        ifTrue: [t8 _ self]
        ifFalse: [t8 _ self ownerThatIsA: ScratchStageMorph].
    ^ t7 argPermutation: t9;
     color: t2;
     selector: t5;
     commandSpec: t3;
     defaultArgs: t6;
     receiver: t8! !

That should work.

Offline

 

#228 2012-05-13 08:37:46

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Block Files

Problems right away.   sad

I get "NonBoolean receiver: Proceed for truth" whenever I try to save the image or change block categories.

Offline

 

#229 2012-05-13 08:43:42

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Greenatic wrote:

Problems right away.   sad

I get "NonBoolean receiver: Proceed for truth" whenever I try to save the image or change block categories.

oh no, I forgot to file-out the initialization method for CommandBlockMorph!
add this as well

Code:

!CommandBlockMorph methodsFor: 'initialization'!
initialize
    super initialize.
    commandSpec _ ''.
    argMorphs _ OrderedCollection new.
    receiver _ nil.
    selector _ nil.
    isTimed _ false.
    isStop _ false! !

Offline

 

#230 2012-05-13 08:46:48

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

download the newest block importer here:
http://www.mediafire.com/?g9e76w9x690tf7o

Offline

 

#231 2012-05-13 14:23:12

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Block Files

dreamod wrote:

Greenatic wrote:

Problems right away.   sad

I get "NonBoolean receiver: Proceed for truth" whenever I try to save the image or change block categories.

oh no, I forgot to file-out the initialization method for CommandBlockMorph!
add this as well

Code:

!CommandBlockMorph methodsFor: 'initialization'!
initialize
    super initialize.
    commandSpec _ ''.
    argMorphs _ OrderedCollection new.
    receiver _ nil.
    selector _ nil.
    isTimed _ false.
    isStop _ false! !

That fixes it.   smile

Offline

 

#232 2012-05-13 16:18:06

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Block Files

I have a suggestion, why not make this an img rather than a patch? Or both. I didn't realize this would basically be a mod, it removes any already made blocks and changes the name of the browser, it also removes share menu.

I was busy and I just put the patch in and saved the image for end user, now the few blocks i never put in the block library, (due to too many codes needed), are down the drain.  hmm

At least warn the user that it will mess up their image.  tongue


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#233 2012-05-13 18:40:08

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Block Files

Pecola1 wrote:

I have a suggestion, why not make this an img rather than a patch? Or both. I didn't realize this would basically be a mod, it removes any already made blocks and changes the name of the browser, it also removes share menu.

I was busy and I just put the patch in and saved the image for end user, now the few blocks i never put in the block library, (due to too many codes needed), are down the drain.  hmm

At least warn the user that it will mess up their image.  tongue

We'll probably create an image after we finish developing.   smile

Offline

 

#234 2012-05-14 04:36:13

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Block Files

The way I see it, there should be a patch for regular Scratch so that people can upgrade their copy - and this should definetly still be called Scratch. The image would be for people who want to use the blocks but can't work out how to file in the patch. Ideally this would look just like Scratch too and be called Scratch, but I'm sure the image could be relevantly renamed.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#235 2012-05-14 05:13:24

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Block Files

blob8108 wrote:

sparks wrote:

...so I'm kinda hoping someone will HTML it for me  tongue

Will this do?  smile
You need blocks.gif, too.

(I don't really have any time, but I like to suppose I have a little taste.  tongue )

Do you like?  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#236 2012-05-14 05:17:25

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Block Files

blob8108 wrote:

blob8108 wrote:

sparks wrote:

...so I'm kinda hoping someone will HTML it for me  tongue

Will this do?  smile
You need blocks.gif, too.

(I don't really have any time, but I like to suppose I have a little taste.  tongue )

Do you like?  smile

... AWESOME! I love it! Thanks very much, I think I'm gonna tweak the layout a bit, add cap blocks and get the right colour for the Panther "Files" category but it looks pretty good!

EDIT: I just noticed, did you use CSS to make the pallet category images? That's really neat!

Last edited by sparks (2012-05-14 05:19:59)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#237 2012-05-14 05:28:07

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Block Files

sparks wrote:

... AWESOME! I love it! Thanks very much, I think I'm gonna tweak the layout a bit, add cap blocks and get the right colour for the Panther "Files" category but it looks pretty good!

Cool  smile

EDIT: I just noticed, did you use CSS to make the pallet category images? That's really neat!

I did. I like CSS.  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#238 2012-05-14 07:16:14

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Block Files

CSS is cool  smile
just suggesting to add border-left-color:grey; to the other category  smile

Offline

 

#239 2012-05-14 09:23:23

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Pecola1 wrote:

I have a suggestion, why not make this an img rather than a patch? Or both. I didn't realize this would basically be a mod, it removes any already made blocks and changes the name of the browser, it also removes share menu.

I was busy and I just put the patch in and saved the image for end user, now the few blocks i never put in the block library, (due to too many codes needed), are down the drain.  hmm

At least warn the user that it will mess up their image.  tongue

Well, I'm working on another patch that you would file-in and then instructions on how to modify other areas that are usually customized. There is an image available as well with an updating feature. Did you read the license?

Code:

Block Importer License

The Block Importer is open source, and you are free to edit it as you please. If you choose to install the patch included to your own mod, or a copy of anybody else's mod, than you must agree to the following terms.

1. I, Dreamod do not take responsibility for any loss in your code or negative impacts on your mod.

2. The block library does not take responsibility in this, and they should not be blamed for anything within this project.

3. Any projects made with this may NOT be uploaded to the scratch website.

The application is a modified version of the Scratch VM.
The following features are taken from panther:
FormatCodeParser
The basis for the Create A Block Dialog
ScrollingStringDialog
Word args ($String$ , $Number$)

MIT does not endorse this project.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Offline

 

#240 2012-05-14 09:29:48

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

How about this: anybody who wants this in their mod sends me a link to the image, asks me, and I'll add the patch 'safely'. Basically keeping all the blocks and menus and other stuff.

Offline

 

#241 2012-05-14 09:54:17

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

you did notice the download link, right?
http://www.mediafire.com/?g9e76w9x690tf7o

Offline

 

#242 2012-05-14 10:49:16

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Block Files

sparks wrote:

...and get the right colour for the Panther "Files" category but it looks pretty good!

...oh yeah, forgot to mention -- I've never tried Panther, and didn't have one handy, so I couldn't work out what colour they were.  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#243 2012-05-14 11:07:15

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Block Files

Man, I really wish I could tell you to try Panther and I really wish I could endorse Panther since I worked on it.

But that would be off topic, so I guess I can't tell you to try Panther  hmm

Panther's colour blocks happen to be black (or more accurately, #333333), but the file ones are dark blue (#2C78C3)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#244 2012-05-14 11:09:29

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

here's the color hex for the category 'files': #2C78C3
files

Offline

 

#245 2012-05-14 11:13:38

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

dreamod wrote:

here's the color hex for the category 'files': #2C78C3
files

whoops, I posted this before I saw sparks post, sorry.

Offline

 

#246 2012-05-14 11:24:09

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Block Files

dreamod wrote:

dreamod wrote:

here's the color hex for the category 'files': #2C78C3
files

whoops, I posted this before I saw sparks post, sorry.

He totally ninja'd you there.

While I'm off topic: why should I try Panther...?  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#247 2012-05-14 11:29:30

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

blob8108 wrote:

dreamod wrote:

dreamod wrote:

here's the color hex for the category 'files': #2C78C3
files

whoops, I posted this before I saw sparks post, sorry.

He totally ninja'd you there.

While I'm off topic: why should I try Panther...?  tongue

You should try panther because it's one of my personal favorite mods. That's one reason, not including the fact that it has color reporters, custom blocks that can be saved into projects, and file i/o.

Offline

 

#248 2012-05-14 11:41:53

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

The reason I made a patch is that I want everybody to be able to have this in their mode, just like I would love to have some really great features in my mod like color reporters and image reporters (as seen in Panther and BYOB respectively). Too bad it doesn't really work the way I wanted it to work as it has grown bigger and replace lot's of stuff.

Offline

 

#249 2012-05-15 01:31:14

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Block Files

dreamod wrote:

[...] Too bad I can't edit my posts [...]

Woah, you're a new Scratcher? You should be a Scratcher by now, that's strange.  hmm


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#250 2012-05-15 01:39:03

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Hardmath123 wrote:

dreamod wrote:

[...] Too bad I can't edit my posts [...]

Woah, you're a new Scratcher? You should be a Scratcher by now, that's strange.  hmm

yes, well I suppose I haven't quite met the standards yet.

Offline

 

Board footer