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

#276 2009-08-24 18:43:50

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

Re: ITopic: Build Your Own Blocks (BYOB)

Since BYOB 1.0 I have been thinking to the possibility of defining new blocks' arguments by means of a block similar to the "and" block in the Operator category. Something like:

(when defining)
draw a parallelepiped with given < < <width> and <depth>> and <height> >

(when using)
draw a parallelepiped whose < < <width> is 10 and <depth> is 15> and <height> is 20 >

Offline

 

#277 2009-08-24 20:14:37

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

Re: ITopic: Build Your Own Blocks (BYOB)

Jens wrote:

nestable sprites

   - you can now create composite sprites (made out of sububsprites)

How do you nest sprites?

Last edited by henley (2009-08-24 20:18:42)


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

Offline

 

#278 2009-08-25 01:40:36

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

Re: ITopic: Build Your Own Blocks (BYOB)

s_federici wrote:

Since BYOB 1.0 I have been thinking to the possibility of defining new blocks' arguments by means of a block similar to the "and" block in the Operator category. Something like:

(when defining)
draw a parallelepiped with given < < <width> and <depth>> and <height> >

(when using)
draw a parallelepiped whose < < <width> is 10 and <depth> is 15> and <height> is 20 >

Hi Stefano,

thanks for testing the BYOB release candidate!

Hmm, maybe I don't quite understand your suggestion, because you can define any number of arguments for a custom block in BYOB like in your example. Why would you need something like an 'and' block'? What BYOB cannot do, however, is take a list of values as argument. Maybe that's what you're suggesting? With the new string function it it now possible to parse an argument string within the custom block definition.


Jens Mönig

Offline

 

#279 2009-08-25 01:43:35

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

Re: ITopic: Build Your Own Blocks (BYOB)

henley wrote:

How do you nest sprites?

Hi henley, there is a short introduction to nested sprites in one of the pdf's included in the download, along with some screenshots and illustrations. Basically you can stick one sprite to another one by dropping its library icon onto the new owner sprite (detach it by dropping its library icon on the stage).


Jens Mönig

Offline

 

#280 2009-08-25 06:52:55

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

Re: ITopic: Build Your Own Blocks (BYOB)

Jens wrote:

you can define any number of arguments for a custom block in BYOB like in your example. Why would you need something like an 'and' block'?

Hi Jens,
my goal is to make argument definition as simple as the other parts of Scratch, that is I would like that it could be possible to define new block templates and arguments without having to use the % syntax (perfectly functional, but far from the ideal of intuitive and immediate programming environment that Scratch represents.)

Jens wrote:

With the new string function it it now possible to parse an argument string within the custom block definition.

This could work, but I would like to be able to show argument names in the block definition/usage. That is why I'm suggesting to use a structure similar to the one adopted by Scratch operators: you can define as many elements you like just by nesting operators. So, if an argument definition block like

< <> and <> >

could be made available under the "make a block" button (and maybe also duplicated in the block editor, just to make its usage simpler and its meaning more intuitive), you could define a sequence of arguments in the block specification just nesting as many argument definition blocks you like, for example

draw a parallelepiped with given < < <width> and <depth>> and <height> >

That is, the block name will have its dedicated box to type it in (the "draw a parallelepiped" string in this example) and a further box will be available in which to compose as many nested "< <> and <> >" blocks as needed.

The "< <> and <> >" block will be then dragged from below the "make a block" button (or from the "Custom block spec" dialog if it is duplicated there) and that will make the user able to type inside argument names. When OK is clicked, the Block Editor will show exactly as it is now.

When OK is finally clicked in the Block Editor, the new block will show up as follows

draw a parallelepiped whose <>

Below it, a new block

< <width/depth/heigth> is <> >

should be made available at the same time (the <width/depth/heigth> notation is for a drop down menu with all the names of the defined arguments, similar to the <set <> to <> > block).

Finally the user will be able to use the new block by building something like

draw a parallelepiped whose < < <width is 10> and <depth is 15> > and <height is 20 > >

by dragging the "<draw a parallelepiped whose <> >" block and filling the empty box with nested

< <> and <> >

and

< <width/depth/heigth> is <> >

blocks.

I hope this description is not so obscure. I will be happy to discuss it and improve it if you like.

Last edited by s_federici (2009-08-25 09:25:48)

Offline

 

#281 2009-08-25 07:52:50

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

Re: ITopic: Build Your Own Blocks (BYOB)

Hi Stefano,

thanks for clarifying this! Parameter definition by having to use a parseable %parm string in BYOB is indeed suboptimal, and now what you're suggesting makes perfect sense to me. I've been racking my mind for quite some time how to define parameters in a drag'n'drop kind of way, but didn't come up with anything I really liked. Your idea, on the other hand, might just be the solution!

Thanks again for your explanation.


Jens Mönig

Offline

 

#282 2009-08-25 08:02:43

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

can u show mewhere global variables are or what they are ?

Offline

 

#283 2009-08-25 09:24:53

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

Re: ITopic: Build Your Own Blocks (BYOB)

Jens wrote:

Your idea, on the other hand, might just be the solution!

Glad of being of help. If you are inspired by this proposal and would like to implement something similar in your excellent BYOB, do not hesitate to contact me (even only for testing and debugging). I have a federici.stefano account at gmail.com. In the next week I will be (finally!) studying Squeak's and Scratch's source code in depth to try to implement some new ideas (BTW, is 1.4 source code already available?)

Last edited by s_federici (2009-08-25 09:25:29)

Offline

 

#284 2009-08-25 11:35:51

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

Re: ITopic: Build Your Own Blocks (BYOB)

When creating a block whose name contains accented chars (e.g. "è"), the resulting block name is something like "V@" (the first char looks like a square root).

Last edited by s_federici (2009-08-25 12:17:13)

Offline

 

#285 2009-08-26 09:50:14

Lolersk8s
Scratcher
Registered: 2009-04-29
Posts: 41

Re: ITopic: Build Your Own Blocks (BYOB)

wow... i love it! this will help me A LOT http://dragcave.net/image/et87.gif

Offline

 

#286 2009-08-27 10:03:26

itsme213
Scratcher
Registered: 2007-07-08
Posts: 38

Re: ITopic: Build Your Own Blocks (BYOB)

Hi Jens,

Jens wrote:

Hey, I just updated the RC yet again (rc3) to include an Elements Editor which lets you examine and alter any block (not just custom ones)...

Wow! I cannot help getting a flash-forward of where you could go with this!

