If you open a .sb file in wordpad (like I did), This comes up: (The is was my 0S1S Calculator project)
ScratchV02 >ObjSStch c c c c c c c c c
c c c
c c thumbnail# x c c history T2010-1-20 07:30:05 save 0S1S Calculator
2010-1-20 15:55:07 save 0S1S Calculator
author language en scratch-version 1.4 of 30-Jun-09 platform Win32
os-version NT qé`Qª""""""":ªªªEªUUUUUUU:ªªªEªUˆZZf•U:ªªªEªUXUf……U:ªªªEªUXVef•U:ªªªEªUUUUUUU:ªªªEªB"""""""zªªªÿ #Eª c c c c c c c c c c c c c c c c 5ªÖ17¶´c9ËZ1;Ýk=ç8c=éÍJ=ík?ûÞ1?ýï?ÿÿÿObjSStch Ò}c c c c c c c c ?ð c
d <c c ! àh c
?ÿÿÿ Stage c c c c c c c c c c c ¢c c c c c ›c c c c c c c !c "c " c #c $c %c & d 2nd# 1st# 5 answer 120 type factorial counter c 'c (¤c )c * d 2 background1"àh c + ð ´
factorials¯c ,c -c . c /c c 0c !ÿÿ 3 c &c 1
vertical
center
shrinkWrapi c 2c -c 3 c 4 c jc 5c %c -c 6 c 7 c c 8c c 9c ?¹™™™™™š dc :c &c ;c < c =h
c >c
c ?c c 3c @c !c "c " @4 c Ac Bc Cc Dc Ec Fc G popmc H € c I+ € õÿ Ta ! Qì Ä 0lK%)F c Jc Kc Lc Mc Ndc Oc
c -c ! OD [ c P
!
( ?ÿÿÿ c P
default
getVar:! 2 c $<Çdu?ß÷ý! 2 c %
horizontal c Qc R c Sc T c Uc c Vc W c Sc X c Uc c Vc Y c Zc [c \ c ]c ^c _c ` Õ½
rïS#<$› â«sñUÚ_Ä`³©i¨’±åÅGáAó&íGÑaJo}p#a
DÎêó*ɧj‘ý%˜îµ9Ýèâ:`Dvpyµh¢EØgäJµl’zÞ†kŸqÈŽü!0â]}yßäq7M©¶ç©¸O–Œ‰‘i®OÙõ\< _PoïiNV$
òqÅY£g“¶™x²øÚh £6ŽWkf)_¢F¼õòÈÊõ¢Î«Ä2êñÀ9«Q(VñI4+NÛ,º¾¨ì©¼ÑÝŒ¼.<K€YR'9]¬êÅq§)³ºÐö°¥?zQÈQÊ?k}ùçÖÓ¾¶¾UÕ¬õ¼*3‚Aõ@„/,òW՟ó¿õËtãœz z6‰?†8Ò$:Ãç’ο†ÀÏéQk%~: A8µ#–Sè/ÏVÂ*ÂêÑZêI"”5×<Ð5ì#J ZîGØËwË
Öfêo±’*30x+ª<ôódá¿×¸Öö߬ïÍ)\#¨H«¯óRæpߺàÛé3öÌ$ÛòJ„É|òäç5á
á†èzôg¡,_Œ^=þtòçêÊç–é„ïàøùÔJ’Ù 7ûyöô–õÝù×ÿŽ—
ŠUþa 1 2 6 24 120!
VerdanaBold
EventHatMorph Scratch-StartClicked
doAsk First #?
changeVariable
setVar:to: c a %Type? (+, /, *, -, ^, factorial, mod) c a
doIf c bc c c dc e
doIfElse c fc gc h c i c j
answer
not c fc kc l c Sc m c Uc c Vc n
= c oc + c Uc c Vc p c ]c qc rc s c oc factorial 2nd #? c a
readVariable c tc uc v c fc wc x c y c z
+ c oc c oc c oc - c Uc c Vc { c ]c |c }c ~ c c €c c fc ‚c ƒ c „ c …
- c oc c oc c oc * c Uc c Vc † c ]c ‡c ˆc ‰ c Šc ‹c Œ c fc c Ž c c
* c oc c oc c oc / c Uc c Vc ‘ c ]c ’c “c ” c •c –c — c fc ˜c ™ c š c ›
/ c oc c oc c oc mod c Uc c Vc œ c ]c c žc Ÿ c c ¡c ¢ c fc £c ¤ c ¥c ¦c §c ¨c © c ª
\\ c oc c oc c oc factorial c «c ¬c c Uc c Vc c ®c ¯c c °c ±c ² c Uc c Vc ³ c Zc ´c µ
deleteLine:ofList:
all 1
append:toList: 1
doRepeat c c ¶ c ·c ¸ c ¹c ºc c fc »c ¼ c ½ c oc c Uc c ¾ c ®c ¿c
getLine:ofList:
last c oc ^ c Zc Àc Á
changeVar:by: c Šc Âc à c Äc Åc Æ c Çc È c oc c ¹c Éc
> c oc 0 c Uc c Vc Ê c °c Ëc Ì c c Í c oc c c Î c Ï c oc c oc c Uc c Vc Ð c Šc Ñc Ò c oc c oc Thats weird!
Offline
This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.
It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.
NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.
Offline
billyedward wrote:
This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.
It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.
NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.
Sounds interesting, how do you do it?
Offline
billyedward wrote:
This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.
It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.
NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.
I think that WordPad can let us turn BYOB files to Scratch files!
Posted from my Wii
Offline
billyedward wrote:
This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.
It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.
NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.
Please teach me how to do it!
)Offline
You will need a binary editor.
The one which I prefer is Hexedit, however there are loads of others out there.
First, you'll need to open the scratch file.
You will see two main panes: One filled with numbers, and the letters A-F. The other will look like what you saw in notepad. The second one is of most interest to us, at the moment.
To begin: The first 10 letters are the file header.
This is the source of those dreaded 'bad header' errors.
It tells scratch what program made the file. This allows scratch to tell quickly and harmlessly whether it can open that particular file.
1.0-1.2.1 projects will have ScratchV01.
1.3+ projects will have ScratchV02.
BYOB, lists & files, etc. projects have their own.
Using your binary editor, you can change the header.
If you have a project that was made in, say, 1.3, but you want to open it in 1.2, then changing it from ScratchV02 to ScratchV01 will tell scratch that the file is compatible.
One problem: it isn't.
There are many other things you'll have to do in order to make it compatible, but those are unfortunately beyond the scope of this explanation.
Scrolling down, you will see the save history.
This includes the date, time, etc of each save.
In the hex panel (1-9,A-F) you will see that each entry is separated by the byte sequence 09-09-0D.
You can make scratch think that it has been saved more than it has, only once, etc. by carefully adding, editing, or removing entries here, making sure that you stick with this format.
Also, you can get rid of the 'based on ####'s project' message on remixed projects this way, however due to the ethics of this, I'd highly discourage it.
The last thing you can easily do is to edit costume, sprite, variable, list, and sound names. You can also change the project notes, and some things entered into blocks.
Just scroll down until you find some text you recognise, and edit away!
***NOTE: Whatever you do, do not change the length of any string you edit. Just replace characters. I would recommend that you put it into overtype mode, to make this easier.***
One useful thing you can do with the above is:
Make a graphic effect block, with brightness in it.
In the binary editor, change 'brightness' to 'saturation.'
Open it in scratch: The block now says saturation!
But the really cool part is that it works.
Just set the saturation effect to a negative value, and watch what happens.
Also, if you use a scratchconnections application, then you may find it annoying how you can only get the special sensor values when connected... well, not anymore!
Here, just change one of slider, light, etc to your own, of the same length.
Whew!
That's a lot to take in.
Oh well, hope you can use it at some point!
Offline
Jens wrote:
Wow, I'm seriously impressed by this!
Can you get this reprinted on the Scratch Source Code page, please? That would be really nice.
Offline
Just one thing that I forgot to mention in the above post:
It is a VERY good idea to back up the project before you go about editing it.
In case you forget!
Offline
billyedward wrote:
This is because a scratch file is a binary file, not a text file.
This means that each byte is not allocated to a certain character, as it is in a text file.
All those random characters are the result of notepad trying to interpret the file as text, which it isn't.
It is actually possible to edit a scratch file as text... but notepad will not work.
Reply if you are interested in finding out how.
NB: This does have its advantages: You can get rid of any 'bad header' errors this way... often it does lead to a 'key not found' error, but with much care this can also be eliminated.
Oh, please tell me how to get rid of a key not found error! I'm in desperate need of help cos my school project's decided to do this to me 2 days before I need it...
Offline
This is very similar to a project I am doing. I am trying to write a program, in Java for example, to compare two Scratch projects. Once I read in a Scratch project file, how can I determine where the contents object store is and what objects I am looking at within the store?
Offline