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

#2876 2012-05-24 15:43:35

elfin8er
Scratcher
Registered: 2012-01-15
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Block Request: I want a panther block, where I can do ([slider] sensor value), and make slider be able to be changed to a word that isn't a variable (yet). This would allow me to do things like

(join (Hello) (World)) sensor value.

So pretty much, I want to be able to use the join block, with sensor value blocks. Is this possible to make?

Last edited by elfin8er (2012-05-24 15:45:03)


http://i1340.photobucket.com/albums/o723/stevetheipad/goldlittlesig.png

Offline

 

#2877 2012-05-24 16:00:47

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

Re: ITopic: Welcome to your local block library!

elfin8er wrote:

Block Request: I want a panther block, where I can do ([slider] sensor value), and make slider be able to be changed to a word that isn't a variable (yet). This would allow me to do things like

(join (Hello) (World)) sensor value.

So pretty much, I want to be able to use the join block, with sensor value blocks. Is this possible to make?

You dont need  block for that.

Go to Scratch-Blocks/CommandBlockMorph/uncoloredArgMorphFor:
scroll down till you see the line:
$H = code ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupSensorNames].
    $h = code ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupBooleanSensorNames].


change it to:
$H = code ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #hookupSensorNames].
    $h = code ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #hookupBooleanSensorNames].


Why? Because the only thing changed is ChoiceMorph is changed to ChoiceOrExpressionArgMorph

ChoiceArgMorph is a droppdown, whereas ChoiceOrExpressionArgMorph is a droppdown which can also have an expression. (aka a reporter)


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

 

#2878 2012-05-24 16:22:09

elfin8er
Scratcher
Registered: 2012-01-15
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Pecola1 wrote:

elfin8er wrote:

Block Request: I want a panther block, where I can do ([slider] sensor value), and make slider be able to be changed to a word that isn't a variable (yet). This would allow me to do things like

(join (Hello) (World)) sensor value.

So pretty much, I want to be able to use the join block, with sensor value blocks. Is this possible to make?

You dont need  block for that.

Go to Scratch-Blocks/CommandBlockMorph/uncoloredArgMorphFor:
scroll down till you see the line:
$H = code ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupSensorNames].
    $h = code ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #hookupBooleanSensorNames].


