Discuss Scratch

powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

jandrewg wrote:

Oh. When you create a new method, you have to make it in a separate place. So copy/cut the jumpMenu: code from createMenuPanel. Then click ScratchFrameMorph (instance) > menu/button actions, then paste in your jump menu code.


Explore, my Scratch mod | Car Crash | My projects | (image by @MicroMacro)
Thepuzzlegame
Scratcher
1000+ posts

How to make a 1.4 mod

Really great tutorials here! Just as a suggestion you might want to add something about alt clicking when fill screen is turned off

hi!
powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

Thepuzzlegame wrote:

Really great tutorials here! Just as a suggestion you might want to add something about alt clicking when fill screen is turned off
Oh, yeah.

Hey all! You can alt-click morphs with fill screen off, to delete them, inspect them, etc!


Explore, my Scratch mod | Car Crash | My projects | (image by @MicroMacro)
Austinato
Scratcher
1000+ posts

How to make a 1.4 mod

I'm new; on the first chapter, how do you extract?

5794 posts | Signature banner done by ZLGames (thanks!)
Thepuzzlegame
Scratcher
1000+ posts

How to make a 1.4 mod

Austinato wrote:

I'm new; on the first chapter, how do you extract?
Right-click on the zip file and click extract all.

hi!
liam48D
Scratcher
1000+ posts

How to make a 1.4 mod

Thepuzzlegame wrote:

Austinato wrote:

I'm new; on the first chapter, how do you extract?
Right-click on the zip file and click extract all.
Or, if your on a Mac, you can probably just double click on the .zip and it should extract everything.

202e-202e-202e-202e-202e UNI-CODE~~~~~
jandrewg
Scratcher
100+ posts

How to make a 1.4 mod

powerpoint56 wrote:

jandrewg wrote:

Oh. When you create a new method, you have to make it in a separate place. So copy/cut the jumpMenu: code from createMenuPanel. Then click ScratchFrameMorph (instance) > menu/button actions, then paste in your jump menu code.
what do you mean?

My old sig has broken
My Platforming Games: Water - a Platforming Game | Water 2 - a Platforming Game
powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

jandrewg wrote:

what do you mean?
First, make the changes to createMenuPanel:

createMenuPanel
| t1 t2 |
menuPanel _ AlignmentMorph new color: Color transparent;
centering: #center;
inset: 0;
height: 0.
self addShortcutButtonsTo: menuPanel.
t1 _ #((#File #fileMenu:) (#Edit #editMenu:) (#Jump #jumpMenu:) (#Help #helpMenu:) ).
t1 do:
[:t3 |
t2 _ ScratchMenuTitleMorph new contents: (t3 at: 1) localized;
target: self selector: (t3 at: 2).
menuPanel addMorphBack: t2.
#helpMenu: = (t3 at: 2) ifFalse: [menuPanel addMorphBack: (Morph new color: Color transparent;
extent: 12 @ 5)]].
topPane addMorph: menuPanel

Then, you add a new method to ScratchFrameMorph, called “jumpMenu:”. This method creates your menu.

Click on the ScratchFrameMorph button in the browser. Then click the menu/button actions button. In the coding space below, there will be green highlighted text. Delete the text, and code the jumpMenu: method.

jumpMenu: t1
"whatever you put in your menu goes here"

Last edited by powerpoint56 (Aug. 11, 2014 18:08:04)



Explore, my Scratch mod | Car Crash | My projects | (image by @MicroMacro)
EMPedemonte20
Scratcher
100+ posts

How to make a 1.4 mod

al-x wrote:

EMPedemonte20 wrote:

powerpoint56 wrote:

Add a new category
I learned most of this from LS97's tutorial: (Go here and download Scratch Skin VFAQ).

To add a new category, you first need to download the Scratch Skin here: http://download.scratch.mit.edu/source-code/ScratchSkin1.4.zip. Extract the ZIP folder to your mod's folder. Copy the files controlPressed, controlOver, and control and rename the copies with the name of your category (yourCategoryPressed, yourCategoryOver, yourCategory). Optionally, you can edit the pictures with a graphics-editing software so that they're the color of your category.

