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
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.
Last edited by stevetheipad (2012-07-27 16:03:51)
Offline
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.
Offline
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!
Offline
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!
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
Offline
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!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
Isn't python easier to learn than java/objective C?
and objective C is mac only isn't it
Offline
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!
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.
Offline
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.
Offline
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.
Offline
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.
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?)
Offline
Sorry went to a sleep away camp this week couldn't Scratch
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 .
Offline