change it to:
$H = code ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #hookupSensorNames].
    $h = code ifTrue: [^ ChoiceOrExpressionArgMorph new getOptionsSelector: #hookupBooleanSensorNames].


Why? Because the only thing changed is ChoiceMorph is changed to ChoiceOrExpressionArgMorph

ChoiceArgMorph is a droppdown, whereas ChoiceOrExpressionArgMorph is a droppdown which can also have an expression. (aka a reporter)

But I'm making a project in Panther, that others will be able to download. Will it change the block for them?


http://i1340.photobucket.com/albums/o723/stevetheipad/goldlittlesig.png

Offline

 

#2879 2012-05-24 16:32:54

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

Re: ITopic: Welcome to your local block library!

elfin8er wrote:

Pecola1 wrote:

elfin8er wrote:

Block Request: I want a panther block, where I can do ([slider] sensor value), and make slider be able to be changed to a word that isn't a variable (yet). This would allow me to do things like

(join (Hello) (World)) sensor value.

So pretty much, I want to be able to use the join block, with sensor value blocks. Is this possible to make?

...

But I'm making a project in Panther, that others will be able to download. Will it change the block for them?

No, but it would allow you to put a reporter into the insert, and I believe it will stay in there if opened on a different image.  smile

Last edited by Pecola1 (2012-05-24 16:33: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

 

#2880 2012-05-24 16:57:29

elfin8er
Scratcher
Registered: 2012-01-15
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Pecola1 wrote:

elfin8er wrote:

Pecola1 wrote:


...

But I'm making a project in Panther, that others will be able to download. Will it change the block for them?

No, but it would allow you to put a reporter into the insert, and I believe it will stay in there if opened on a different image.  smile

Is there a way I could add this as a custom  block? Like by going to the variables tab, and clicking "add block", and doing it from there?


http://i1340.photobucket.com/albums/o723/stevetheipad/goldlittlesig.png

Offline

 

#2881 2012-05-25 10:36:29

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

Re: ITopic: Welcome to your local block library!

elfin8er wrote:

Pecola1 wrote:

elfin8er wrote:


But I'm making a project in Panther, that others will be able to download. Will it change the block for them?

No, but it would allow you to put a reporter into the insert, and I believe it will stay in there if opened on a different image.  smile

Is there a way I could add this as a custom  block? Like by going to the variables tab, and clicking "add block", and doing it from there?

OMG your right! You can, just make a block with the code
self sensorButtonPressed: t1

then make the blockspec:
sensor button $String$ pressed


I'm on a comp which doesn't have scratch or panther on it, so I don't know if that will work, try 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

 

#2882 2012-05-25 10:51:21

elfin8er
Scratcher
Registered: 2012-01-15
Posts: 1000+

Re: ITopic: Welcome to your local block library!

Pecola1 wrote:

elfin8er wrote:

Pecola1 wrote:


No, but it would allow you to put a reporter into the insert, and I believe it will stay in there if opened on a different image.  smile

Is there a way I could add this as a custom  block? Like by going to the variables tab, and clicking "add block", and doing it from there?

OMG your right! You can, just make a block with the code
self sensorButtonPressed: t1

then make the blockspec:
sensor button $String$ pressed


I'm on a comp which doesn't have scratch or panther on it, so I don't know if that will work, try it.

Awesome! I can't try it now either, but I will ASAP and let you know. THANKS!


http://i1340.photobucket.com/albums/o723/stevetheipad/goldlittlesig.png

Offline

 

#2883 2012-05-25 17:08:30

P110
Scratcher
Registered: 2011-04-12
Posts: 500+

Re: ITopic: Welcome to your local block library!

How do you change these blocks to work in 1.4?


Me live on 2.0 now  sad

Offline

 

#2884 2012-05-25 17:09:57

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: ITopic: Welcome to your local block library!

I have a suggestion. How about having a featured block.

Offline

 

#2885 2012-05-25 18:05:05

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: ITopic: Welcome to your local block library!

Code:

Blockspec:
('direction from x: %n y: %n to x: %n y %n' #r #dirFromX:y:toX:y:)

Code:
dirFromX: t1 y: t2 toX: t3 y: t4
    | t5 t6 t7 t8 |
    t5 _ t3 - t1.
    t6 _ t4 - t2.
    t7 _ t5 / t6.
    t7 arcTan radiansToDegrees isNan ifTrue: [t8 _ 0].
    t8 _ t7 arcTan radiansToDegrees.
    ^ t8

This block should give you the direction from the original point to the new point, but it doesn't work. Does anyone know how to make it work?

Last edited by HD123 (2012-05-27 08:17:48)


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&online=http://lemonfanatic.webs.com/ONLINE.png&offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#2886 2012-05-25 19:20:46

P110
Scratcher
Registered: 2011-04-12
Posts: 500+

Re: ITopic: Welcome to your local block library!

P110 wrote:

How do you change these blocks to work in 1.4?

the blockspec doesn't work and where do i put the code, yes when it comes to this i am a bit dumb :3


Me live on 2.0 now  sad

Offline

 

#2887 2012-05-26 08:06:09

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: ITopic: Welcome to your local block library!

P110 wrote:

P110 wrote:

How do you change these blocks to work in 1.4?

the blockspec doesn't work and where do i put the code, yes when it comes to this i am a bit dumb :3

1. Open Scratch
2. Press Shift while clicking the R in the Scratch logo.
3. Select turn fill screen off
4. In the white space at the bottom, click open, then click browser.
5. Click Scratch-Objects in the window that pops up.
6. In the second box from the top left, click ScriptableScratchMorph.
7. In the box below that, click the big button that says class.
8. Click block specs in the box 2nd from the top right.
9. Click blockSpecs.
10. Find which category you want to put the block in, if you don't know, just use control.
11. There should be text at the beginning of the third line that says 'control'. Right after that, put a space and copy in the blockspec. (Don't use the keyboard shortcut for copy paste, it won't work.)
12. Right click anywhere in the text and select "accept (s)".
13. Type your initials if necessary.
14. Remember when you clicked the big "class" button a while ago? Well right next to that big button it says instance in another big button. Click the instance button.
15. In the third box from the top left, click "other ops".
16. In the text area it will say this:

Code:

message selector and argument names
    "comment stating purpose of message"
    
    | temporary variable names |
    statements

Type in the block code. (not the block spec)

17. Right click anywhere in the text and select "accept (s)"
18. Click the small "X" to close the small green window.
19. Shift and click the R in the Scratch logo again.
20. Go to the control palette and you should see your block!!!


Note: If you are using a block in a group like motion or sensing (these categories are different for sprite and stage), then you have to follow a slightly different procedure. Instead of clicking ScriptableScratchMorph (step 6), you will click ScratchSpriteMorph or ScratchStageMorph.

I hope this helps!

Last edited by HD123 (2012-05-26 09:09:30)


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&online=http://lemonfanatic.webs.com/ONLINE.png&offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#2888 2012-05-26 10:03:14

P110
Scratcher
Registered: 2011-04-12
Posts: 500+

Re: ITopic: Welcome to your local block library!

HD123 wrote:

P110 wrote:

P110 wrote:

How do you change these blocks to work in 1.4?

the blockspec doesn't work and where do i put the code, yes when it comes to this i am a bit dumb :3

1. Open Scratch
2. Press Shift while clicking the R in the Scratch logo.
3. Select turn fill screen off
4. In the white space at the bottom, click open, then click browser.
5. Click Scratch-Objects in the window that pops up.
6. In the second box from the top left, click ScriptableScratchMorph.
7. In the box below that, click the big button that says class.
8. Click block specs in the box 2nd from the top right.
9. Click blockSpecs.
10. Find which category you want to put the block in, if you don't know, just use control.
11. There should be text at the beginning of the third line that says 'control'. Right after that, put a space and copy in the blockspec. (Don't use the keyboard shortcut for copy paste, it won't work.)
12. Right click anywhere in the text and select "accept (s)".
13. Type your initials if necessary.
14. Remember when you clicked the big "class" button a while ago? Well right next to that big button it says instance in another big button. Click the instance button.
15. In the third box from the top left, click "other ops".
16. In the text area it will say this:

Code:

message selector and argument names
    "comment stating purpose of message"
    
    | temporary variable names |
    statements

Type in the block code. (not the block spec)

17. Right click anywhere in the text and select "accept (s)"
18. Click the small "X" to close the small green window.
19. Shift and click the R in the Scratch logo again.
20. Go to the control palette and you should see your block!!!


Note: If you are using a block in a group like motion or sensing (these categories are different for sprite and stage), then you have to follow a slightly different procedure. Instead of clicking ScriptableScratchMorph (step 6), you will click ScratchSpriteMorph or ScratchStageMorph.

I hope this helps!

WOW! Thanks, I do know how to use smalltalk/squeak and instance and class but I didn't know that, thanks very much!

(I'm making a mad, as well as crediting the block library, would you like a personal credit?)

Thanks again!

Last edited by P110 (2012-05-26 10:31:27)


Me live on 2.0 now  sad

Offline

 

#2889 2012-05-26 10:07:59

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: ITopic: Welcome to your local block library!

joletole wrote:

I have a suggestion. How about having a featured block.

Offline

 

#2890 2012-05-27 08:09:24

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: ITopic: Welcome to your local block library!

P110 wrote:

HD123 wrote:

P110 wrote:


the blockspec doesn't work and where do i put the code, yes when it comes to this i am a bit dumb :3

1. Open Scratch
2. Press Shift while clicking the R in the Scratch logo.
3. Select turn fill screen off
4. In the white space at the bottom, click open, then click browser.
5. Click Scratch-Objects in the window that pops up.
6. In the second box from the top left, click ScriptableScratchMorph.
7. In the box below that, click the big button that says class.
8. Click block specs in the box 2nd from the top right.
9. Click blockSpecs.
10. Find which category you want to put the block in, if you don't know, just use control.
11. There should be text at the beginning of the third line that says 'control'. Right after that, put a space and copy in the blockspec. (Don't use the keyboard shortcut for copy paste, it won't work.)
12. Right click anywhere in the text and select "accept (s)".
13. Type your initials if necessary.
14. Remember when you clicked the big "class" button a while ago? Well right next to that big button it says instance in another big button. Click the instance button.
15. In the third box from the top left, click "other ops".
16. In the text area it will say this:

Code:

message selector and argument names
    "comment stating purpose of message"
    
    | temporary variable names |
    statements

Type in the block code. (not the block spec)

17. Right click anywhere in the text and select "accept (s)"
18. Click the small "X" to close the small green window.
19. Shift and click the R in the Scratch logo again.
20. Go to the control palette and you should see your block!!!


Note: If you are using a block in a group like motion or sensing (these categories are different for sprite and stage), then you have to follow a slightly different procedure. Instead of clicking ScriptableScratchMorph (step 6), you will click ScratchSpriteMorph or ScratchStageMorph.

I hope this helps!

WOW! Thanks, I do know how to use smalltalk/squeak and instance and class but I didn't know that, thanks very much!

(I'm making a mad, as well as crediting the block library, would you like a personal credit?)

Thanks again!

You can credit me if you want, but it's not necessary. What is your mod going to be called?


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&online=http://lemonfanatic.webs.com/ONLINE.png&offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#2891 2012-05-27 08:30:35

HD123
Scratcher
Registered: 2009-12-05
Posts: 500+

Re: ITopic: Welcome to your local block library!

HD123 wrote:

Code:

Blockspec:
('direction from x: %n y: %n to x: %n y %n' #r #dirFromX:y:toX:y:)

Code:
dirFromX: t1 y: t2 toX: t3 y: t4
    | t5 t6 t7 t8 |
    t5 _ t3 - t1.
    t6 _ t4 - t2.
    t7 _ t5 / t6.
    t7 arcTan radiansToDegrees isNan ifTrue: [t8 _ 0].
    t8 _ t7 arcTan radiansToDegrees.
    ^ t8

This block should give you the direction from the original point to the new point, but it doesn't work. Does anyone know how to make it work?


~~HD123~~
Treat others as you want to be treated. |  big_smile  | http://i.imgur.com/OaNrY.gif | http://blocks.scratchr.org/libstatus.php?user=HD123&online=http://lemonfanatic.webs.com/ONLINE.png&offline=http://lemonfanatic.webs.com/OFFLINE.png

Offline

 

#2892 2012-05-27 08:41:20

moretzprogramming
Scratcher
Registered: 2012-04-25
Posts: 61

Re: ITopic: Welcome to your local block library!

Is it possible to make a block like this?

<scratchblocks>
create a variable named ( )
</scratchblocks>

I would like to have a block like that so you can make variables in a project when you need them and the user won't have to name them.


Check out my music, Noise Dots (in flash), and my Upside-Down Cat!

Offline

 

#2893 2012-05-27 08:44:30

moretzprogramming
Scratcher
Registered: 2012-04-25
Posts: 61

Re: ITopic: Welcome to your local block library!

I mean this:

create a variable named ( )
I needed to do
, not <scratchblocks>. I always forget that and it messes everything up!


Check out my music, Noise Dots (in flash), and my Upside-Down Cat!

Offline

 

#2894 2012-05-27 08:47:38

moretzprogramming
Scratcher
Registered: 2012-04-25
Posts: 61

Re: ITopic: Welcome to your local block library!

Oops! That is funny. I meant I needed to do [] with scratchblocks in between, not <scratchblocks>. That's better. I always have problems!


Check out my music, Noise Dots (in flash), and my Upside-Down Cat!

Offline

 

#2895 2012-05-27 09:16:25

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: ITopic: Welcome to your local block library!

joletole wrote:

joletole wrote:

I have a suggestion. How about having a featured block.

Offline

 

#2896 2012-05-27 09:34:07

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: ITopic: Welcome to your local block library!

moretzprogramming wrote:

Oops! That is funny. I meant I needed to do [] with scratchblocks in between, not <scratchblocks>. That's better. I always have problems!

I recommend you click 'post reply' and before clicking 'submit' click 'preview'. That way you can see how your message would look.

Offline

 

#2897 2012-05-27 15:07:52

lpatefield
Scratcher
Registered: 2011-12-15
Posts: 3

Re: ITopic: Welcome to your local block library!

when gf clicked
forever
say [Wow! This is cool!]
end

Offline

 

#2898 2012-05-27 16:05:22

P110
Scratcher
Registered: 2011-04-12
Posts: 500+

Re: ITopic: Welcome to your local block library!

joletole wrote:

joletole wrote:

joletole wrote:

I have a suggestion. How about having a featured block.

That is a good idea, and I'm annoyed they're ignoring you but I can't do anything  hmm


Me live on 2.0 now  sad

Offline

 

#2899 2012-05-27 16:07:30

P110
Scratcher
Registered: 2011-04-12
Posts: 500+

Re: ITopic: Welcome to your local block library!

HD123 wrote:

P110 wrote:

HD123 wrote:


1. Open Scratch
2. Press Shift while clicking the R in the Scratch logo.
3. Select turn fill screen off
4. In the white space at the bottom, click open, then click browser.
5. Click Scratch-Objects in the window that pops up.
6. In the second box from the top left, click ScriptableScratchMorph.
7. In the box below that, click the big button that says class.
8. Click block specs in the box 2nd from the top right.
9. Click blockSpecs.
10. Find which category you want to put the block in, if you don't know, just use control.
11. There should be text at the beginning of the third line that says 'control'. Right after that, put a space and copy in the blockspec. (Don't use the keyboard shortcut for copy paste, it won't work.)
12. Right click anywhere in the text and select "accept (s)".
13. Type your initials if necessary.
14. Remember when you clicked the big "class" button a while ago? Well right next to that big button it says instance in another big button. Click the instance button.
15. In the third box from the top left, click "other ops".
16. In the text area it will say this:

Code:

message selector and argument names
    "comment stating purpose of message"
    
    | temporary variable names |
    statements

Type in the block code. (not the block spec)

17. Right click anywhere in the text and select "accept (s)"
18. Click the small "X" to close the small green window.
19. Shift and click the R in the Scratch logo again.
20. Go to the control palette and you should see your block!!!


Note: If you are using a block in a group like motion or sensing (these categories are different for sprite and stage), then you have to follow a slightly different procedure. Instead of clicking ScriptableScratchMorph (step 6), you will click ScratchSpriteMorph or ScratchStageMorph.

I hope this helps!

WOW! Thanks, I do know how to use smalltalk/squeak and instance and class but I didn't know that, thanks very much!

(I'm making a mad, as well as crediting the block library, would you like a personal credit?)

Thanks again!

You can credit me if you want, but it's not necessary. What is your mod going to be called?

It's called Monkey Swing, it's still a work in progress and a while off yet, but it's taking shape, I'm taking a few things from other mods and adding new things while I'm at it.


Me live on 2.0 now  sad

Offline

 

#2900 2012-05-28 13:37:53

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

Re: ITopic: Welcome to your local block library!

joletole wrote:

I have a suggestion. How about having a featured block.

Sounds like a nice idea. When the website is finally complete, we might be able to do that.
I think Sparks will be working on it over the summer. (Right?)

Offline

 

Board footer