Then, open Bubble (your mod), and from there open the workspace. Type in the below code, select it, and choose to “do it”.
ScratchFrameMorph readSkinFrom: (FileDirectory default directoryNamed: 'ScratchSkin')
Any time you edit the Skin in any way, you'll need to run this code to make your changes take effect.
Go to Scratch-UI-Panes > ScratchViewerMorph (instance) > –all– > rebuildCategorySelectors. Add your category/categories to the list. If you're adding an odd number of categories, go down to where it says “catButtonsExtent _” and replace the line with this code:
catButtonsExtent _ ((2 * maxExtent x) + (3 * pad)) @ ((((catList size / 2) rounded) * (maxExtent y + 6)) + 25).
Finally, we have to specify the color of the blocks in our category. Go to ScriptableScratchMorph (class) > blockSpecs > blockColorFor:. Add the below line to the other lines like it in the code. Replace “yourCategory” with your category's name and the color with any color. You can also use rgb.
	'yourCategory' = aCategory ifTrue: [^ (Color h: 25 s: 0.88 v: 0.95)].
Save the .IMAGE and open your mod again. You'll see your new category there!

I keep getting an error when trying to add two categories to my mod. I followed all your instructions, but I keep getting a key not found error:
Dictionary(Object)>>error:
Dictionary>>errorKeyNotFound
[] in ScratchFrameMorph class>>skinAt:
Dictionary>>at:ifAbsent:
ScratchFrameMorph class>>skinAt:ifAbsent:
ScratchFrameMorph class>>skinAt:
[] in ScratchViewerMorph>>rebuildCategorySelectors
Array(SequenceableCollection)>>collect:
ScratchViewerMorph>>rebuildCategorySelectors
ScratchFrameMorph>>createBasicPanes
I troubleshooted, and found out my error had to do with a new ‘Common’ category I added, but I know I have it and that it is spelled correctly.

Copy and paste all the code in the rebuildCategorySelectors in a comment here so we can see what went wrong.

rebuildCategorySelectors

| catList maxExtent buttons label offForm onForm overForm b pad leftColumnX rightColumnX x y |
(Compatability = true) ifTrue: [
catList _ #(
motion control
looks sensing
sound operators
pen variables)]
ifFalse: [
catList _ #(
motion control
looks sensing
sound operators
pen variables
squeak other)].

"First, delete the old category buttons"
submorphs do: [:m | (m isKindOf: ResizableToggleButton2) ifTrue: [m delete]].

