bharvey wrote:
llarsen wrote:
There is one thing I really miss in both scratch and BYOB. I would love to see first class subroutines.
Jens and I are both confused about your message because we do have what we call first class subroutines; they are created by THE BLOCK and THE SCRIPT, which are exact ports of lambda for reporters and commands respectively.
Some of the things you want to do seem to me to be satisfied by the ability to make sprite-local blocks. In particular polymorphism, as I understand it, works perfectly using our inheritance mechanism.
I think that you are right that creating local blocks for a sprite does do essentially what I was looking for. I hadn't realized this until you mentioned it and I tried it out. You can call the local block directly using a run statement from another sprite. I haven't tested the new first class objects enough to know if there is a generic way to call local blocks using an object reference. I am using the official release rather than the alpha.
I think it would be nice to be able to add the definition for a local block (i.e. the stuff you see in the 'Block Editor') to the script window of the sprite, since this would allow you to see how the block is defined with the other scripts, and it is more obvious (to me) that it is callable on the sprite since it is one of the script in the sprites scripts window.
I do like the 'script' block you added. This is quite handy for some things. However for polymorphism, having a standard interface is important (a subroutine name with specific parameters). Local blocks fit that bill as long as you have multiple sprites that define local blocks with the same name that take the same set of parameters, and there is a way to call these blocks based on an object reference.
Offline
MarySueHunterz12 wrote:
What does BYOB stand for? Oh, if this has already been answered, then I just want to say that I didn't really bother to read the entire forum.
Newcomers are welcome!
It stands for "Build Your Own Blocks," because it lets you add your own blocks to the menu, like this:
Offline
llarsen wrote:
Local blocks fit that bill as long as you have multiple sprites that define local blocks with the same name that take the same set of parameters, and there is a way to call these blocks based on an object reference.
Yeah, you do it with
RUN [ [THE SCRIPT [...] ] OF <OBJREF> ]
where OBJREF is typically a variable whose value is the sprite's name (3.0) or the sprite itself (3.1).
Offline
I haven't been on much lately because I've been Unreal scripting... I keep catching myself wishing unreal script was BYOB so I could use stored procedures and visual nesting O.o but I like the 3Dness of Unreal engine. I should make some BYOB blocks that output Unrealscript into a array which I could export into a text file... I've thought about doing that for other languages 2 but never got around to it.
Offline
To Bharvey:
Okay, thank-you!
That's pretty cool, now that I think about it. Building bolcks might be something that I might need to learn. Mabye I should read this forum!
Oh, and if you're wondering as to why I didn't make a quote, it's because I couldn't get it to work! I can't wait to be a regular scratcher!
Offline
johnnydean1 wrote:
Hey guys. I was playing around on Scratch and realised that there was no tile engines. I then made one, which could display a map. This was not fast enough, so I moved to BYOB. Here is my attempt. It is quite fast, but could be improved. What are peoples opionions?
Okay, nXIII and I have been playing with this, and we can't figure it out. Could you provide some documentation? Tnx.
Offline
bharvey wrote:
johnnydean1 wrote:
Hey guys. I was playing around on Scratch and realised that there was no tile engines. I then made one, which could display a map. This was not fast enough, so I moved to BYOB. Here is my attempt. It is quite fast, but could be improved. What are peoples opionions?
Okay, nXIII and I have been playing with this, and we can't figure it out. Could you provide some documentation? Tnx.
What are you stuck with?
Offline
With comments Commented tile project
Project: Tile Engine
Version: 2
Notes: With Comments
(Link at bottom of page)
Last edited by johnnydean1 (2011-02-23 17:18:30)
Offline
johnnydean1 wrote:
Project: Tile Engine
Version: 2
Notes: With Comments
Ah, a little better. I found a bug: the script that sets ViewX and ViewY based on the four-element list set in another script runs too soon, so if you change what's in the four-element list (which we tried doing) it doesn't affect the next running of the program. I put a WAIT 0.2 SECS in the former script.
We were wondering why you do all that text processing instead of making lists of lists. I guess it's because this started out as a Scratch project.
Offline
TA DA! The official first alpha test release of BYOB 3.1! This is just the image, not all the media files, so newcomers should download a complete package of 3.0 first.
Jens wrote:
This release is the first one in this winter's series that's "complete enough" to be considered an alpha version for BYOB 3.1. There are lots of little changes and some big ones:
- only one SET TO block in the var category, the green one is gone
- setting an attribute via the ATTRIBUTE block in the SET block now works
- same for vars (they can also be set by quoting their block in SET)
- DELETE is now in the vars category and has a reporter slot (with grey border behavior)
- VARIABLE NAMED has been taken out
- CLONE doesn't have an argument slot anymore
- PARTS, SYNCHRONOUS, and ROTATION STYLE are accessible via ATTRIBUTE
- _ IS A _ now also supports the object type
- COSTUMES and SOUNDS are now also accessible via ATTRIBUTES
COSTUMES and SOUNDS attributes, however, as of now only report a list containing their names, not the media items themselves. The cool thing about them is, however, that they dynamically inherit the values and appearances of their parents. Like custom blocks, any new costume you import, draw or shoot for the parent sprite ("prototype") gets inherited by all children ("instances"). Also, if you edit a parent's costume or rearrange the order of costumes or delete costumes in the parent's wardrobe, those changes get inherited by all children.
The dynamic inheritance link gets automatically interrupted whenever you first edit the child's wardrobe, either by importing, drawing or shooting a new costume, or by editing or deleting a costume or by rearranging the order of the child's costumes. You can again restore the inheritance link by executing:
DELETE (THE (ATTRIBUTE costumes) BLOCK)
Note that only the wardrobe (all the parent's costumes) and the sounds ("jukebox") are inherited by default, i.e. when you clone a sprite, not the costume number. If you wish all children to always show the exact same costume as the parent, make sure to DELETE the attribute costume # as well.
This is an alpha version. This means that there are still lots of open ends, inconsistencies and plain bugs. But you should be able get its "big idea" nonetheless, which is Lieberman style prototypes for Scratch.
Enjoy!
--Jens
P.S. Apologies to those of you who wanted to keep the dropdown input to CLONE, but please try it this way and see how you like it. We think it's aesthetically better, and you can still use the OF block as usual to ask another sprite to clone itself.
Offline
bharvey wrote:
TA DA! The official first alpha test release of BYOB 3.1! This is just the image, not all the media files, so newcomers should download a complete package of 3.0 first.
Jens wrote:
...
P.S. Apologies to those of you who wanted to keep the dropdown input to CLONE, but please try it this way and see how you like it. We think it's aesthetically better, and you can still use the OF block as usual to ask another sprite to clone itself.
I agree, there's no reason to scope the clone block to each sprite and then give it the option to clone a different sprite instead! However, it seems to be throwing an error when I try to use it -- I submitted a report.
Also, thanks for getting rid of VARIABLE NAMED!
Offline
Please make block menus (such as the variable menu and attributes menu) accept reporters. It would make it a lot easier to make certain blocks, and it could provide the same functionality as the (variable named []) block.
Offline
When will 3.1 be officially released?
Offline
@fullmoon: Thanks for the bug report. This will be fixed in tonight's build.
@14God: Hmm, I can delete sprites and attributes with it, so I can't reproduce this bug...
@floppy_gunk: Thx for the suggestion! I'm not sure why reporters in variable slots would be helpful, can you give an example of what you'd like to accomplish?
@scimonster: The import question is, when will the new manual be available. Good news: Brian is finalizing it as we speak!
Last edited by Jens (2011-02-24 09:59:39)
Offline
Jens wrote:
Good news: Brian is finalizing it as we speak!
Ta da! Here's the manual for the new version. It includes a couple of features not yet in the code, so don't be surprised. Suggestions for improvement welcome.
Offline
bharvey wrote:
Jens wrote:
Good news: Brian is finalizing it as we speak!
Ta da! Here's the manual for the new version. It includes a couple of features not yet in the code, so don't be surprised. Suggestions for improvement welcome.
The page when I tried to view the manual wrote:
Forbidden
You don't have permission to access /BYOB31Manual.pdf on this server.
Offline
Jens wrote:
@floppy_gunk: Thx for the suggestion! I'm not sure why reporters in variable slots would be helpful, can you give an example of what you'd like to accomplish?
@scimonster: The import question is, when will the new manual be available. Good news: Brian is finalizing it as we speak!
1) It would be useful for changing different variables without using long blocks of if else.
2) I want to know when the official release on the website will be available.
Offline
Tile scroller: v3
Notes: Redone for BYOB
Download here
(Link at bottom of page)
Offline
scimonster wrote:
1) It would be useful for changing different variables without using long blocks of if else.
You can already do that! If you put a variable name into another variable, you can drag that second variable onto the pulldown of SET and it'll set the [i]first[/] variable -- the one named in the variable you put there.
You can drag THE <var> BLOCK onto the pulldown to set var itself.
2) I want to know when the official release on the website will be available.
The alpha version is on the website now, under the regular downloads. The official release is scheduled to be in time for our workshop March 11.
Offline
bharvey wrote:
scimonster wrote:
1) It would be useful for changing different variables without using long blocks of if else.
You can already do that! If you put a variable name into another variable, you can drag that second variable onto the pulldown of SET and it'll set the [i]first[/] variable -- the one named in the variable you put there.
You can drag THE <var> BLOCK onto the pulldown to set var itself.2) I want to know when the official release on the website will be available.
The alpha version is on the website now, under the regular downloads. The official release is scheduled to be in time for our workshop March 11.
Um, no I can't. I am using 3.0.9.
Offline
bharvey wrote:
Ta da! Here's the manual for the new version. It includes a couple of features not yet in the code, so don't be surprised. Suggestions for improvement welcome.
Wow, cool This is awesome.
Offline