This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-04-19 16:10:57

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

I need help with my MOD!

Can someone help me with the codes and chains in my MOD? This is what I need help with right now:

1. Block building!
CLOSED CURRENTLY
I want a block builder for my MOD. Here is some stuff I got so far: Go to Scratch-UI-Panes, ScratchScriptEditorMorph, menu/button ops, and scriptsMenu. Replace the full code with:

Code:

scriptsMenu: aPosition
    "Present a menu of Scratch script operations."

    | menu choice |
    self target ifNil: [^ self].
    menu _ CustomMenu new.
    menu add: 'clean up' action: #cleanUp.
    menu add: 'save picture of scripts' action: #saveScriptsToImage.
    menu add: 'add comment' action: #addComment:.
     menu addLine.
     menu add: 'Create a new block' action: #buildABlock.

    choice _ menu localize startUp.
    choice ifNil: [^ self].
    choice = #addComment:
        ifTrue: [self perform: choice with: aPosition]
        ifFalse: [self perform: choice].

Right - click the scripts menu, and you get 'Create a new block' in the menu. DON'T CLICK IT! It causes an error! I want a code, so it comes up with a dialog, and you type in the blockspec, block category and block code. When you press OK, the block will appear in that category. It may be sort of like panther, though. Please post!

2. Feedback mailer! I need a dialog where you can rate the program, and add other comments, then upload it to my private site.

Last edited by zorket (2011-05-02 20:25:55)


Marzipan11 must learn to not spoil

Offline

 

#2 2011-04-19 17:46:44

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: I need help with my MOD!

b u m b


Marzipan11 must learn to not spoil

Offline

 

#3 2011-04-20 06:22:56

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: I need help with my MOD!

You're the lucky exception to my 'no internet on holidays' rule...

I'll help best I can, but keep in mind that it's not easy to understand the mechanics of Squeak code, really. Try to understand the concept of my code examples instead of just copying them out, and I'll do my best to explain it fully too.

See how the last bit uses the choice variable to determine what to actually do? Choice is the result of the menu we showed using the line choice _ menu startUp. It's obviously going to be one of the menu options, or nil if the menu was dismissed.

The last line tells Squeak to perform an action present in the editor's methods with the name of the menu option (if the option was not 'handled' -- taken care of -- before). This means...

We have to create a method in the editor's class with the name of the action you chose. In other words, 'buildABlock'.

In this method, we have to define a dialog. Do this by assigning a temporary variable with the value DialogBoxMorph new.

To add stuff to this dialog, browse the DialogBoxMorph class in Scratch-UI-Dialogs for methods and categories to add textboxes, labels, etc.

Good luck!

(PS. Sorry that last bit was so short, but I have to go and I admittedly spent too much on the first bit  tongue  )

Offline

 

#4 2011-04-20 08:10:40

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: I need help with my MOD!

LS97 wrote:

You're the lucky exception to my 'no internet on holidays' rule...

I'll help best I can, but keep in mind that it's not easy to understand the mechanics of Squeak code, really. Try to understand the concept of my code examples instead of just copying them out, and I'll do my best to explain it fully too.