"Create new buttons, keeping track of the maximum extent."
maxExtent _ 75@0.
buttons _ catList collect: [:cat |
label _ (ScratchTranslator translationFor: cat asString) capitalized.
offForm _ (ScratchFrameMorph skinAt: cat).
onForm _ (ScratchFrameMorph skinAt: (cat, 'Pressed')).
overForm _ (ScratchFrameMorph skinAt: (cat, 'Over')).
ScratchTranslator isRTL
ifTrue:[
b _ ResizableToggleButton2 new
offForm: (offForm flipBy: #horizontal centerAt: offForm center)
onForm: (onForm flipBy: #horizontal centerAt: onForm center)
overForm: (overForm flipBy: #horizontal centerAt: overForm center)]
ifFalse:[
b _ ResizableToggleButton2 new
offForm: offForm
onForm: onForm
overForm: overForm].
b
label: label font: (ScratchFrameMorph getFont: #Category);
setLabelColor: Color white;
target: self;
actionSelector: #currentCategory:;
arguments: (Array with: cat);
toggleButtonMode: true;
toggleMode: false.
ScratchTranslator isRTL
ifTrue:[b rightJustifyInset: 10]
ifFalse:[b leftJustifyInset: 10].
maxExtent _ maxExtent max: (b extent + (3 @ -6)).
b].

"calculate catButtonsExtent"
pad _ 15. "padding on left, right, and betwen the button columns"
catButtonsExtent _ ((2 * maxExtent x) + (3 * pad)) @ (((catList size // 2) * (maxExtent y + 6)) + 25).

"place the buttons"
leftColumnX _ self left + 12 + pad.
rightColumnX _ leftColumnX + maxExtent x + pad.
x _ leftColumnX.
y _ self top + 17.
1 to: buttons size do: [:i |
b _ buttons at: i.
b extent: maxExtent.
self addMorph: (b position: x@y).
i even
ifTrue: [x _ leftColumnX. y _ y + b height + 6]
ifFalse: [x _ rightColumnX]].

self width: catButtonsExtent x.
pageViewer position: self position + (0@catButtonsExtent y).
topSectionHeight _ catButtonsExtent y - 4.
That's all of it.
And sorry for the late response.

There are 10 types of people in this world. People who know binary code, and people who don't.
My mod, NoMod!!!
childishbeat
Scratcher
55 posts

How to make a 1.4 mod

I think you should do a tutorial on how to change the logo of Scratch, since you've told me how to change the title.

Last edited by childishbeat (Sept. 2, 2014 09:23:18)


powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

EMPedemonte20 wrote:

…code…
That's all of it.
And sorry for the late response.
Hmm, I can't figure it out. Clearly, your Scratch skin is missing something, but I don't know what… Try to get the error message again. Click the “Debug” button, then click on the item " in ScratchFrameMorph class>>skinAt:". Below, it will show the code for that method. Below that, it should show a list of temporary variables used in the method. Click on the first variable in the list (probably “t1”). What it shows you is the skin that's missing.

childishbeat wrote:

I think you should do a tutorial on how to change the logo and the title of Scratch.
Ok, I will soon.


Explore, my Scratch mod | Car Crash | My projects | (image by @MicroMacro)
childishbeat
Scratcher
55 posts

How to make a 1.4 mod

powerpoint56 wrote:

EMPedemonte20 wrote:

…code…
That's all of it.
And sorry for the late response.
Hmm, I can't figure it out. Clearly, your Scratch skin is missing something, but I don't know what… Try to get the error message again. Click the “Debug” button, then click on the item " in ScratchFrameMorph class>>skinAt:". Below, it will show the code for that method. Below that, it should show a list of temporary variables used in the method. Click on the first variable in the list (probably “t1”). What it shows you is the skin that's missing.

childishbeat wrote:

I think you should do a tutorial on how to change the logo and the title of Scratch.
Ok, I will soon.
I'm making a mod like yours called Time Machine.

Last edited by childishbeat (Sept. 2, 2014 09:21:54)


EX867
Scratcher
13 posts

How to make a 1.4 mod

How to make a t block…?ㅠㅠ how does the glide block works??ㅠ pleaseㅠ
powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

EX867 wrote:

How to make a t block…?ㅠㅠ how does the glide block works??ㅠ pleaseㅠ
What's a t block? You mean a loop?

Yeah, I've never understood the glide blocks or the wait blocks. They're a little confusing, especially since not all of their parameters are called from the actual blocks…


Explore, my Scratch mod | Car Crash | My projects | (image by @MicroMacro)
Rutie
Scratcher
13 posts

How to make a 1.4 mod

LOLlol
dude341
Scratcher
1000+ posts

How to make a 1.4 mod

Help! I done EXACTLY what to do for New Categories, but it it's not there! HELP

Placeholder
dude341
Scratcher
1000+ posts

How to make a 1.4 mod

Now only pen and operators open! D:

Placeholder
powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

dude341 wrote:

Help! I done EXACTLY what to do for New Categories, but it it's not there! HELP
I can't help unless I see the code you use and the exact changes you made.


Explore, my Scratch mod | Car Crash | My projects | (image by @MicroMacro)
dhdguysg
Scratcher
100+ posts

How to make a 1.4 mod

The mod im making, im back to work on it now, so lets see, brief recap on my code before i start coding again
dhdguysg
Scratcher
100+ posts

How to make a 1.4 mod

dude341 wrote:

Help! I done EXACTLY what to do for New Categories, but it it's not there! HELP
Did you add any blocks to the category? When i didnt add blocks my category wouldnt appear either, Might want to go over stuff, powerpoint has a 2nd post at the 1st page saying how to do categories and stuff, maybe you forgot something.

Powered by DjangoBB

Standard | Mobile