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

#2476 2011-01-24 10:46:22

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

ProgrammingFreak wrote:

What is the code for the thing on a block like: [+] on it? I'm making a block that has that, but I don't have that code.

Offline

 

#2477 2011-01-24 12:07:35

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@ clintonhackers -nested sprites
Jens provides "somewhere" into Byob 3.0 distribution pack 2 remarkable examples of nested sprites. See also a simple demo application at  :
http://www.xleroy.net/ByobTuto/thumbnails.html (n° 17) . It's tricky. Don't forget to set correctly the "set" point of each nested sprites.

@ bharvey and jens :100 pages ! Congratulations.
The nested feature is still active but I ignored this as there is no visible command or instruction for it, we just have to know the how-to-do-it.

Offline

 

#2478 2011-01-24 12:15:00

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

Re: BYOB 3 - Discussion Thread

ProgrammingFreak wrote:

What is the code for the thing on a block like: [+] on it? I'm making a block that has that, but I don't have that code.

Hi ProgrammingFreak, are you asking how to add an expand/collapse toggle to a custom block in BYOB? That happens when you set the argument slot in the long form slot dialog to "Multiple inputs".

Or are you asking how to do it in Squeak, because that's hard to answer, since BYOB uses its own block formatting and rendering mechanism (e.g. for inner-block line breaks) which is quite different from Scratch's (but designed to make BYOB's block look and behave like Scratch's). But you're welcome to take what you need from the source code!  smile


Jens Mönig

Offline

 

#2479 2011-01-24 12:19:28

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@ clintohackers - nested sprites
Make 3 sprites, a rectangle and 2 circles for the wheels. Nest the wheels to the rectangle. You get a "group" unique shape that can be moved with the mouse AND moving instructions. Simple but impressive.

Offline

 

#2480 2011-01-24 15:11:14

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

ProgrammingFreak wrote:

What is the code for the thing on a block like: [+] on it? I'm making a block that has that, but I don't have that code.

Hi ProgrammingFreak, are you asking how to add an expand/collapse toggle to a custom block in BYOB? That happens when you set the argument slot in the long form slot dialog to "Multiple inputs".

Or are you asking how to do it in Squeak, because that's hard to answer, since BYOB uses its own block formatting and rendering mechanism (e.g. for inner-block line breaks) which is quite different from Scratch's (but designed to make BYOB's block look and behave like Scratch's). But you're welcome to take what you need from the source code!  smile

I'm talking about the squeak code. I'd like to make a certain block that would use it. Is it possible to share?

Offline

 

#2481 2011-01-24 16:46:14

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: BYOB 3 - Discussion Thread

JTxt wrote:

Lucario621 wrote:

Hmm. Almost 100 pages! Cool.

And, I've recently just about half an hour ago been working on a new project (tile-based), however, because there's no good way to copy lists, I have to use BYOB.  smile  I can't even individually copy items - because I want to have a "Visible chunk" list, and it has the visible chunk out of all of the chunks in the game (a chunk is a part of the world - so it can be rendered separately). So I can't just say copy from chunk1 to Visible Chunk - it has to be from chunk # (visible chunk (variable)) to Visible Chunk. Which isn't currently possible.

And it passed 65536 views!  smile
Cool problem, I responded to you here.

On topic: Go BYOB.  smile
Really, thanks for your hard work on this.

Ah yes. Thanks. (I'm writing my response to the new thread ATM)

BYOB does make things a lot easier. However I haven't actually created any new blocks yet, like most people would think  wink .


http://i.imgur.com/WBkM2QQ.png

Offline

 

#2482 2011-01-24 19:01:09

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

Re: BYOB 3 - Discussion Thread

ProgrammingFreak wrote:

I'm talking about the squeak code...  Is it possible to share?

Do you know about the "development" script in the BYOB distribution?  It's called "BYOB development.bat" in Windows, "BYOB development.sh" in MacOS.  If you run it, you get a BYOB that lets you shift-click the Edit menu to turn fill screen off, and then you run a Smalltalk browser with the full source code, comments and all.

Is that what you needed?


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

Offline

 

#2483 2011-01-25 02:29:00

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

BYOB+CYOB+OOP+Faster JavaScript Morpchic+Cross WAN multiple connection meshes=Awesome


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#2484 2011-01-25 10:15:30

Alternatives
Scratcher
Registered: 2010-09-16
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Of all Scratch based programs, BYOB is definitly my faveriote  big_smile


http://i42.tinypic.com/98vmms.png
Well if you wanted honesty, that's all you had to say. I never want to let you down or have you go, it's better off this way.

Offline

 

#2485 2011-01-25 22:27:53

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

Re: BYOB 3 - Discussion Thread

Here's today's experimental build!

Jens wrote:

another experimental pre-alpha release. Lots of changes under the hood:

1) spawning and deleting clones now also works in presentation mode
2) new experimental _ OF _ reporter block in the sensing category allows scripts to be handled by corresponding / inherited blocks of another sprite.
3) new experimental getVariable reporter gets any named variable or named list. Use the experimental new OF block to query another sprite's variables and lists:

Code:

CALL (ATTRIBUTE (THE (GET varname) BLOCK) OF (OBJECT (spritename)))

4) experimental STICK TO (sprite) command block for scripted nesting or sprites in the motion category. Choose "nothing" to detach / "unstick" the sprite again.

I'm including a little demo project for the new OF block. It shows - among other things - how you can use this new block interpretation to initialize and individualize clones.

Saving projects works /sometimes/. More often than not projects get stuck in circularity. We might have to invent a general object table after all (but maybe not for 3.1).

Enjoy!
--Jens


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

Offline

 

#2486 2011-01-25 22:46:47

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

