Discuss Scratch

powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

liam48D wrote:

Wow, these tutorials are the best. They've been super handy! Are you going to make more?
Thanks! I don't think I'll make more, unless anyone has any requests.
jandrewg
Scratcher
100+ posts

How to make a 1.4 mod

How do you make a menu in a scratch 1.4 mod? (An example is here)?
powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

jandrewg wrote:

How do you make a menu in a scratch 1.4 mod? (An example is here)?
I forget, now. There must be some tutorial somewhere, but those 1.4 forum archives are still acting funny.
DigiTechs
Scratcher
500+ posts

How to make a 1.4 mod

powerpoint56 wrote:

jandrewg wrote:

How do you make a menu in a scratch 1.4 mod? (An example is here)?
I forget, now. There must be some tutorial somewhere, but those 1.4 forum archives are still acting funny.
I remember there was something in scratch-scriptable-morph (something like that, I forgot it's name) which lets you add windows, you just have to use the console a little.
powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

DigiTechs wrote:

powerpoint56 wrote:

jandrewg wrote:

How do you make a menu in a scratch 1.4 mod? (An example is here)?
I forget, now. There must be some tutorial somewhere, but those 1.4 forum archives are still acting funny.
I remember there was something in scratch-scriptable-morph (something like that, I forgot it's name) which lets you add windows, you just have to use the console a little.
Actually, I think you have to look around ScratchFrameMorph.
Add the name of your menu item to the end of the list in ScratchFrameMorph createMenuPanel
t1 _ #((#File #fileMenu:) (#Edit #editMenu:) (#Help #helpMenu:) (#NewMenu #newMenu:) ).
Then make a new method in ScratchFrameMorph called newMenu: (or whatever you call your button above). Then just paste in this code:
exploreMenu: t1 
| t2 |
t2 addLine.
t2 add: 'Go to Explore website' action: #openExploreWebsite.
t2 invokeOn: self at: t1 bottomLeft + (0 @ 10)
t2 addLine adds a line in the menu. For each option you add to the menu, like the Explore website example, the #method has to be an existing method.

Last edited by powerpoint56 (June 4, 2014 21:53:15)

powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

nevermind

Last edited by powerpoint56 (June 16, 2014 20:30:57)

dhdguysg
Scratcher
100+ posts

How to make a 1.4 mod

bump
childishbeat
Scratcher
56 posts

How to make a 1.4 mod

My current time block worked! I also added a day function. It reports the day of the year. For example, if it was the 20th June, it would say 171. I'll try to add day of month, which will report what the day of the current month is.

Last edited by childishbeat (June 20, 2014 20:10:40)

childishbeat
Scratcher
56 posts

How to make a 1.4 mod

DigiTechs wrote:

powerpoint56 wrote:

jandrewg wrote:

How do you make a menu in a scratch 1.4 mod? (An example is here)?
I forget, now. There must be some tutorial somewhere, but those 1.4 forum archives are still acting funny.
I remember there was something in scratch-scriptable-morph (something like that, I forgot it's name) which lets you add windows, you just have to use the console a little.
It's ScriptableScratchMorph.
davidkt
Scratcher
1000+ posts

How to make a 1.4 mod

jandrewg wrote:

How do you make a menu in a scratch 1.4 mod? (An example is here)?
I did that in my 1.4 mod, but I can't remember how.
EMPedemonte20
Scratcher
100+ posts

How to make a 1.4 mod

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.
powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

EMPedemonte20 wrote:

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.
Weird… I've gotten that error a lot with my mod, and eventually fixed it by chance. But I forget how.

From the error, it looks like it's trying to find skin that isn't there.

“common”, in the list of categories, should be lowercase if it isn't already.

Last edited by powerpoint56 (July 12, 2014 23:23:41)

EMPedemonte20
Scratcher
100+ posts

How to make a 1.4 mod

powerpoint56 wrote:

EMPedemonte20 wrote:

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.
Weird… I've gotten that error a lot with my mod, and eventually fixed it by chance. But I forget how.

From the error, it looks like it's trying to find skin that isn't there.

“common”, in the list of categories, should be lowercase if it isn't already.
it's lowercase and I've had this problem before. I reimported the scratchskin many times already and still no fix, yet if I import the common category with another name and change the category name to it, it works. The only way I ever fix this is making a new scratch mod without new features.
powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

EMPedemonte20 wrote:

it's lowercase and I've had this problem before. I reimported the scratchskin many times already and still no fix, yet if I import the common category with another name and change the category name to it, it works. The only way I ever fix this is making a new scratch mod without new features.
Very strange…
al-x
Scratcher
45 posts

How to make a 1.4 mod

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.

Last edited by al-x (July 20, 2014 22:43:16)

jandrewg
Scratcher
100+ posts

How to make a 1.4 mod

powerpoint56 wrote:

DigiTechs wrote:

powerpoint56 wrote:

jandrewg wrote:

How do you make a menu in a scratch 1.4 mod? (An example is here)?
I forget, now. There must be some tutorial somewhere, but those 1.4 forum archives are still acting funny.
I remember there was something in scratch-scriptable-morph (something like that, I forgot it's name) which lets you add windows, you just have to use the console a little.
Actually, I think you have to look around ScratchFrameMorph.
Add the name of your menu item to the end of the list in ScratchFrameMorph createMenuPanel
t1 _ #((#File #fileMenu:) (#Edit #editMenu:) (#Help #helpMenu:) (#NewMenu #newMenu:) ).
Then make a new method in ScratchFrameMorph called newMenu: (or whatever you call your button above). Then just paste in this code:
exploreMenu: t1 
| t2 |
t2 addLine.
t2 add: 'Go to Explore website' action: #openExploreWebsite.
t2 invokeOn: self at: t1 bottomLeft + (0 @ 10)
t2 addLine adds a line in the menu. For each option you add to the menu, like the Explore website example, the #method has to be an existing method.
I have done all the steps (I think), to make a new menu, but it will not accept my changes!!!!!
jandrewg
Scratcher
100+ posts

How to make a 1.4 mod

^ trying to work, still fails

Last edited by jandrewg (Aug. 10, 2014 16:46:50)

powerpoint56
Scratcher
1000+ posts

How to make a 1.4 mod

jandrewg wrote:

^ trying to work, still fails
Can you paste your code from createMenuPanel, and from yourMenu: (whatever the new menu method is)?
jandrewg
Scratcher
100+ posts

How to make a 1.4 mod

powerpoint56 wrote:

jandrewg wrote:

^ trying to work, still fails
Can you paste your code from createMenuPanel, and from yourMenu: (whatever the new menu method is)?
Here it is:





createMenuPanel
“Create and add a panel containing the menus and close button.”

| menuSpecs m |
“create panel”
menuPanel _ AlignmentMorph new
color: Color transparent;
centering: #center;
inset: 0;
height: 0. “will grow as needed”

self addShortcutButtonsTo: menuPanel.

“menuSpecs defines the menus”
menuSpecs _ #(
“name selector”
(File fileMenu
(Edit editMenu
(Help helpMenu
(Jump! jumpMenu
).

menuSpecs do: [:spec |
m _ ScratchMenuTitleMorph new
contents: (spec at: 1) localized;
target: self selector: (spec at: 2).
menuPanel addMorphBack: m.
#helpMenu: = (spec at: 2) ifFalse: [
menuPanel addMorphBack: (Morph new color: Color transparent; extent: 12@5)]].

topPane addMorph: menuPanel.

jumpMenu: t1
| t2 |
t2 addLine.
t2 add: ‘Check for Updates’ action: #checkForUpdates.
t2 invokeOn: self at: t1 bottomLeft + (0 @ 10)



that is everything.

the error is this:



createMenuPanel
“Create and add a panel containing the menus and close button.”

| menuSpecs m |
“create panel”
menuPanel _ AlignmentMorph new
color: Color transparent;
centering: #center;
inset: 0;
height: 0. “will grow as needed”

self addShortcutButtonsTo: menuPanel.

“menuSpecs defines the menus”
menuSpecs _ #(
“name selector”
(File fileMenu
(Edit editMenu
(Help helpMenu
(Jump! jumpMenu
).

menuSpecs do: [:spec |
m _ ScratchMenuTitleMorph new
contents: (spec at: 1) localized;
target: self selector: (spec at: 2).
menuPanel addMorphBack: m.
#helpMenu: = (spec at: 2) ifFalse: [
menuPanel addMorphBack: (Morph new color: Color transparent; extent: 12@5)]].

topPane addMorph: menuPanel.

Nothing more expected ->jumpMenu: t1
| t2 |
t2 addLine.
t2 add: ‘Check for Updates’ action: #checkForUpdates.
t2 invokeOn: self at: t1 bottomLeft + (0 @ 10)
jandrewg
Scratcher
100+ posts

How to make a 1.4 mod

Last edited by jandrewg (Aug. 10, 2014 17:31:36)

Powered by DjangoBB