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)
Offline
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)
Offline
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?
Offline
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.
Last edited by Pecola1 (2012-05-24 16:33:22)
Offline
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.
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?
Offline
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.
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.
Offline
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.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!
Offline
I have a suggestion. How about having a featured block.
Offline
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)
Offline
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:
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)
Offline
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 | statementsType 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)
Offline
joletole wrote:
I have a suggestion. How about having a featured block.
Offline
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 :31. 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 | statementsType 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?
Offline
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. ^ t8This 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?
Offline
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.
Offline
I mean this:
create a variable named ( )I needed to do
, not <scratchblocks>. I always forget that and it messes everything up!
Offline
Oops! That is funny. I meant I needed to do [] with scratchblocks in between, not <scratchblocks>. That's better. I always have problems!
Offline
joletole wrote:
joletole wrote:
I have a suggestion. How about having a featured block.
Offline
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
when gf clicked forever say [Wow! This is cool!] end
Offline
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
Offline
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 | statementsType 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.
Offline
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