I love the new sample project. BYOB is getting more amazing by the day!


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#2487 2011-01-26 10:03:10

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Wow! This is the best release yet! Am I supposed to be able to remove the stage from the stage?  tongue


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#2488 2011-01-26 10:20:58

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

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

Wow! This is the best release yet! Am I supposed to be able to remove the stage from the stage?  tongue

I tried that too.  smile   "Remove from stage" is misnamed anyway -- makes it sound like "hide."  Should be "delete"!  I'm working on Jens about it...  smile


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

Offline

 

#2489 2011-01-26 14:18:24

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

This is getting so exciting.


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#2490 2011-01-26 16:38:58

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@ Bharvey&Jens

Extraordinary ! Wunderbar ! Benissimo ! Magnifique !

Offline

 

#2491 2011-01-26 17:10:25

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

Re: BYOB 3 - Discussion Thread

The get block can't access script vars.


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

Offline

 

#2492 2011-01-26 19:43:51

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

Re: BYOB 3 - Discussion Thread

rubiks_cube_guy238 wrote:

The get block can't access script vars.

I'm not sure why you expect it to.  If you're inside a script, you have the variable block available to you; if you're not inside the script, then you're outside the scope of definition of the variable and it effectively doesn't exist.  Could you give an example in which it would make sense to GET a script variable?  Thanks.


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

Offline

 

#2493 2011-01-26 22:32:43

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

While I don't think it's necessary (to be able to access script variables), I could need to GET them from a custom block at some point... Just a thought...

Offline

 

#2494 2011-01-26 23:25:49

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

Re: BYOB 3 - Discussion Thread

Yet another experimental build.

Jens wrote:

After an all-nighter this version is another step towards "getting it to work" and fixes some of the worst issues of the past experimental releases:

     - first class sprites no longer cause circularity hang-ups when saving
     - it is now possible to use script variables for first class sprites
     - (recursive) custom blocks can again be defined in this version

No new changes to the GUI or the blocks, but I'm enclosing yesterday's "generation" demo project using script variables and a new "spawning-tree" demo project that's especially fun to watch in presentation mode.

Enjoy!
-Jens


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

Offline

 

#2495 2011-01-26 23:43:18

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

I could need to GET them from a custom block at some point...

So, let me see if I understand.  Script A has a script variable FOO.  It calls custom block B, and inside B you want to get the value of FOO?

If that's it, you're asking for dynamic scope.  This is the name for the scoping rule in which a procedure call has access to the variables of its caller.  By contrast, what we have now is lexical scope, which means that a procedure call has access to the variables of the enclosing definition.  This is what allows us, among other things, to have explicit OOP using dispatch procedures.

I have a foot in each camp; Logo uses dynamic scope, while Scheme uses lexical scope.  I actually have this crazy idea for how to provide both; I don't know of any language that really tries to do that, although some languages have fallen into mixtures by mistake, because their designers didn't think about scope at all.

My idea is that scope is primarily lexical.  Besides providing OOP capability, this also makes for faster compiled programs.  But if there is no lexical referent for a variable reference, then we'd look through the dynamic environment for a binding.

I think variable scoping just barely works in the Smalltalk implementation, and my guess is that Jens is unlikely to tinker with it for 3.1.  (But, you never know...)  But when we do the 4.0 rewrite, I'll try to sneak this in.  smile

P.S.  One problem with dynamic scope is that your custom block B can't be used just anywhere; it can only be called from script A, or some other script that also provides a variable FOO.  This is a little undesirable because it means the user of a block has to know about what's inside it, not just what job it does.

Last edited by bharvey (2011-01-26 23:45:46)


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

Offline

 

#2496 2011-01-27 02:41:16

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Is this purposeful? When you put % before something in title text, it turns into a variable with that name.

Offline

 

#2497 2011-01-27 04:21:13

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: BYOB 3 - Discussion Thread

One thing I'd like to see in future versions of BYOB is the ability to create dropdown menus. Maybe have where you choose from existing ones (ie. sprite list), or create your own (ie. all but (last/any/first/[insert]) of (list) ).

Offline

 

#2498 2011-01-27 05:27:29

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

....the user of a block has to know about what's inside it, not just what job it does.

You underscore what is probably the major practical and industrial interest of OOP language -: make re-usable and share-able software components. Now that Byob offer features to make "clean" independant OOP-like objects the "Export this sprite" Command should work correctly. It is rarely the case for me (error message = "could not write file export failed).

Offline

 

#2499 2011-01-27 07:51:43

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Yet another experimental build.

Jens wrote:

After an all-nighter this version is another step towards "getting it to work" and fixes some of the worst issues of the past experimental releases:

     - first class sprites no longer cause circularity hang-ups when saving
     - it is now possible to use script variables for first class sprites
     - (recursive) custom blocks can again be defined in this version

No new changes to the GUI or the blocks, but I'm enclosing yesterday's "generation" demo project using script variables and a new "spawning-tree" demo project that's especially fun to watch in presentation mode.

Enjoy!
-Jens

Hi guys,

I menat to write yesterday but I think my browser crashed before the message went out.  So, ot summarize:

wow!  this is fantastic!

and

what do you think about the idea of adding "My Parent" to the list of sprites in e.g. the SPAWN and OF blocks?  I think there're likely to be many situations in which communication between parent and child will be important.

Otherwise fantastic.  thanks guys.

matt

Offline

 

#2500 2011-01-27 08:28:22

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

Re: BYOB 3 - Discussion Thread

What's a prototype? Is it like a superclass?

Post #2500!

Last edited by rubiks_cube_guy238 (2011-01-27 08:44:11)


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

Offline

 

Board footer