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

#1 2012-07-27 15:39:26

MountainBoy
Scratcher
Registered: 2010-07-25
Posts: 34

About: .sb file (Scratch projects)

I'm prepping to do a java program that can me me (and others) code in scratch in notepad (type code & compile it into .sb format with my program) and I'm trying to figure out how to right the program's converter which requires knowledge of the .sb file Help?


______________________________________________________________________________
Scratch on!


when gf clicked
if <<Scratch = Awesome>>
  repeat until <(timer) > [infinite]>
    go to [cool people's place]
  end
end

Last edited by MountainBoy (2012-07-27 15:59:20)

Offline

 

#2 2012-07-27 16:03:38

stevetheipad
Scratcher
Registered: 2011-08-06
Posts: 1000+

Re: About: .sb file (Scratch projects)

MountainBoy wrote:

I'm prepping to do a java program that can me me (and others) code in scratch in notepad (type code & compile it into .sb format with my program) and I'm trying to figure out how to right the program's converter which requires knowledge of the .sb file Help?


______________________________________________________________________________
Scratch on!


when gf clicked
if <(Scratch) = [Awesome]>
  repeat until <(timer) > [infinite]>
    go to [cool people's place]
  end
end

Fixed.  wink

Last edited by stevetheipad (2012-07-27 16:03:51)


http://i.imgur.com/0x8ia.jpg
gone

Offline

 

#3 2012-07-27 17:29:08

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: About: .sb file (Scratch projects)

You shouldn't really encourage blockspam. :I

You might first want to get familiar with modding Scratch, if you haven't already. That's probably the only way you'll learn what a .sb file contains.

Also, this would be better suited in Advanced Topics.


Why

Offline

 

#4 2012-07-28 05:07:27

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: About: .sb file (Scratch projects)

Hi!

I'm working on something similar in Python: I wrote a library called Kurt which can read/write .sb files, including scripts and images. It includes a decompiler script that takes a Scratch project and outputs a bunch of directories for each sprite containing all the images and scripts in scratchblocks format.

I'm working on a compiler to reverse the process and create an .sb file from a similar directory structure, which requires parsing scratchblocks. I'm using the Python version of lex & yacc to do this, which seems to be the best way.

I started some pretty extensive documentation over on the wiki, so that's a good place to start. Feel free to ask me anything if you get stuck -- images are particularly tricky.

Good luck, and have fun!  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#5 2012-07-29 11:03:44

MountainBoy
Scratcher
Registered: 2010-07-25
Posts: 34

Re: About: .sb file (Scratch projects)

blob8108 wrote:

Hi!

I'm working on something similar in Python: I wrote a library called Kurt which can read/write .sb files, including scripts and images. It includes a decompiler script that takes a Scratch project and outputs a bunch of directories for each sprite containing all the images and scripts in scratchblocks format.

I'm working on a compiler to reverse the process and create an .sb file from a similar directory structure, which requires parsing scratchblocks. I'm using the Python version of lex & yacc to do this, which seems to be the best way.

I started some pretty extensive documentation over on the wiki, so that's a good place to start. Feel free to ask me anything if you get stuck -- images are particularly tricky.

Good luck, and have fun!  smile

Thanks for the idea, I'm going to the wiki right now. But I can only do java right now, then ObjectiveC so python would be hard for me.

stevetheipad wrote:

Also, this would be better suited in advanced topics

thankyou sorry about the block thing I'm trying to figure out how to get a signature.
and did you move the topic? If so thanks  smile

Offline

 

#6 2012-07-29 11:07:51

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: About: .sb file (Scratch projects)

MountainBoy wrote:

blob8108 wrote:

Hi!

I'm working on something similar in Python: I wrote a library called Kurt which can read/write .sb files, including scripts and images. It includes a decompiler script that takes a Scratch project and outputs a bunch of directories for each sprite containing all the images and scripts in scratchblocks format.

I'm working on a compiler to reverse the process and create an .sb file from a similar directory structure, which requires parsing scratchblocks. I'm using the Python version of lex & yacc to do this, which seems to be the best way.

I started some pretty extensive documentation over on the wiki, so that's a good place to start. Feel free to ask me anything if you get stuck -- images are particularly tricky.

Good luck, and have fun!  smile

Thanks for the idea, I'm going to the wiki right now. But I can only do java right now, then ObjectiveC so python would be hard for me.

stevetheipad wrote:

Also, this would be better suited in advanced topics

thankyou sorry about the block thing I'm trying to figure out how to get a signature.
and did you move the topic? If so thanks  smile

Isn't python easier to learn than java/objective C?

and objective C is mac only isn't it


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#7 2012-07-29 13:18:24

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: About: .sb file (Scratch projects)

muppetds wrote:

MountainBoy wrote:

blob8108 wrote:

But I can only do java right now, then ObjectiveC so python would be hard for me.

Isn't python easier to learn than java/objective C?

I'd have said Python is easier than Java, definitely! And Java's a little easier than Objective-C.

Python is a lot less restrictive -- you don't have to worry about things like public/private variables and typing. And you already know most of the ideas behind it from coding Java (constructs like for loops, etc). You should really give it a try!  smile

and objective C is mac only isn't it

Essentially, yes. I think it can run on other platforms, and I think iTunes for Windows might be written in Obj-C.  It's mostly used on the Mac, though.


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#8 2012-08-02 13:45:16

Lightnin
Scratch Team
Registered: 2008-11-03
Posts: 1000+

Re: About: .sb file (Scratch projects)

MountainBoy wrote:

I'm prepping to do a java program that can me me (and others) code in scratch in notepad (type code & compile it into .sb format with my program) and I'm trying to figure out how to right the program's converter which requires knowledge of the .sb file Help?


______________________________________________________________________________
Scratch on!


when gf clicked
if <<Scratch = Awesome>>
  repeat until <(timer) > [infinite]>
    go to [cool people's place]
  end
end

Sorry, I don't think we have good documentation for the .sb file format (or if we do, I haven't seen it.)

The next format - .sb2, will just be a json file with a zip file containing the binary stuff like images and sounds. We do plan to document that more clearly - it might be best to wait.


Help Scratchers make the leap to 2.0!
http://img818.imageshack.us/img818/6844/transitionteam.jpg

Offline

 

#9 2012-08-02 14:14:31

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

Re: About: .sb file (Scratch projects)

Lightnin wrote:

Sorry, I don't think we have good documentation for the .sb file format (or if we do, I haven't seen it.)

The next format - .sb2, will just be a json file with a zip file containing the binary stuff like images and sounds. We do plan to document that more clearly - it might be best to wait.

You haven't seen this?


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

Offline

 

#10 2012-08-02 17:04:52

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: About: .sb file (Scratch projects)

MathWizz wrote:

Lightnin wrote:

Sorry, I don't think we have good documentation for the .sb file format (or if we do, I haven't seen it.)

The next format - .sb2, will just be a json file with a zip file containing the binary stuff like images and sounds. We do plan to document that more clearly - it might be best to wait.

You haven't seen this?

I wondered if Lightnin had somehow missed that — but it is a little outdated, so doesn't mention things like lists. (So is from before Scratch 1.3?)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#11 2012-08-04 17:27:01

MountainBoy
Scratcher
Registered: 2010-07-25
Posts: 34

Re: About: .sb file (Scratch projects)

Sorry went to a sleep away camp this week couldn't Scratch  sad 


Thanks every one for the support I think I'll follow Lightnin's advice and wait till Scratch 2.0 comes out. I guess someone should update the wiki too, it's saying .sb OR .sb2  smile .

Offline

 

Board footer