Discuss Scratch

GP1
Scratcher
100+ posts

Scratch 1.4 file writer code?

Hello. I am new to the format in which Scratch 1.4 is in, and I need to be able to write to a Scratch 1.4 file format via PHP. I searched the world out of the wiki, and looked over and over at the documentation for the format. And, I just do not understand it! Is there some simple source code that writes to a .sb file (perhaps reads). If not, could somebody be kind enough to explain exactly how writing would take effect? Thank you!

EDIT: Yes, yes, I know that the Scratch 2.0 file format is easier than the 1.4 format. However, I need to write specifically to the 1.4 format at first.

Last edited by GP1 (Aug. 10, 2013 05:30:31)


Hardmath123
Scratcher
1000+ posts

Scratch 1.4 file writer code?

If you're not bound to use PHP, blob8108 wrote an amazing library called Kurt to read and write Scratch 1.4 and 2.0 files with Python (you can run Python on servers, too, if that's why you wanted PHP).

EDIT: http://scratch.mit.edu/discuss/topic/12681/

Last edited by Hardmath123 (Aug. 10, 2013 05:40:17)

GP1
Scratcher
100+ posts

Scratch 1.4 file writer code?

Hardmath123 wrote:

If you're not bound to use PHP, blob8108 wrote an amazing library called Kurt to read and write Scratch 1.4 and 2.0 files with Python (you can run Python on servers, too, if that's why you wanted PHP).

EDIT: http://scratch.mit.edu/discuss/topic/12681/
That is actually what I am looking for! Do you happen to know which script the saving code is in, or do I have to find it myself (quick look and I couldn't find it ). I may be able to turn it into PHP code.

Last edited by GP1 (Aug. 10, 2013 06:00:41)


blob8108
Scratcher
1000+ posts

Scratch 1.4 file writer code?

The 1.4 file format is a bit of a mess. What precisely are you trying to do? Unless you're trying to write something very simple, it's probably not worth porting to PHP.

tosh · slowly becoming a grown-up adult and very confused about it
GP1
Scratcher
100+ posts

Scratch 1.4 file writer code?

blob8108 wrote:

The 1.4 file format is a bit of a mess. What precisely are you trying to do? Unless you're trying to write something very simple, it's probably not worth porting to PHP.
http://scratch.mit.edu/discuss/topic/13101/
For functionality, I want full support of Scratch 1.4 first. Go Everywhere is a way to edit scratch projects on mobile devices, not a way to have something new altogether. I emailed the Scratch team about uploading Go Everywhere projects to the Scratch website. They have not responded, but I do not think that they would say no (since the projects do not have any modded material. They only have been edited in a different editor.) Because Go Everywhere is cheap, we can only use free webhosts with PHP installed (unless ssss can donate a paid server). And that means that PHP has to be our language to do this in. We can read Scratch 1.4 projects (thanks to MathWhiz, but I am extremely unsure about how he did it). We just need to be able to write to them.

nathanprocks
Scratcher
1000+ posts

Scratch 1.4 file writer code?

GP1 wrote:

blob8108 wrote:

The 1.4 file format is a bit of a mess. What precisely are you trying to do? Unless you're trying to write something very simple, it's probably not worth porting to PHP.
http://scratch.mit.edu/discuss/topic/13101/
For functionality, I want full support of Scratch 1.4 first. Go Everywhere is a way to edit scratch projects on mobile devices, not a way to have something new altogether. I emailed the Scratch team about uploading Go Everywhere projects to the Scratch website. They have not responded, but I do not think that they would say no (since the projects do not have any modded material. They only have been edited in a different editor.) Because Go Everywhere is cheap, we can only use free webhosts with PHP installed (unless ssss can donate a paid server). And that means that PHP has to be our language to do this in. We can read Scratch 1.4 projects (thanks to MathWhiz, but I am extremely unsure about how he did it). We just need to be able to write to them.
Why not read 1.4 projects and save them as 2.0 project?


My browser / operating system: Macrosoft Winding XO, Internet Exploder 6.0, Angel Player ver.:1.2.5
;
GP1
Scratcher
100+ posts

Scratch 1.4 file writer code?

nathanprocks wrote:

GP1 wrote:

blob8108 wrote:

The 1.4 file format is a bit of a mess. What precisely are you trying to do? Unless you're trying to write something very simple, it's probably not worth porting to PHP.
http://scratch.mit.edu/discuss/topic/13101/
For functionality, I want full support of Scratch 1.4 first. Go Everywhere is a way to edit scratch projects on mobile devices, not a way to have something new altogether. I emailed the Scratch team about uploading Go Everywhere projects to the Scratch website. They have not responded, but I do not think that they would say no (since the projects do not have any modded material. They only have been edited in a different editor.) Because Go Everywhere is cheap, we can only use free webhosts with PHP installed (unless ssss can donate a paid server). And that means that PHP has to be our language to do this in. We can read Scratch 1.4 projects (thanks to MathWhiz, but I am extremely unsure about how he did it). We just need to be able to write to them.
Why not read 1.4 projects and save them as 2.0 project?
My main reason is that the player we are using, JsScratch, reads from the 1.4 format. However, thank you for the suggestion! I had not considered it. I'll try it out. Just need to rewrite JsScratch a little.

djdolphin
Scratcher
1000+ posts

Scratch 1.4 file writer code?

In Mathwizz's sig there's a link to this javascript library for reading and writing scratch projects.

!
scimonster
Scratcher
1000+ posts

Scratch 1.4 file writer code?

Many free hosts also allow Python scripts.

Retired Community Moderator
BTW, i run Google Chrome 41.0.2272.101 on a Linux system - Ubuntu 14.04. NEW: iPad 4th gen. w/retina.

418 I'm a teapot (original - to be read by bored computer geeks)
THE GAME (you just lost)
; THE SEMICOLON LIVES ON IN OUR SIGS
GP1
Scratcher
100+ posts

Scratch 1.4 file writer code?

djdolphin wrote:

In Mathwizz's sig there's a link to this javascript library for reading and writing scratch projects.
Ok, thanks!

scimonster wrote:

Many free hosts also allow Python scripts.
That is true, however most that I could find to not support both PHP and Python.

Powered by DjangoBB