I just started working with Scratch Mods today, and have a few questions about how some functions work. For starters, where do you put codes for scratch blocks? In the block library, there is a code section, but I have no clue where you would put them. Secondly, how do you create new files in the squeak browser? For instance, I'm trying to put in the change rotation style to %r block. I have %r set up, but don't know where to put the list of options it gets its data from. And third, where do you find option lists so you can edit them? I'm trying to restore the obsolete graphic effects to the color effects menu, so in addition to the usual color/mosaic/ghost/whatever options, pointillize, saturation, and water ripple would be present too.
Offline
Jrocket97 wrote:
I just started working with Scratch Mods today, and have a few questions about how some functions work. For starters, where do you put codes for scratch blocks? In the block library, there is a code section, but I have no clue where you would put them. Secondly, how do you create new files in the squeak browser? For instance, I'm trying to put in the change rotation style to %r block. I have %r set up, but don't know where to put the list of options it gets its data from. And third, where do you find option lists so you can edit them? I'm trying to restore the obsolete graphic effects to the color effects menu, so in addition to the usual color/mosaic/ghost/whatever options, pointillize, saturation, and water ripple would be present too.
You may want to see the Modding Tutorial.
Offline
yes, I'm using the scratch program. and I already know all of the stuff from that tutorial. I'm trying to make the change rotation style block. I can't figure out where you would add the data for the drop down menu so it does something.
The code from the library is this:
('set rotation style to %r' #- #rotationStyle:)rotationStyleChanger
^ #('normal' 'leftRight' 'none' )$r = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #rotationStyleChanger;
choice: 'normal'].I know where to put the first and last codes there, but where on earth do you put the middle one? And for that matter, how do you create new data files? I take it that rotationStyleChanger will have to be a new file for it to work properly.
And with regards to my other request, I'm trying to make it so the graphic effects blocks can have saturation, pointillize, blur, and water ripple in the drop down menu.
Where would I find the drop down menu that I can edit to do that?
Last edited by Jrocket97 (2012-04-18 21:49:37)
Offline
I'm a bit rusty to where the code goes for the methods, or even where the blocks list is, but one thing:
JRocket97 wrote:
Secondly, how do you create new files in the squeak browser?
You don't. Smalltalk doesn't have the notion of storing code in files, really. Everything is just there in the image.
Or if you mean create files not for code, but for something else, I think there's a File class. Poke around in that.
Google it.
Offline
jwosty, what I mean by files is the little sections of text that are title "blockspecs" for instance. How would you create a new one of those sections for block code or whatever? And I really want to find that list...
And I searched again, I can't believe I can't find a single tutorial on where to put the code. Renders the entire block library redundant.
Last edited by Jrocket97 (2012-04-19 13:50:41)
Offline
Aaaaaaaaah, this is ridiculous! I've searched for hours, and I can't find anything. Kudos to MIT for hiding stuff that would allow tampering with the code so well. I can't find those drop down menu choices at all, I can't figure out how to code new commands for the program to execute... blargh. And another question, I've noticed Panther and BYOB both have new block classes (panther has colors and files, BYOB has other). How were those made? And jwosty, to adapt my question to how you worded the answer, since the image is divided into commands and such, how do you make a new command in the image. Do you use something else from open?
Last edited by Jrocket97 (2012-04-19 17:54:09)
Offline
Jwosty wrote:
Ahhh, I see now. To create a new category, option/alt-click on the parent and there's an option in there somewhere.
As for blocks, I'll find that too now.
Alt-click? How? I've always made categorys using the browser and workspace...
Offline
nathanprocks wrote:
Jwosty wrote:
Ahhh, I see now. To create a new category, option/alt-click on the parent and there's an option in there somewhere.
As for blocks, I'll find that too now.Alt-click? How? I've always made categorys using the browser and workspace...
Okay, say you have a class Hello under the category Greeter, and you want to create a method category called politeMethods. You hold the alt button, click on the all section, and click on "new category."
And the blocks are implemented partly as methods on ScriptableScratchMorph and ScratchSpriteMorph.
Last edited by Jwosty (2012-04-20 08:50:30)
Google it.
Offline
well, that helps some. thanks. still really confusing though. And whenever I mod and save the image, I get this weird glitch where it says "Squeak cannot locate Squeakv2.sources." And after I click ok, it also comes up with "Squeak cannot locate scratch.changes. From there, everything works fine, except on startup fill screen mode is always off. Stupid programs. Can't wait til 2.0 comes out and blocks can be coded without all this nonsense.
Edit: Alt clicking is just bringing up menus for the browser like it would for a block, and says nothing about new categories.
Last edited by Jrocket97 (2012-04-20 15:46:43)
Offline
Yes, I'm really sorry, the Library is very unclear when it comes to the correct location for the methods used in new blocks! We're hoping to fix this soon as we're looking into creating easy-to-download-and-install block files. We'll have to specify the correct place for each block method when we make the changeover, and the file should help you no end!
It's great that you're using the library though, so thank you! I'll just slip in a link to the post entitled can I use these blocks in my Scratch Modification?. You may wish to give it a read
Offline
To define your block, click what you want it in.
If it starts with "message selector and argument names" you are on the right track. If now make sure you are on Instance.
Then use your knowledge of Squeak to define it.
Offline
Jrocket97 wrote:
whenever I mod and save the image, I get this weird glitch where it says "Squeak cannot locate Squeakv2.sources." And after I click ok, it also comes up with "Squeak cannot locate scratch.changes.
Ah, you must be using just plain Scratch.image, am I right? This is because you need those two files to read the source code. You can find the source here.
Google it.
Offline
Jrocket97 wrote:
yes, I'm using the scratch program. and I already know all of the stuff from that tutorial. I'm trying to make the change rotation style block. I can't figure out where you would add the data for the drop down menu so it does something.
The code from the library is this:Code:
('set rotation style to %r' #- #rotationStyle:)Code:
rotationStyleChanger ^ #('normal' 'leftRight' 'none' )Code:
$r = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #rotationStyleChanger; choice: 'normal'].I know where to put the first and last codes there, but where on earth do you put the middle one? And for that matter, how do you create new data files? I take it that rotationStyleChanger will have to be a new file for it to work properly.
And with regards to my other request, I'm trying to make it so the graphic effects blocks can have saturation, pointillize, blur, and water ripple in the drop down menu.
Where would I find the drop down menu that I can edit to do that?
How do you make a mod completely out of scratch?
How would you be able to upload it...?
Offline
coolhogs, what you do to mod scratch is shift click the r in the scratch logo in the top left corner and select turn fill screen off. From there, you click in the resulting gray area, click open, and click browser. It lets you modify the source code of the program.
Offline
Jrocket97 wrote:
coolhogs, what you do to mod scratch is shift click the r in the scratch logo in the top left corner and select turn fill screen off. From there, you click in the resulting gray area, click open, and click browser. It lets you modify the source code of the program.
Uploading...?
Edit: You have to edit the source code...
It makes it easier to make the mod...
Last edited by coolhogs (2012-04-20 21:25:14)
Offline