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

#676 2010-06-06 17:05:44

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

Sorry, I always mess up "call" and "run"

So was that your problem, or does it fail with RUN too?


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

Offline

 

#677 2010-06-06 17:16:10

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

Re: BYOB 3 - Discussion Thread

markyparky56 wrote:

I wonder, would this be harder or easier if this wasn't in squeak?

There's a tradeoff involved.  Squeak makes the GUI relatively easy.  The actual evaluation of BYOB programs would be way easier in Scheme.  Most other languages (Java, C++, all those) would make the whole thing harder, most likely.


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

Offline

 

#678 2010-06-06 21:25:54

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

Re: BYOB 3 - Discussion Thread

@MathWizz: can I have that Draw Text block?

Last edited by ScratchReallyROCKS (2010-06-06 21:26:04)


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

Offline

 

#679 2010-06-06 21:51:02

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

Sorry, I always mess up "call" and "run"

So was that your problem, or does it fail with RUN too?

Er ... I forget. Sorry, I'll have to open it again tomorrow.


nXIII

Offline

 

#680 2010-06-07 07:46:59

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

Re: BYOB 3 - Discussion Thread

The bug-reporting link on the BYOB web page now links to a Bugzilla server at http://byobugs.com and it allows anonymous bug reporting so I think it's now legal for under-13-year-olds to use it.  smile   (But I think it does log your IP address.)


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

Offline

 

#681 2010-06-07 08:21:32

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

The bug-reporting link on the BYOB web page now links to a Bugzilla server at http://byobugs.com and it allows anonymous bug reporting so I think it's now legal for under-13-year-olds to use it.  smile   (But I think it does log your IP address.)

Because I'm SO scared of Jens and Brian tracking me down using my IP and email and kidnapping me for exposing so many glitches in the BYOB program.  wink

Offline

 

#682 2010-06-07 10:18:02

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

kidnapping me for exposing so many glitches in the BYOB program.  wink

tongue

Actually, to be fair, that isn't the only reason for the law; they're also worried about targeted advertising and I think maybe also that someone will hold on to your personal info until you get old enough to ID-theft you.  But, yeah, none of those things would happen if we got your email.  Thanks for the vote of confidence.  smile


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

Offline

 

#683 2010-06-07 19:56:18

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

Re: BYOB 3 - Discussion Thread

JENS IS BACK!!!

2.99.014, mostly improvements to the debugger.


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

Offline

 

#684 2010-06-07 20:07:36

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

JENS IS BACK!!!

2.99.014, mostly improvements to the debugger.

Ugh, I tried to send universal setters to Jens but my email program refuses to attach the image!


nXIII

Offline

 

#685 2010-06-07 20:12:46

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

Ugh, I tried to send universal setters to Jens but my email program refuses to attach the image!

Try zipping the image first?  You never know...


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

Offline

 

#686 2010-06-07 20:25:34

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

Ugh, I tried to send universal setters to Jens but my email program refuses to attach the image!

Try zipping the image first?  You never know...

Good suggestion, but it still won't do it...


nXIII

Offline

 

#687 2010-06-07 21:05:29

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

Good suggestion, but it still won't do it...

Check your inbox.


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

Offline

 

#688 2010-06-08 21:03:02

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

Re: BYOB 3 - Discussion Thread

New image 2.99.015 with more debugger improvements, plus a new rule for handling events: If a script is already running because of a previous event of the same type, the new event does not restart the script, but is just ignored.


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

Offline

 

#689 2010-06-08 22:47:15

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

New image 2.99.015 with more debugger improvements, plus a new rule for handling events: If a script is already running because of a previous event of the same type, the new event does not restart the script, but is just ignored.

Does that affect broadcasts as well? If not, it should!

Offline

 

#690 2010-06-09 03:48:53

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

Does that affect broadcasts as well? If not, it should!

Yes, it affects broadcasts (key pressed events already behave like this in normal Scratch). What's new in 2.99.015 is that every thread (script) gets fully completed before it can be restarted. This appears to be the right thing for CS projects and for animations, but personally I do like Scratch's current rule better, because it makes it easy to create interactive music projects where you can e.g. pick a guitar string arbitrarily.

That's why there's a new experimental block in 2.99.015 labelled

     STOP ALL SCRIPTS FOR [aMessage]

