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

#851 2010-09-14 15:17:45

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

nXIII wrote:

Oh, y'know, I bet it's because of a %x bug, that's the spec for scene names.

But I could swear that I fixed that long ago!


Jens Mönig

Offline

 

#852 2010-09-14 15:31:29

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

Re: ITopic: Build Your Own Blocks (BYOB)

I added

Code:

ImageFrame new form: msg

to that place, and it crashed squeak. I got rid of the msg part in front, but it still caused an error.

Offline

 

#853 2010-09-14 15:43:30

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

it's class ImageMorph (sigh)


Jens Mönig

Offline

 

#854 2010-09-14 16:15:14

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

Re: ITopic: Build Your Own Blocks (BYOB)

I finally got it!

Code:

showValue
    | t1 t2 t3 t4 t5 |
    (#(#doReport #doMakeNewList #doCallWithArgs #doPauseThreadReporter ) includes: selector)
        ifTrue: [^ self showLambdaValue].
    t1 _ false.
    [t2 _ self evaluate]
        ifError: 
            [t1 _ true.
            t2 _ 'Error!'].
    (t2 isKindOf: Morph)
        ifTrue: [t2 _ t2 imageForm]
        ifFalse: [t2 isForm
                ifTrue: [t2 _ t2 form]
                ifFalse: [t2 _ t2 asString]].
    (self isBooleanReporter or: [t2 = 'Error!'])
        ifTrue: [t2 _ t2 localized].
    t3 _ (ScratchReporterToolTipMorph string: t2 for: self) left: self right;
             bottom: self top.
    ScratchTranslator isRTL ifTrue: [t3 right: self left].
    t1 ifTrue: [t3 messageColor: Color red darker].
    t4 _ self world.
    t4 addMorphFront: t3.
    ((t5 _ t4 bounds) containsRect: t3 bounds)
        ifFalse: [t3 bounds: (t3 bounds translatedToBeWithin: t5)].
    self setProperty: #toolTip toValue: t3.
    t3 initialCursorPoint: Sensor cursorPoint.
    t3 startStepping

I was looking at the wrong part!

Offline

 

#855 2010-09-17 07:43:44

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

excellent! congratulations, Billybob-Mario! Also congrats for getting your mod out  smile


Jens Mönig

Offline

 

#856 2010-09-29 12:11:31

richwhite
Scratcher
Registered: 2010-09-29
Posts: 13

Re: ITopic: Build Your Own Blocks (BYOB)

Wondering what it would take to create a block that:
* Would be connected to a very simple backend web service
* Web service would grab project Scratch/Squeak variable values and return a simple XML file (via the web)

Use cases would be:
* Web embeded Scratch projects would allow kids/developers to store (for example) game high scores to anyone wanting to post their score (online or perhaps Facebook)

If creating a block to post variable-values to a web service seems staight forward to anyone  I would certainly be happy to create the web service script & host it - I would create something in PHP that would look for all "Post" variable-values and return them in a simple XML format.

Offline

 

#857 2010-10-02 17:50:05

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

Re: ITopic: Build Your Own Blocks (BYOB)

bharvey wrote:

Billybob-Mario wrote:

More help is needed. Because BYOB uses every uppercase and lowercase letter, how can I use custom dropdown menus? Numbers and symbols don't work.

This has been sitting here unanswered for a long time so here's an answer:

It's not a law of nature that numbers and symbols don't work; some piece of code somewhere is making that true.  Find it, and find out why.  My guess is that there are two arrays of length 26 in the code.

When you find them, there are several things you can do, depending on how many new items you want to add.  If just one or two, you could make them arrays of length 27, including @ (the character before A) and ` (the character before a).

Alternatively, you could pick one letter (X for eXtended is traditional) to mean that the byte after the X should be used to index a third table of 26 (using XX to mean whatever X used to mean), giving you 25 more entries.

Most radical of all, replace the entire mechanism with one that reads a string instead of a single byte, and then you can have as many entries as you want!

But the most important point here is that you have to actually learn to read the code yourself!

I didn't see this. I ended up making new classes for blocks that I added new args to.

Offline

 

#858 2010-10-02 22:38:03

CommunistPancake
New Scratcher
Registered: 2010-10-02
Posts: 6

Re: ITopic: Build Your Own Blocks (BYOB)

Figured out how to run on linux!
Save as an .sh file:

#!/bin/sh
# Squeakvm wrapper to load BYOB image.
#------------------------------------------------------------

/usr/bin/scratch_squeak_vm \
-plugins /usr/lib/scratch/Plugins \
-vm-sound-pulse \
/path/to/BYOB.image "${@}"

edited Scratch.sh

Offline

 

#859 2010-10-03 11:25:51

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

Re: ITopic: Build Your Own Blocks (BYOB)

Billybob-Mario wrote:

bharvey wrote:

Billybob-Mario wrote:

More help is needed. Because BYOB uses every uppercase and lowercase letter, how can I use custom dropdown menus? Numbers and symbols don't work.

This has been sitting here unanswered for a long time so here's an answer:

It's not a law of nature that numbers and symbols don't work; some piece of code somewhere is making that true.  Find it, and find out why.  My guess is that there are two arrays of length 26 in the code.

When you find them, there are several things you can do, depending on how many new items you want to add.  If just one or two, you could make them arrays of length 27, including @ (the character before A) and ` (the character before a).

Alternatively, you could pick one letter (X for eXtended is traditional) to mean that the byte after the X should be used to index a third table of 26 (using XX to mean whatever X used to mean), giving you 25 more entries.

Most radical of all, replace the entire mechanism with one that reads a string instead of a single byte, and then you can have as many entries as you want!

But the most important point here is that you have to actually learn to read the code yourself!

I didn't see this. I ended up making new classes for blocks that I added new args to.

Well, the particular piece of code that does this is CommandBlockMorph's #parseCommandSpec:. It uses the #isLetter method or something like that. Just remove that from the #ifTrue:ifFalse: and you can use whatever symbols you want. Alternatively, modify the entire method to use a "%IdentifierHere%" argument type.


nXIII

Offline

 

#860 2010-10-18 11:22:42

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: ITopic: Build Your Own Blocks (BYOB)

I completed my VisualSortLibrary project. Available at http://www.sitibs.com/branches/moodle/mod/forum/discuss.php?d=1605 (just login as a guest by clicking on "login come ospite").

Enjoy  smile

Last edited by s_federici (2010-10-18 11:25:34)

Offline

 

#861 2010-10-18 19:21:18

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

Thanks, Stefano, for sharing this awesome project!


Jens Mönig

Offline

 

#862 2010-10-18 21:03:22

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

Re: ITopic: Build Your Own Blocks (BYOB)

Amazing.

That is amazing.

Last edited by bbbeb (2010-10-18 21:03:35)


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

Offline

 

#863 2010-10-19 04:15:20

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: ITopic: Build Your Own Blocks (BYOB)

bbbeb wrote:

Amazing.
That is amazing.

If you mean my project, thanks a lot  smile  I would love to have suggestions from BYOBers (but also from Scratchers, as I'm developping an -unfortunately not so well designed- version for Scratch 1.4) about interesting features to add to the VisualSortLibrary project (http://www.sitibs.com/branches/moodle/mod/forum/discuss.php?d=1605).

What I'm thinking about is:
- showing different algorithms at the same time (on the same data)
- allowing the user to define its own ball sizes
- implementing more algorithms (but maybe on this other BYOBers can contribute!)
- deriving, in a non-mathematical way, the complexity of the algorithm (from the number of comparisons and swaps needed, hopefully from several consecutive runs)
- finding a way of allowing the user to run the algorithm at different levels of granularity, for example going straight to the swap, without having to look for all the comparisons (but I guess this is something that would impact on the design of BYOB; any idea Jens/Brian?  smile  I got this idea from the wonderful AIA tool for Algorithm Animation, by Linda Stern, http://ww2.cs.mu.oz.au/aia/)

Last edited by s_federici (2010-10-19 04:26:02)

Offline

 

#864 2010-10-20 06:24:02

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: ITopic: Build Your Own Blocks (BYOB)

s_federici wrote:

I would love to have suggestions from BYOBers (but also from Scratchers, as I'm developping an -unfortunately not so well designed- version for Scratch 1.4) about interesting features to add to the VisualSortLibrary project (http://www.sitibs.com/branches/moodle/mod/forum/discuss.php?d=1605).

Scratch version is now available at http://scratch.mit.edu/projects/s_federici/1364343.

Offline

 

#865 2010-10-20 14:02:27

developdood
Scratcher
Registered: 2009-04-16
Posts: 63

Re: ITopic: Build Your Own Blocks (BYOB)

I have a great suggestion for new features in BYOB. Since BYOB variables and parameters can be pretty much anything, why not let them be sprites as well? It probably would be complicated. All the sprite blocks need to have an added parameter for the sprite. Then sprites could be cloned and created. There could be blocks like "add script [ ] to sprite [ ]". this might not at all be possible but I think you should consider it.


Have a look at some of my games. I made a cool physics game called "Physics Marble Cannon" which is really cool. I let anyone remix any of my projects without permission or credit necessary.

Offline

 

#866 2010-10-20 16:57:02

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

developdood wrote:

Since BYOB variables and parameters can be pretty much anything, why not let them be sprites as well?

Oh, yes, first class sprites is very high on our list, certainly the first "big" change we'll make (as opposed to tiny improvements that can be done overnight).  Thanks.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#867 2010-10-28 20:59:52

nueclearreaction
New Scratcher
Registered: 2010-10-27
Posts: 3

Re: ITopic: Build Your Own Blocks (BYOB)

nice in working on windows 1 version 4 in byob its  alot handier than scratch when it comes to compiling though it does malfunction  as soon as v4 is done im putting it on  website for downloading

Offline

 

#868 2010-11-02 16:41:24

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

Hi nueclearreaction,

thanks for checking out BYOB, I'm glad you like it! Could you please describe a little more in detail what it is that malfunctions for you? then I'd like to get a shot at fixing it.


Jens Mönig

Offline

 

#869 2010-11-06 14:36:12

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

Re: ITopic: Build Your Own Blocks (BYOB)

Jens wrote:

Hi nueclearreaction,

thanks for checking out BYOB, I'm glad you like it! Could you please describe a little more in detail what it is that malfunctions for you? then I'd like to get a shot at fixing it.

I doesnt do anything until the block is done!


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

 

#870 2010-11-07 01:47:02

gog1
Scratcher
Registered: 2010-10-22
Posts: 17

Re: ITopic: Build Your Own Blocks (BYOB)

Jens wrote:

So, you want to define your own procedures and functions in Scratch?  smile  )?

You might as well try this new experimental prototype I have been developing over the last weeks. You can download and read through an

This prototype lets you build your own custom blocks in Scratch using the standard Scratch blocks, as well as other blocks you defined elsewhere. You can create your own command blocks (procedures) and reporter blocks (functions), both regular ("round") and boolean ("diamond"). You can specify for each block to be atomic (run at the speed of a single block) or interleafed. Your custom blocks are defined for each sprite and can be shared among projects together with the sprite they were created for. Oh, and you can even use a block within itself (recursion).

This prototype is very, very, experimental, so be prepared to encounter lots of bugs. I'd be very interested in feedback about your experiences and insights.

Enjoy!
-Jens

what about windows 7!!!!!!!!!


Hi!

Offline

 

#871 2010-11-07 07:59:44

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

Re: ITopic: Build Your Own Blocks (BYOB)

gog1 wrote:

Jens wrote:

So, you want to define your own procedures and functions in Scratch?  smile  )?

You might as well try this new experimental prototype I have been developing over the last weeks. You can download and read through an

This prototype lets you build your own custom blocks in Scratch using the standard Scratch blocks, as well as other blocks you defined elsewhere. You can create your own command blocks (procedures) and reporter blocks (functions), both regular ("round") and boolean ("diamond"). You can specify for each block to be atomic (run at the speed of a single block) or interleafed. Your custom blocks are defined for each sprite and can be shared among projects together with the sprite they were created for. Oh, and you can even use a block within itself (recursion).

This prototype is very, very, experimental, so be prepared to encounter lots of bugs. I'd be very interested in feedback about your experiences and insights.

Enjoy!
-Jens

what about windows 7!!!!!!!!!

Please don't quote the first post in the thread, It ends up getting really off-topic. Did you notice that we're on the 35th page right now?


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

Offline

 

#872 2010-11-12 18:27:20

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

kinker wrote:

It doesnt do anything until the block is done!

If you want to see results onscreen while your program is running, make sure that you don't have the "Atomic" box checked in the Block Editor.  Does that solve the problem?


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#873 2010-11-16 04:30:39

loldog
Scratcher
Registered: 2009-12-19
Posts: 24

Re: ITopic: Build Your Own Blocks (BYOB)

http://jarrodpryorgames.webs.com/jarrod's%20banner.BMP
I enjoy making games! my website Jarrodpryorgames.webs.com

Last edited by loldog (2010-11-16 04:32:54)

Offline

 

#874 2010-12-06 17:48:46

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: ITopic: Build Your Own Blocks (BYOB)

The result of my last effort: miniC++ 2.0 (developed for BYOB). Have a look at http://scratch.mit.edu/projects/s_federici/1463982.

Last edited by s_federici (2010-12-07 16:23:06)

Offline

 

#875 2011-01-29 05:54:15

littlebird2472
Scratcher
Registered: 2010-03-05
Posts: 42

Re: ITopic: Build Your Own Blocks (BYOB)

How do you upload BYOB projects in 3.0.8?


http://dragcave.net/image/MoLDl.gif Please click and help my dragon survive!

Offline

 

Board footer