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

#2501 2011-01-27 09:37:08

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

Re: BYOB 3 - Discussion Thread

I feel like my role here is to be the incompetent kid who gets lost in the first class... 

Playing around with the spawning-tree demo (awesome), I managed to delete _all_ of the sprites (I wanted to delete sprites when we got to branch = 0, because I had accidentally restarted the tree when there were still 32 sprites -- as a result, 'is clone' was set to 'false' for all of them, and they all started making identical trees...  veeeerrrrry slowly).  I think there's a possibility for LOTS of frustration on the part of kids who make a similar mistake and suddenly find all of their work has disappeared.  I'm not sure whether the interface should protect against this somehow, or if we should just make it very clear in the documentation that this is a danger, and that you should (1) save your work frequently, and (2) be very careful about the 'remove (sprite) from stage' block. 

speaking of docs, I'd be happy to help out with them at some point if you want some assistance.  I'm sure there are other people on the list who'd help as well.

matt

Offline

 

#2502 2011-01-27 10:30:24

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

Re: BYOB 3 - Discussion Thread

OMG so many messages overnight and me with no time to answer them!  Thank you, all, for your interest and enthusiasm, and I apologize for the abruptness of what follows.

scimonster wrote:

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

Yeah.  It's a leftover from BYOB2, in which that was the only way to make an input.  It's still there because some experienced BYOB users find it faster than using the official GUI.

One thing I'd like to see in future versions of BYOB is the ability to create dropdown menus.

Yes, definitely on our list.  Might not get into 3.1, though -- too many details to think through to get it right and not much time.

xly wrote:

the "Export this sprite" Command should work correctly.

Yes, of course.  Jens has been having trouble with saving because of the circularity of inter-sprite pointers in an object hierarchy.  It's even harder saving a sprite that points to a sprite you aren't saving!  But certainly we'll have to solve this problem before a real release.

clintonhackers wrote:

what do you think about the idea of adding "My Parent" to the list of sprites in e.g. the SPAWN and OF blocks?

Great idea, thanks.

I had accidentally restarted the tree when there were still 32 sprites

Yes, I did this, too, the first time I ran it.  I think we need a "delete all clones" and/or "delete all my clones" feature, rather than depending on the user to communicate with all of them.

rubiks_cube_guy238 wrote:

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

In a prototyping OOP system there are no classes or instances, just objects that can serve as either.  So it really is more like cloning, where you copy the DNA of an object to make another object, but instead of copying, the two objects actually share most attributes.  There is a long discussion of this a few pages back -- check it out.

EDIT:  The long discussion starts here.

Last edited by bharvey (2011-01-27 12:55:13)


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

Offline

 

#2503 2011-01-27 17:19:51

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

Re: BYOB 3 - Discussion Thread

ARGH. I just missed post 2500! Ah well. Congrats everyone!

Offline

 

#2504 2011-01-28 02:58:15

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

Re: BYOB 3 - Discussion Thread

@bharvey & Jens

See my first Byob-Jan2011 application at :
http://www.xleroy.net/ByobTuto/thumbnails.html

Now it will take a while before reaching the new "raised ceiling" of YOUR  Byob.

PS - I've probably missed something, but I don't understand the difference between DUPLICATE and SPAWN and which is the role of PROTOTYPE.

Offline

 

#2505 2011-01-28 10:26:26

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

Re: BYOB 3 - Discussion Thread

xly wrote:

I don't understand the difference between DUPLICATE and SPAWN and which is the role of PROTOTYPE.

DUPLICATE is the Scratch feature that makes a copy of a sprite, with no information shared between the two after the copying.  The question hasn't come up yet in discussion with Jens, but personally, I would strongly consider eliminating the DUPLICATE feature once we have cloning ready for release, to avoid confusion between the two.

The PROTOTYPE menu entry displays the sprite's current prototype and allows you to change it.  Sort of like "will you adopt me?"  smile


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

Offline

 

#2506 2011-01-28 18:04:48

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

xly wrote:

I don't understand the difference between DUPLICATE and SPAWN and which is the role of PROTOTYPE.

The PROTOTYPE menu entry displays the sprite's current prototype and allows you to change it.  Sort of like "will you adopt me?"  smile

I've been wondering what this means, exactly.  if the original parent and the new parent have no common heritage, won't there be some confusion about implicitly defined characteristics of the clone?  I guess I should experiment a bit to figure it out.

Offline

 

#2507 2011-01-28 19:15:02

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

Re: BYOB 3 - Discussion Thread

clintonhackers wrote:

I've been wondering what this means, exactly.  if the original parent and the new parent have no common heritage, won't there be some confusion about implicitly defined characteristics of the clone?  I guess I should experiment a bit to figure it out.

I'm still a little vague on why anyone would do it, but what it will mean is that attributes shared with the old parent will disappear and attributes of the new parent will appear instead.  Attributes not shared with the old parent (e.g. because the child changed the binding, although I'm struggling with Jens about whether that'll be the case in the final release) will of course still exist in the child, and therefore the new parent's value for that attribute, if any, won't be seen by the child -- at least I think that's the most consistent way to make it work.


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

Offline

 