Not sure about directed messages anymore. The code behind this is very simple and easy (which is nice....), but it also leads you away from parallelism (which IMO is Scratch's coolest trait)

Yes, Scratch concurrency is indeed very lovely, so natural you don't even realize you are using it! (Alice offers a much more conventional approach, although with relatively easy to use "Do Together" and "Do In Order" blocks).

However, I think the direction you proposed earlier is perfectly consistent. If I recall correctly, reporters (pure functions for return values) can be called synchronously, and commands (side-effect) can be called asynchronously. This gives the added flexibility of sprite-to-sprite interaction, with a slight Erlang-ish feel. Using global broadcast events is a good choice in only a few cases, imo. I would love to see & use this!

- Sophie

Offline

 

#287 2009-08-27 18:33:27

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

Re: ITopic: Build Your Own Blocks (BYOB)

Jens wrote:

henley wrote:

How do you nest sprites?

Hi henley, there is a short introduction to nested sprites in one of the pdf's included in the download, along with some screenshots and illustrations. Basically you can stick one sprite to another one by dropping its library icon onto the new owner sprite (detach it by dropping its library icon on the stage).

Thanks! I always forget to look at the pdf.  smile


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

Offline

 

#288 2009-08-28 23:33:37

DarthPickley
Scratcher
Registered: 2008-06-13
Posts: 100+

Re: ITopic: Build Your Own Blocks (BYOB)

I am interested in the inclusion of the Mesh feature. however, I need other people to have copies of the project to test it... I think? I am finding it difficult to find a place to share simple application versions of a project I made. I tried to host one on a web site and the computer sort of crashed.

Offline

 

#289 2009-08-28 23:34:49

DarthPickley
Scratcher
Registered: 2008-06-13
Posts: 100+

Re: ITopic: Build Your Own Blocks (BYOB)

if you could have included in sample projects a SINGLE demo of a project using the mesh feature, then lots of people could have had it. all I want is to be able to test the feature out.

Offline

 

#290 2009-08-29 23:55:00

Boyboy436
Scratcher
Registered: 2009-08-29
Posts: 1

Re: ITopic: Build Your Own Blocks (BYOB)

Sorry, i dont know where to put this message...

can someone please make me a sprite page of soldiers, tanks,other army vechiles, army objects and weapons...
no matter what size
no matter how dark or how light
no matter how big or small
lol
credit will be given
Thanks  smile 

oh...and if u don't want to do a whole sprite page i dont care if u do some separate
Thanks  smile

Offline

 

#291 2009-08-30 05:07:56

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

I have a question: is there a possibility to obtain BYOB source code and/or hack the user image?


Converting my Scratch projects to Python!

Offline

 

#292 2009-08-30 16:55:50

cannon
Scratcher
Registered: 2008-09-13
Posts: 8

Re: ITopic: Build Your Own Blocks (BYOB)

i am working on addind support for lego nxt to byob

Offline

 

#293 2009-08-30 17:23:14

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

Re: ITopic: Build Your Own Blocks (BYOB)

cannon wrote:

i am working on addind support for lego nxt to byob

Great! Let us know when you have a working prototype!

Offline

 

#294 2009-08-31 16:57:16

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

Re: ITopic: Build Your Own Blocks (BYOB)

Why don't some of these features like nesting sprites to the main Scratch.

Offline

 

#295 2009-09-01 10:55:16

cannon
Scratcher
Registered: 2008-09-13
Posts: 8

Re: ITopic: Build Your Own Blocks (BYOB)

ii need rhe sourchcode to add support

Offline

 

#296 2009-09-01 11:22:00

golfer3
Scratcher
Registered: 2008-11-02
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

fullmoon wrote:

Doesn't "BYOB" stand for "Bring Your Own Beer"? Other than that, I am blown away! I'm supposed to be writing a Scratch presentation for school, but instead I think I'll spend the rest of the day playing with this  wink . Thank you!!!

thats what i thought too.

Offline

 

#297 2009-09-05 05:15:45

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

Re: ITopic: Build Your Own Blocks (BYOB)

Jens, I need your expert opinion on a possible development of Scratch. Do you think that a mechanism similar to the one I have described to add arguments to blocks by drag-n-drop could also be adapted to  add arguments to "broadcast" blocks? Or could this be less clean and more difficult for some reason?

Offline

 

#298 2009-09-10 17:04:22

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: ITopic: Build Your Own Blocks (BYOB)

fullmoon wrote:

One "bug" I found: adding a colon ":" in a block spec will place the part of the block spec after the colon in a new number reporter inside the block header in edit mode. Try to drag the unwanted reporter out of the block header; it can't be done. I am using version 1.0.2.

I experimented around a little, and I discovered that this glitch works if you put ANY matching or unmatching symbols imediatly before and after a variable (like a%bc or [%)s).

Last edited by rubiks_cube_guy238 (2009-09-10 17:10:46)


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#299 2009-09-10 17:13:34

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

I have a suggestion for BYOB:

Code:

Sprites always have a sensing block, ([x-position] of [sprite1]), right? Why don't you make that continue to blocks, with blocks' internal variables? As in: ([running] of [block "am I running"])

Offline

 

#300 2009-09-10 19:02:07

terminator68
Scratcher
Registered: 2008-02-26
Posts: 1000+

Re: ITopic: Build Your Own Blocks (BYOB)

rubiks_cube_guy238 wrote:

I just discovered the weirdest glitch EVER in B.Y.O.B.. When I create a variable and name it %x I get a weird block that has a drop down menu. The options on the drop-down menu are 'record' and 're-record'. When I select 'record' it says 'Enter Scene Name.' I can't find another block that refers to a scene.

I was wondering about that "movie" block too :S

Last edited by terminator68 (2009-09-10 19:02:15)


--------------------Scratcher since '08--------------------
http://images1.wikia.nocookie.net/__cb20110314152018/mlpfanart/images/5/5d/Applejack_chewing.gif

Offline

 

Board footer