(I've cut off a bit because it is big)

Thanks! That post was really helpful. Now, I'm gonna try it.


Marzipan11 must learn to not spoil

Offline

 

#5 2011-04-20 17:47:36

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: I need help with my MOD!

Right, I spared a second to come back to this.

Another thing you'll need is a way to save the custom code to the project, and I suggest you do that using a global variable. I can't help much with that though because I never experimented it myself.

Offline

 

#6 2011-04-22 10:09:36

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: I need help with my MOD!

What's it called?

Offline

 

#7 2011-04-22 14:53:31

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: I need help with my MOD!

scimonster wrote:

What's it called?

My MOD? I have it's name in, and it's called:

X-Ray Eyes


Marzipan11 must learn to not spoil

Offline

 

#8 2011-04-30 19:45:07

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: I need help with my MOD!

bump, and I still couldn't find out. Credit to panther, could someone find out what the codes in panther look like? That may help with block building.


Marzipan11 must learn to not spoil

Offline

 

#9 2011-04-30 20:09:05

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: I need help with my MOD!

zorket wrote:

Can someone help me with the codes and chains in my MOD? This is what I need help with right now:

1. Block building! I want a block builder for my MOD. Here is some stuff I got so far: Go to Scratch-UI-Panes, ScratchScriptEditorMorph, menu/button ops, and scriptsMenu. Replace the full code with:

Code:

scriptsMenu: aPosition
    "Present a menu of Scratch script operations."

    | menu choice |
    self target ifNil: [^ self].
    menu _ CustomMenu new.
    menu add: 'clean up' action: #cleanUp.
    menu add: 'save picture of scripts' action: #saveScriptsToImage.
    menu add: 'add comment' action: #addComment:.
     menu addLine.
     menu add: 'Create a new block' action: #buildABlock.

    choice _ menu localize startUp.
    choice ifNil: [^ self].
    choice = #addComment:
        ifTrue: [self perform: choice with: aPosition]
        ifFalse: [self perform: choice].

Right - click the scripts menu, and you get 'Create a new block' in the menu. DON'T CLICK IT! It causes an error! I want a code, so it comes up with a dialog, and you type in the blockspec, block category and block code. When you press OK, the block will appear in that category. It may be sort of like panther, though. Please post!

save the code to a file, then make it so at the end of blockspecs, it will have:
^t1, self obsoleteBlockSpecs, customBlockSpecs
For the code of the thing it would make a file wich would have the code in it, and add to the blockSpec file '(''' , textinsertforfrontcover, ''' #', (blocktype), '#', methodname, ')'
Make the file block method.
Then the customBlockSpecs could be something like:
^readFromFile: 'blockspecs file', ')'
Okay, i lost myself there, it would be easier to make a block which you would type the name of to block, I cant realy help i don't have time, sorry.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#10 2011-05-03 15:46:38

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: I need help with my MOD!

Pecola1 wrote:

save the code to a file, then make it so at the end of blockspecs, it will have:
^t1, self obsoleteBlockSpecs, customBlockSpecs
For the code of the thing it would make a file wich would have the code in it, and add to the blockSpec file '(''' , textinsertforfrontcover, ''' #', (blocktype), '#', methodname, ')'
Make the file block method.
Then the customBlockSpecs could be something like:
^readFromFile: 'blockspecs file', ')'
Okay, i lost myself there, it would be easier to make a block which you would type the name of to block, I cant realy help i don't have time, sorry.

Can you explain a little easier?


Marzipan11 must learn to not spoil

Offline

 

#11 2011-05-03 20:16:34

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: I need help with my MOD!

zorket wrote:

Pecola1 wrote:

save the code to a file, then make it so at the end of blockspecs, it will have:
^t1, self obsoleteBlockSpecs, customBlockSpecs
For the code of the thing it would make a file wich would have the code in it, and add to the blockSpec file '(''' , textinsertforfrontcover, ''' #', (blocktype), '#', methodname, ')'
Make the file block method.
Then the customBlockSpecs could be something like:
^readFromFile: 'blockspecs file', ')'
Okay, i lost myself there, it would be easier to make a block which you would type the name of to block, I cant realy help i don't have time, sorry.

Can you explain a little easier?

Basically, save the code for a block, then when that block is inserted in the custom block block, it will run the txt file simply by having it read the file and run the file, that is the quick and easy way. It is harder to make the block show up in blockspecs.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#12 2011-05-04 00:18:26

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: I need help with my MOD!

Pecola1 wrote:

zorket wrote:

Pecola1 wrote:

save the code to a file, then make it so at the end of blockspecs, it will have:
^t1, self obsoleteBlockSpecs, customBlockSpecs
For the code of the thing it would make a file wich would have the code in it, and add to the blockSpec file '(''' , textinsertforfrontcover, ''' #', (blocktype), '#', methodname, ')'
Make the file block method.
Then the customBlockSpecs could be something like:
^readFromFile: 'blockspecs file', ')'
Okay, i lost myself there, it would be easier to make a block which you would type the name of to block, I cant realy help i don't have time, sorry.

Can you explain a little easier?

Basically, save the code for a block, then when that block is inserted in the custom block block, it will run the txt file simply by having it read the file and run the file, that is the quick and easy way. It is harder to make the block show up in blockspecs.

Do you think we could do this for the Library?

Offline

 

#13 2011-05-04 12:10:12

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: I need help with my MOD!

scimonster wrote:

Pecola1 wrote:

zorket wrote:

Can you explain a little easier?

Basically, save the code for a block, then when that block is inserted in the custom block block, it will run the txt file simply by having it read the file and run the file, that is the quick and easy way. It is harder to make the block show up in blockspecs.

Do you think we could do this for the Library?

We could, the only problem with this method is it would only work for blocks without any inserts like the pi block or infinity. So you cant make a block like, ( ( ) ^ ( ) ).

Last edited by Pecola1 (2011-05-04 12:10:22)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#14 2011-05-04 12:25:18

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: I need help with my MOD!

Pecola1 wrote:

scimonster wrote:

Pecola1 wrote:


Basically, save the code for a block, then when that block is inserted in the custom block block, it will run the txt file simply by having it read the file and run the file, that is the quick and easy way. It is harder to make the block show up in blockspecs.

Do you think we could do this for the Library?

We could, the only problem with this method is it would only work for blocks without any inserts like the pi block or infinity. So you cant make a block like, ( ( ) ^ ( ) ).

Why not?

Offline

 

#15 2011-05-04 12:57:26

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: I need help with my MOD!

scimonster wrote:

Pecola1 wrote:

scimonster wrote:

Do you think we could do this for the Library?

We could, the only problem with this method is it would only work for blocks without any inserts like the pi block or infinity. So you cant make a block like, ( ( ) ^ ( ) ).

Why not?

Because there isn't a separate insert for it.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#16 2011-05-04 16:23:19

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Offline

 

#17 2011-05-05 14:33:08

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: I need help with my MOD!

rdococ wrote:

Try basing your mod on BYOB instead of Scratch. To learn how to hack BYOB 3.0+, go to here.

I've already started my MOD and added about 1,000,000,000,000,000,000,000,000,000 features. Basing it on BYOB will remove alot of features.


Marzipan11 must learn to not spoil

Offline

 

#18 2011-05-06 12:25:17

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: I need help with my MOD!

zorket wrote:

rdococ wrote:

Try basing your mod on BYOB instead of Scratch. To learn how to hack BYOB 3.0+, go to here.

I've already started my MOD and added about 1,000,000,000,000,000,000,000,000,000 features. Basing it on BYOB will remove alot of features.

LOL! That is a lot of features. XD


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#19 2011-05-15 10:06:27

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: I need help with my MOD!

Bump! (I had to restart my mod, sadly. My original was on the E drive, which crashed.)


Marzipan11 must learn to not spoil

Offline

 

#20 2011-05-16 16:24:08

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: I need help with my MOD!

Is E drive a memory stick or a partition which hosts an OS?

Offline

 

#21 2011-05-17 14:54:17

williambl
Scratcher
Registered: 2011-04-08
Posts: 100+

Re: I need help with my MOD!

LS97 wrote:

Is E drive a memory stick or a partition which hosts an OS?

I have a Mac, but I'm guessing on a Windows and Ubuntu computers it is a secondry C: / drive.

Last edited by williambl (2011-05-17 14:54:37)


http://internetometer.com/imagesmall/34650.png
http://www.danasoft.com/sig/Epicnesssign.jpg

Offline

 

#22 2011-05-17 17:43:47

zorket
Scratcher
Registered: 2010-05-25
Posts: 500+

Re: I need help with my MOD!

LS97 wrote:

Is E drive a memory stick or a partition which hosts an OS?

Its a HARD DRIVE, not a stick!


Marzipan11 must learn to not spoil

Offline

 

#23 2011-05-17 18:08:38

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: I need help with my MOD!

LS97 wrote:

Is E drive a memory stick or a partition which hosts an OS?

Yes, though mine is (I:)

Last edited by Pecola1 (2011-05-17 18:08:49)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#24 2011-05-19 12:22:32

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: I need help with my MOD!

zorket wrote:

LS97 wrote:

Is E drive a memory stick or a partition which hosts an OS?

Its a HARD DRIVE, not a stick!

Normally C: is the main drive... Do you really have 3 HDDs?

Offline

 

#25 2011-05-19 15:02:17

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: I need help with my MOD!

LS97 wrote:

zorket wrote:

LS97 wrote:

Is E drive a memory stick or a partition which hosts an OS?

Its a HARD DRIVE, not a stick!

Normally C: is the main drive... Do you really have 3 HDDs?

Yes, but sometimes it could be A: as the main drive, as it was in old versions of DOS and Windows.

Offline

 

Board footer