#2508 2011-01-29 04:59:44

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

Re: BYOB 3 - Discussion Thread

Just wanna ask... How many people would be interested in a competition: http://byobshack.weebly.com/genetic-algorithm.html
Before I get too committed to this idea I want to see how many people would actually do it.

P.S. If there is any objection to the theme I am always flexible... I'm not even an evolutionist anyways so I'm not ridiculously committed to this specific topic. Just thought a competition would be a cool way to get people to push BYOB and show what it can do.

Last edited by 14God (2011-01-29 17:51:42)


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

Offline

 

#2509 2011-01-29 05:38:36

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

Re: BYOB 3 - Discussion Thread

@ bharvey & jens

See my first Byob-Jan2011 application and comments at :
http://www.xleroy.net/ByobTuto/thumbnails.html

At this stage your 1st class sprites enhancement seems to be particularly well adapted to the design of OOP-like applications compliant with Scratch-Byob spirit : user-friendlyness, power, "tinkerability", support for creativity and education as well etc

Many mechanisms exist now to emulate OOP-like applications where capabilities and properties of any sprite can be precisely defined, extended or restricted :
- Duplication, spawning, prototyping ..
- Global/Local variables AND Functions,
- Extraordinary flexibility of SCRIPT VARIABLES instruction allowing to implement local scripts anywhere, when and where needed.
- Capability to implement, SET and GET  "added" sprite properties handled by one ASK function,
- Methods + <property OF sprite (can be elegantly used jointly with ATTRIBUTE )

Byob offers many ways to define, extend or restrict the capabilities of any sprite ( for example in the referenced application the family prototypes are not allowed to fight as to not be destroyed and continue to make children ). It's amazing how complex applications can be written with zillions of sprites without creating a bunch of variables crowding the panels ( in the referenced application, only one variable to count the number of hits !!)

Offline

 

#2510 2011-01-29 12:23:23

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

Re: BYOB 3 - Discussion Thread

xly wrote:

http://www.xleroy.net/ByobTuto/thumbnails.html

Wow!  The first serious project to use BYOB sprite cloning.

I looked at the first one on the page (51-abmoop-spawn); is that the final version?  Because only one bumper and one missile can actually be moving at a time -- when you make a new one, the previous one stops moving.  This is because scripts aren't really reentrant, but if you used LAUNCH instead of RUN then each clone would have its own script.

Also I don't think the SPEED variable really does anything.  You have, e.g.,

Code:

THE SCRIPT.  INPUT NAMES: <#1>
    MISMOV <  >

Because there is an explicit formal parameter, BYOB won't fill the blank input in MISMOV with SPEED.  Either remove the INPUT NAMES, or make it MISMOV <#1>.


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

Offline

 

#2511 2011-01-29 13:47:36

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

Re: BYOB 3 - Discussion Thread

@bharvey

"Wow!  The first serious project to use BYOB sprite cloning."

