![]() ![]() I personally see doing this JSON-hacking a lot in the future, and not just for nefarious purposes-putting together an abnormally large script is much easier with a simply Python program. But these are public, shared ones, that people are likely to “see inside”. I wouldn't mind at all if this was being done only with downloaded, local projects. Lightnin wrote:This is a cool hack, but my concern is that when anyone who doesn't know what you've done (or how you've done it) tries to view your project, they won't be able to understand your scripts - they won't even make sense. So I think the best ways is to actively discourage making scary-looking hacked blocks, but allow smaller things like stuffing reporters into dropdowns or making really long scripts with external programs. But making the source completely closed and not letting anyone explore is pretty unfair, too. I suppose the truth is that you can't completely disallow hacks just like you can't completely disallow chat rooms-there will always be the ingenuous, enterprising people who get around any walls you put up. ![]() Yet having, for example, a variable in the block, is extremely useful. One issue with that is being able to stuff blocks into others offline-it can be awkward to explain how I fit a reporter into a dropdown to every new Scratcher who asks. That lets us continue messing with blocks in the JSON, but prevents odd-looking blocks. You should only be able to have string and number and boolean inputs, the rest can gracefully become string inputs. One possible solution may be to change the way block definitions are stored, so that you can't hack in special inputs. That said, it would definitely be confusing and intimidating to a new user when I saw nXIII's highscore project I was totally lost (ok, intrigued, impressed and curious, but still admittedly lost). Also, being able to do this allows us to read Scratch projects, too, so I can imagine being able to implement a nice Scratch 2.0 to Snap! converter for Jens and Brian, or do a similar fun project. If it gives you any warnings, select “Ok”. Open up the Scratch project and select File>Import from local drive. On Mac and Linux you can also use the “zip” utility basically the same way we did above. On Mac, rihgt-click the folder and select “Compress…”. On Windows, right-click the folder in which you saved the original zip, and choose “Send to”>“Compressed (Zipped) folder”. Step 4: Reuploading Now save the json file and quit. Finally, I changed the default values in the first line for a professional look. I also changed the input to the append function. A complete list of %-things can be found here, courtesy nXIII. "objName" : "Scratch Cat", "scripts" :, , true ],, , ]] ]]]], All I did was replace a text input with a list drop down. Replace that bit, up to but not including the line “sounds” with: “objName” means the sprite's name, and “scripts” is a list of scripts. These lines are what we will be messing with. If you have a search utility in your text editor (try ctrl-F), look for “Scratch Cat” (the name of the sprite in which we added the custom block). Read more here, but for now I'll explain the basics as we go. It's a simple notation to describe data structures. The format you see with all the colons and brackets is called JSON (JavaScript Object Notation). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |