Discuss Scratch

minecraftmanpp
Scratcher
40 posts

How exactly do .sb3 files work.

I want specifics about the format .sb3 not just that they store Scratch Projects but how they store scratch projects.
alwayspaytaxes
Scratcher
500+ posts

How exactly do .sb3 files work.

.sb3s are just ZIP files. Try it yourself by renaming a project's file extension to `.zip`

Inside an .sb3 file, Scratch code is stored in a project.json and assets, like sounds and costumes, are stored in the assets directory.
Keep in mind that Scratch stores assets in a seperate server when using the online version (assets.scratch.mit.edu)

Last edited by alwayspaytaxes (April 19, 2023 01:57:21)

minecraftmanpp
Scratcher
40 posts

How exactly do .sb3 files work.

But how does that work exactly.
How would someone do that.

Last edited by minecraftmanpp (April 19, 2023 01:59:29)

alwayspaytaxes
Scratcher
500+ posts

How exactly do .sb3 files work.

minecraftmanpp wrote:

But how does that work exactly.
Blocks are loaded from the project.json into the Code section of the editor statement-by-statement
Assets are loaded as you might expect
How would someone do that.
Right click file > Rename > Change “project.sb3” to “project.zip”
minecraftmanpp
Scratcher
40 posts

How exactly do .sb3 files work.

Now can you give me a brief summary of how project.json is defined.
IceCreamTub
Scratcher
1000+ posts

How exactly do .sb3 files work.

minecraftmanpp wrote:

Now can you give me a brief summary of how project.json is defined.
That's the code in your project, compiled into javascript
-ElectronicArts-
Scratcher
1000+ posts

How exactly do .sb3 files work.

minecraftmanpp wrote:

Now can you give me a brief summary of how project.json is defined.
json is a text-based way of representing JavaScript object literals, arrays, and scalar data.
an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays. Its a common data format with diverse uses in electronic data interchange, including that of web applications with servers.

Last edited by -ElectronicArts- (April 19, 2023 05:58:27)

awesome-llama
Scratcher
1000+ posts

How exactly do .sb3 files work.

There's some info in the Scratch Wiki you can read:
https://en.scratch-wiki.info/wiki/Scratch_File_Format
LongTailCat3
Scratcher
28 posts

How exactly do .sb3 files work.

alwayspaytaxes wrote:

.sb3s are just ZIP files. Try it yourself by renaming a project's file extension to `.zip`

Inside an .sb3 file, Scratch code is stored in a project.json and assets, like sounds and costumes, are stored in the assets directory.
Keep in mind that Scratch stores assets in a seperate server when using the online version (assets.scratch.mit.edu)
wow! i didnt know it was a zip. it even worked for me when i opened it in winrar without renaming it.
-ElectronicArts-
Scratcher
1000+ posts

How exactly do .sb3 files work.

LongTailCat3 wrote:

alwayspaytaxes wrote:

.sb3s are just ZIP files. Try it yourself by renaming a project's file extension to `.zip`

Inside an .sb3 file, Scratch code is stored in a project.json and assets, like sounds and costumes, are stored in the assets directory.
Keep in mind that Scratch stores assets in a seperate server when using the online version (assets.scratch.mit.edu)
wow! i didnt know it was a zip. it even worked for me when i opened it in winrar without renaming it.
Yes you can even open it in notepad. it lags a lot tho.
LongTailCat3
Scratcher
28 posts

How exactly do .sb3 files work.

-ElectronicArts- wrote:

LongTailCat3 wrote:

alwayspaytaxes wrote:

.sb3s are just ZIP files. Try it yourself by renaming a project's file extension to `.zip`

Inside an .sb3 file, Scratch code is stored in a project.json and assets, like sounds and costumes, are stored in the assets directory.
Keep in mind that Scratch stores assets in a seperate server when using the online version (assets.scratch.mit.edu)
wow! i didnt know it was a zip. it even worked for me when i opened it in winrar without renaming it.
Yes you can even open it in notepad. it lags a lot tho.
yaeh from what ive seen any file can be opened in notepad, even stuff like images.
-gr
Scratcher
1000+ posts

How exactly do .sb3 files work.

LongTailCat3 wrote:

(#11)
yaeh from what ive seen any file can be opened in notepad, even stuff like images.
offtopic, but…
how did you open an image in notepad
SavetheAtlantic
Scratcher
1000+ posts

How exactly do .sb3 files work.

-gr wrote:

LongTailCat3 wrote:

(#11)
yaeh from what ive seen any file can be opened in notepad, even stuff like images.
offtopic, but…
how did you open an image in notepad
Open with… > Notepad

Notepad isn't an image viewer, so it interprets the bytes of the file as text. Unless you're using some weird file format like PPM, it will be complete nonsense.

Last edited by SavetheAtlantic (April 19, 2023 12:04:48)

alwayspaytaxes
Scratcher
500+ posts

How exactly do .sb3 files work.

IceCreamTub wrote:

minecraftmanpp wrote:

Now can you give me a brief summary of how project.json is defined.
That's the code in your project, compiled into javascript
It's not exactly compiled. The project.json is just a representation of a project's Scratch blocks. When the editor loads a project, the project.json renders the blocks using the data from JSON.

Besides, Scratch is interpreted, not compiled.

Powered by DjangoBB