Many thanks for all and mainly for your advices ( I'm proud to have a personal CS teacher like you ). It is a preliminary version. To create new bumpers or missiles click on each fixed "prototypes". Each click creates  a new "child"  ( At this stage I wanted to avoid the problem of a geometric serie for sprite creation like in the first example of Jens. (1,2,4,8,16 etc). I am now to implement the feature to delete the Hit sprite. (For the time being we lack a mechanism to get the name of the current (myself) sprite) In the meantime the sprite - when hit - will send a broadcast to master sprite asking it to do the job. The balance between LAUNCH/RUN is not easy but I shall manage.

Offline

 

#2512 2011-01-29 14:10:14

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

Re: BYOB 3 - Discussion Thread

xly wrote:

For the time being we lack a mechanism to get the name of the current (myself) sprite.

You don't need the name -- you have a handle on the actual sprite:  OBJECT <MYSELF>.  You can use that to send yourself a message:

Code:

LAUNCH [ATTRIBUTE <...> OF [OBJECT <MYSELF>]]

... although I guess you could just LAUNCH <...> instead.  Maybe I'm missing what you're trying to do.  But instead of constructing text messages to sprites, just directly run their blocks.

EDIT: I reread your message so now I see that you're trying to delete a sprite.  That's

Code:

REMOVE [OBJECT <MYSELF>] FROM STAGE

Last edited by bharvey (2011-01-29 14:15:48)


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

Offline

 

#2513 2011-01-29 19:30:04

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

xly wrote:

For the time being we lack a mechanism to get the name of the current (myself) sprite.

You don't need the name -- you have a handle on the actual sprite:  OBJECT <MYSELF>.  You can use that to send yourself a message:

Code:

LAUNCH [ATTRIBUTE <...> OF [OBJECT <MYSELF>]]

... although I guess you could just LAUNCH <...> instead.  Maybe I'm missing what you're trying to do.  But instead of constructing text messages to sprites, just directly run their blocks.

EDIT: I reread your message so now I see that you're trying to delete a sprite.  That's

Code:

REMOVE [OBJECT <MYSELF>] FROM STAGE

I've fixed the motion issue. I'm going to load a revised version.
As far as Name is concerned I just wanted to delete a sprite once it has been hit. It was obvious to me : when the sprite is hit it broadcasts a message to the master sprite asking it to read the global variable <nameself> supposed to contain <object myself>. In fact this does not work. In addition the risk is to delete the prototype itself. The REMOVE FROM STAGE instruction is amazing but also very dangerous !

Offline

 

#2514 2011-01-29 20:10:45

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

Re: BYOB 3 - Discussion Thread

xly wrote:

. The REMOVE FROM STAGE instruction is amazing but also very dangerous !

Yeah I deleted a 'class object' accidentally but thankfully had one copy of it left.


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

Offline

 

#2515 2011-01-29 21:07:21

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

Re: BYOB 3 - Discussion Thread

xly wrote:

The REMOVE FROM STAGE instruction is amazing but also very dangerous !

Hmm.  I was going to say, just set a variable equal to OBJECT <MYSELF> in the parent before making any clones, and then when a clone is thinking about deleting itself it could say IF [NOT [<var> = [OBJECT <MYSELF>]]] REMOVE ...  but I just tried it, and so far the = block thinks all sprites are equal.  This is a bug; stay tuned for an announcement from Jens that he's fixed it!


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

Offline

 

#2516 2011-01-29 21:08:04

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

Re: BYOB 3 - Discussion Thread

While I know that bugs reports aren't really needed for the experimental versions, I noticed that while the clone/prototype/inheritance/whatever-it-is blocks have a "myself" option, they also have their sprite name listed. Example:

( object [ myself ] )
              sprite1
              sprite2

But I guess it doesn't have anything to do with functionality so it doesn't really matter.

Last edited by shadow_7283 (2011-01-29 21:10:01)

Offline

 

#2517 2011-01-29 22:22:32

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

I noticed that while the clone/prototype/inheritance/whatever-it-is blocks have a "myself" option, they also have their sprite name listed.

This isn't a bug; using "myself" and using "sprire23" or whatever will have different effects if the script is inherited by a clone!  smile


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

Offline

 

#2518 2011-01-29 23:53:58

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

Re: BYOB 3 - Discussion Thread

@ xly
I think the best solution to the 'remove from stage' problem is to have a variable: bClone
(b stands for bool, a habit I picked up from unreal script) Set it to false manually and whenever you spawn an object just use the new 'attribute of' block to set bClone to true.


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

Offline

 

#2519 2011-01-30 03:15:42

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

Re: BYOB 3 - Discussion Thread

@bharvey "REMOVE FROM STAGE"

Yes, there are solutions as long as you are warned of the pb.
I've uploaded an updated working version of the application abmoop, plus  unchanged copyscreens of comments. For Instructions, see Project notes.

I've not yet implemented the "remove" feature consisting to remove one sprite each time a hit occurs, I delete the "last one" of the missiles/bumpers list. It is not a clean way, but it allows to "play" with REMOVE.

Offline

 

#2520 2011-01-30 18:57:14

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

Re: BYOB 3 - Discussion Thread

Another day, another experimental version.

Jens wrote:

This experimental version adds some more options to the new ATTRIBUTE _ OF _ block:

     - name
     - prototype
     - owner ("leader")
     - parts ("followers")

it also introduces equality testing for sprites and prevents the stage from being "removed from stage."

Enjoy!
-Jens

("Leader" and "followers" refer to nesting, not prototyping, in case that isn't clear.)


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

Offline

 

#2521 2011-01-30 21:26:17

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

Re: BYOB 3 - Discussion Thread

This is great! We're in "testing-mode" again! I honestly didn't expect any of this until the summer.  big_smile

Offline

 

#2522 2011-01-30 22:31:04

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

This is great! We're in "testing-mode" again! I honestly didn't expect any of this until the summer.  big_smile

Yeah, this is way more fun than last semester!  What's a little scary is that we're testing in public while still arguing about the design.  But, I still say, 3.1 release in March, so the summer will be the testing of 4.0.


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

Offline

 

#2523 2011-01-31 01:54:08

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Yeah, this is way more fun than last semester!  What's a little scary is that we're testing in public while still arguing about the design.  But, I still say, 3.1 release in March, so the summer will be the testing of 4.0.

Testing 4.0 by the summer!?!?!? I'm so excited.


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

Offline

 

#2524 2011-01-31 03:27:26

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

Re: BYOB 3 - Discussion Thread

Running a script through the attribute block is ingenious. I think it's my favorite experimental block so far. Keep up the great work guys... but don't kill yourselves  wink


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

Offline

 

#2525 2011-01-31 03:59:50

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

Re: BYOB 3 - Discussion Thread

14God wrote:

Running a script through the attribute block is ingenious. I think it's my favorite experimental block so far.

Thanks! Actually I'm very unsure about this particular feature (running a script through the attribute block). Fact is, we're still in the process of discussing the design of how built-in OOP in BYOB might work. All those current experimental versions are just that - hands-on experiments, which might or might not make it into 3.1. I am pretty sure that the final design will be a lot different from today's.

So, what is it you like about running a script in the context of another sprite? wouldn't it be better and easier to understand if you could also send a message to an individual sprite instead of having to broadcast it publicly?


Jens Mönig

Offline

 

Board footer