that will force quit any running scripts hatted by a "When I receive [aMessage]" block.

But we're still discussing this. Chances are we'll take that new stop block out again, revert the standard to the "Scratch compatible" thread reentrancy rule and just offer the "ignore mode" option in the EDIT menu.

Which would you prefer?

Last edited by Jens (2010-06-09 07:20:58)


Jens Mönig

Offline

 

#691 2010-06-09 09:41:22

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

shadow_7283 wrote:

Does that affect broadcasts as well? If not, it should!

Yes, it affects broadcasts (key pressed events already behave like this in normal Scratch). What's new in 2.99.015 is that every thread (script) gets fully completed before it can be restarted. This appears to be the right thing for CS projects and for animations, but personally I do like Scratch's current rule better, because it makes it easy to create interactive music projects where you can e.g. pick a guitar string arbitrarily.

That's why there's a new experimental block in 2.99.015 labelled

     STOP ALL SCRIPTS FOR [aMessage]

that will force quit any running scripts hatted by a "When I receive [aMessage]" block.

But we're still discussing this. Chances are we'll take that new stop block out again, revert the standard to the "Scratch compatible" thread reentrancy rule and just offer the "ignore mode" option in the EDIT menu.

Which would you prefer?

Hmm... it depends. I could see how both methods of evaluation could come in handy. It think it would be nice to have a couple blocks to control them. It seems that I always end up using a variable when broadcasting messages. Sometimes, it happens when I'm using "repeat until" at the end of a message. Really, I would just like it to be inerupted if a certain condition is true. But I always end up creating another if statment surrounding all broadcasts to wait until that condition is met. Not very efficient. However, sometimes my projects depend on the fact that the broadcasts can be interupted and restarted, especially when they use "forevers" at the end of their script. So I think it would be nice to have blocks to control this.

However, I don't really think I like Scratch's method for message passing, period. It always annoys me how I can't have a message available for just a single sprite (like variables!) or just a couple. I almost always end up using boolean variables as an alternative and set them to 1 (representing true) if a message is being passed and 0 (representing false) if a message has been completed, or started (which eliminates the need for the blocks you created). Is there anyway BYOB could include a message passing system more like variables?

By the way, I'm glad your back!  smile

Last edited by shadow_7283 (2010-06-09 09:43:56)

Offline

 

#692 2010-06-09 12:37:35

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

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

It always annoys me how I can't have a message available for just a single sprite (like variables!) or just a couple.

We have that!  You just say

LAUNCH [<method> OF <sprite>]

with inputs, if you want, even.   smile   "Method" should be
a "for this sprite only" block or a "for this sprite only"
variable whose value is a script.

If you'd like an answer back from the other sprite, just use CALL instead of LAUNCH.


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

Offline

 

#693 2010-06-09 13:19:35

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

But we're still discussing this. Chances are we'll take that new stop block out again

I'll just go make a duplicate of the 2.99.015 image file...


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#694 2010-06-09 14:09:57

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

shadow_7283 wrote:

It always annoys me how I can't have a message available for just a single sprite (like variables!) or just a couple.

We have that!  You just say

LAUNCH [<method> OF <sprite>]

with inputs, if you want, even.   smile   "Method" should be
a "for this sprite only" block or a "for this sprite only"
variable whose value is a script.

If you'd like an answer back from the other sprite, just use CALL instead of LAUNCH.

I still don't get the reason for this... it should launch the script that is in the selected sprite's variable in a separate thread, BUT EXECUTE IT FOR THE SENDING SPRITE. It should not be a special-evaluation rule.


nXIII

Offline

 

#695 2010-06-09 16:34:31

jstout
Scratcher
Registered: 2007-05-04
Posts: 39

Re: BYOB 3 - Discussion Thread

Using Elements, if I create a message send of open to Workspace I get a workspace into which I can type. However, trying to evaluate/print what I've typed doesn't work.

If I do the same in a Workspace in Squeak it does.

Is this locked down in some way or is there something more to do with the Scratch 'layer'?

I'd like to be able to show BYOB going all the way up from simple turtle type activities as in Scratch, out to Smalltalk, then back into the first class facilities of BYOB (and I quite often like typing rather than dragging and dropping as with elements as I sometimes suffer from wrist strain if I do too much)

Last edited by jstout (2010-06-09 16:43:58)

Offline

 

#696 2010-06-09 16:39:25

jstout
Scratcher
Registered: 2007-05-04
Posts: 39

Re: BYOB 3 - Discussion Thread

nXIII wrote:

bharvey wrote:

...
LAUNCH [<method> OF <sprite>]

with inputs, if you want, even.   smile   "Method" should be
a "for this sprite only" block or a "for this sprite only"
variable whose value is a script.

If you'd like an answer back from the other sprite, just use CALL instead of LAUNCH.

I still don't get the reason for this... it should launch the script that is in the selected sprite's variable in a separate thread, BUT EXECUTE IT FOR THE SENDING SPRITE. It should not be a special-evaluation rule.

Surely this would require the receiving sprite's code to have access to the sending sprite's internals, e.g., I write a block called sayA which says the value of the variable A, that's a for this sprite only variable. How can another sprite that doesn't have a variable A, or has a variable A that is used for some other purpose, then execute that block.

Or am I getting the wrong end of the stick?

Offline

 

#697 2010-06-09 16:45:35

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

I still don't get the reason for this... it should launch the script that is in the selected sprite's variable in a separate thread, BUT EXECUTE IT FOR THE SENDING SPRITE. It should not be a special-evaluation rule.

I see your point, in principle.  But it would be messy.  Consider: why did the programmer make this method be local to a given sprite?  Most likely, because it makes reference to that sprite's private state variables!  Otherwise it could just be a global block and there would be no need to use the [<method> OF <sprite>] block.  So, what you're asking for would work only if the calling sprite knows about and duplicates the called sprite's local variables.

And since the thing that's easy to specify and implement happens also to be the thing that programmers really want anyway -- the ability to send a message to another specific sprite -- we were happy to run with it.

The way to make it make sense theoretically is to understand variable references in a sprite-local block as lexically bound; we know as soon as the block is defined exactly which variable is meant by this variable name.  So if you don't like thinking about running the method "in" the other sprite, then don't think of it as "in" any sprite at all; just think of [i]the method itself]/i] as including references to specific variables, in the same way that methods in the explicit-dispatch-procedure style of OOP know which of several instance variables of the same name to use.

EDIT:  The lexical scoping of variables is compromised a little in BYOB in order to make it possible to duplicate a sprite (or just drop one script onto another sprite) and still find local variables.
If the variable referred to in a script doesn't belong to the current block, then BYOB searches through the current lexical scope for a variable with tha same name and reattaches the orange blob to the new variable.

Last edited by bharvey (2010-06-09 17:33:21)


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

Offline

 

#698 2010-06-09 17:26:26

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

Re: BYOB 3 - Discussion Thread

@bharvey

I've just started to explore what I call "hybrid functions" (the official name is probably method ?). Very, very interesting !

See the "helicos" example at my "tutorial" link :
http://www.xleroy.net/ByobTuto/Thumbnails.html

I've now to add the shooter script and I'll have my first Byob game !
I'd would like then to add the walkyrie to get a remake of "apocalypse now "

Offline

 

#699 2010-06-09 17:45:13

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

Re: BYOB 3 - Discussion Thread

xly wrote:

I've just started to explore what I call "hybrid functions"

Instead of the WAITs you could use BROADCAST to synchronize.

WHEN I RECEIVE <allmes>
RUN <RED>
BROADCAST <reddone>

WHEN I RECEIVE <reddone>
RUN BLUE
BROADCASY <bluedone>

WHEN I RECEIVE <bluedone>
RUN GREEN


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

Offline

 

#700 2010-06-09 19:30:55

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

xly wrote:

I've just started to explore what I call "hybrid functions"

Instead of the WAITs you could use BROADCAST to synchronize.

Thanks ! So many possibilities to explore by combining Scratch AND Byob features !
I've got my Walkure ride very easily :
1- youtube to get one of the mp3 version.
2 - go into the sprite and select the "sound" tab.
3 - create a new sound.
4 - import the sound + mp3 file
5 - select the primitive SOUND : Play sound (mp3) until done.
6 - launch it with the Green Flag procedure.

I've checked the compiled version of this demo project. It is OK.

This inspires me the following remark : even if the "First class programming" seems strange or unusual (methods for example) , once compiled it becomes a program like any other executable (subject to the condition that this way of programming does not penalize too much the speed of the compiled executable !That is another story )

Offline

 

Board footer