hpotter134 wrote:
This is a great topic! I have a question though. I want to add motion blocks to the Stage . (mainly, the 'make %m move %n steps), but it always says "Stage selected: No motion blocks". How can I add motion blocks to the Stage?
Go to Scratch blocks ScriptableStageMorph class block specs blockspecs for the block then for the code jump to instance and go to other opp or whatever your block fits into (doesn't effect code but is for organizing use)
For Sprite only blocks go to Scratch blocks ScriptableSpriteMorph class block specs blockspecs for the block then for the code jump to instance
For both go to Scratch blocks ScriptableScratchMorph class block specs blockspecs for the block then for the code jump to instance
If you are talking about BYOB then you cannot make sprite only blocks but you can do for this sprite only.
Last edited by Pecola1 (2011-01-19 19:01:02)
Offline
Pecola1 wrote:
hpotter134 wrote:
This is a great topic! I have a question though. I want to add motion blocks to the Stage . (namely, the 'make %m move %n steps), but it always says "Stage selected: No motion blocks". How can I add motion blocks to the Stage?
Go to Scratch blocks ScriptableStageMorph class block specs blockspecs for the block then for the code jump to instance and go to other opp or whatever your block fits into (doesn't effect code but is for organizing use)
For Sprite only blocks go to Scratch blocks ScriptableSpriteMorph class block specs blockspecs for the block then for the code jump to instance
For both go to Scratch blocks ScriptableScratchMorph class block specs blockspecs for the block then for the code jump to instance
If you are talking about BYOB then you cannot make sprite only blocks but you can do for this sprite only.
i didn't know that about byob
Offline
Sparks, I am working on a code for making you able to not have to make all the blocks and so it would upload all the blocks from the block library! Could you help? We can make a website that will have only text saying ('name of a new block' #type of block #method) so that we can make it upload new blocks by reading the html of the website and putting it into a method something like
uploadingNewBlockSpecs
^ readContentsOfFileAtUrl: libraryscratchblocks.com
It would be a lot more complicated but thats what we can do. I don't know how we would make it read a method though.
Last edited by Pecola1 (2011-01-21 18:04:06)
Offline
sparks wrote:
I'm not quite sure I know what you're trying to say, Pecola
Pecola is working on a way, to import every block in the block library, instead of having to edit the code
Offline
Do you think you could use <sprite %m is %b> to report the action of another sprite?
Offline
sparks wrote:
I'm not quite sure I know what you're trying to say, Pecola1
I cannot figure out how to do it quite yet but by making a website, and making the methods for the read file from url blocks, you could make Scratch read from the webpage (like the panther one) but instead you can make a block specs area like the obsoleteBlockSpecs and under blockSpecs by the self obsoleteBlockSpecs you could put websiteBlockSpecs which would read what is on the website and it would make those blocks go under block specs. The only thing is I cannot figure out how to make something make a method (like when you have the panther blocks make a method for them) If I knew how to do that then i could finish. So far i have for what the website would be like:
'control'
'show mouse cursor'
#-
#showCursor
Then under websiteBlockSpecs
websiteBlockSpecs
^( readLine: 1 fromUrl: whateverIwillNamethewebsite.com ( readLine: 2 fromUrl: whateverIwillNamethewebsite.com readLine: 3 fromUrl: whateverIwillNamethewebsite.com readLine: 3 fromUrl: whateverIwillNamethewebsite.com ) )
Could anyone help me? I am also doing this for RKT me ProgrammingFreak and ESN's mod.
Last edited by Pecola1 (2011-01-21 20:05:29)
Offline
Pecola1 wrote:
New Panther block (the following is not a joke)
Code:
Pecola1 obsolete! - #FF0000 self errorOr
First boxobsolete!
second box
-
third box
self error
and the color is red
Aheeeem, I was not being sarcastic.
Offline
Marioblender wrote:
Do you think you could use <sprite %m is %b> to report the action of another sprite?
possibly, I don't know the code
Offline
Pecola1 wrote:
BLOCK REQUEST
Make a (Instrument) reporter. The problem: There is no way scratch really can tell (correct me if i'm wrong) what instrument to play except for set instrument to otherwise it has when you play a note well... I am not sure how to decode it into human language but it pretty much says: Play instrument
And i cannot see where there is a place where it can tell the instrument!
Offline
I have been working for a long time.
Blockspec:
('%B for %m' #b #getBooleanAttribute:of:)
Go to Scratch-blocks CommandBlockMorph all uncoloredArgMorphFor:
And add the strip:
$B = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #booleanAttributeNames; choice: 'pen down?']
Heres the method:
getBooleanAttribute: t1 of: t2 | t3 | t3 _ self coerceSpriteArg: t2. (t3 isKindOf: ScriptableScratchMorph) ifFalse: [^ false]. 'pen down?' localized = t1 ifTrue: [^ t3 penDown]. 'draggable?' localized = t1 ifTrue: [^ t3 draggable]. 'is a clone?' localized = t1 ifTrue: [^ t3 isClone]. ^ false
Its weird that the simplest thing stopped me! Credit to rubiks_cube_guy238 for showing me I needed the
of: t2
| t3 |
t3 _ self coerceSpriteArg: t2.
(t3 isKindOf: ScriptableScratchMorph)
ifFalse: [^ false].
Last edited by Pecola1 (2011-01-22 14:49:09)
Offline
Found where to make a website! https://dl-web.dropbox.com/get/websiteF … w=dd92f7e3 (i used droppbox and found it from sparks)
Offline
HELP!
I am still just working on the block specs
websiteBlockSpecs
^readFromUrl: https://dl-web.dropbox.com/get/websiteForLibraryUpload/websiteForLibraryUpload.txt?w=dd92f7e3
But it keeps saying
websiteBlockSpecs
^ Expression to return expected ->readFromUrl: https://dl-web.dropbox.com/get/websiteForLibraryUpload/websiteForLibraryUpload.txt?w=dd92f7e3
Offline
ssss wrote:
maybe it needs a ^ at the start??
It does have one
Offline
I have a new code for the <%e recieved?> block:
eventReceivedNamed: t1 | t2 t3 | self isSprite ifTrue: [^ (self ownerThatIsA: ScratchStageMorph) eventReceivedNamed: t1]. t2 _ self scripts select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]]. t2 _ t2 asOrderedCollection. self submorphsDo: [:t5 | (t5 isKindOf: ScriptableScratchMorph) ifTrue: [(t5 scripts select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]]) do: [:t6 | t2 _ t2 copyWith: t6]]]. t3 _ t2 select: [:t4 | t4 scratchProc notNil]. ^ t3 size > 0
This blockspec could replace the old one:
('%e received?' #b #eventReceivedNamed:)
Offline
Marioblender wrote:
I have a new code for the <%e recieved?> block:
Code:
eventReceivedNamed: t1 | t2 t3 | self isSprite ifTrue: [^ (self ownerThatIsA: ScratchStageMorph) eventReceivedNamed: t1]. t2 _ self scripts select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]]. t2 _ t2 asOrderedCollection. self submorphsDo: [:t5 | (t5 isKindOf: ScriptableScratchMorph) ifTrue: [(t5 scripts select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]]) do: [:t6 | t2 _ t2 copyWith: t6]]]. t3 _ t2 select: [:t4 | t4 scratchProc notNil]. ^ t3 size > 0This blockspec could replace the old one:
Code:
('%e received?' #b #eventReceivedNamed:)
this doesn't report error, but it always reports false... Please help
Offline
The block will report true only if a [blocks]<when I receive[ any message]>[/blocks] block is running.
Try assembling this script and then check if true: [blocks]
<when I receive[ any message]>
<forever>
<end>[/blocks]
Offline
Hmm... I think I kinda get what you're saying. Do you mean a block that reads it's blockspec from a website? Cos then an internet connection would always be needed to make them work. Or do you mean a patch that people can add to their copy of Scratch that allows them to add custom blocks to their projects easily?
I don't think something should add ALL the block library blocks at once to a copy of Scratch. What if you don't want some?
Offline
Pecola1 wrote:
Pecola1 wrote:
Can someone help me with this? http://www.weebly.com/uploads/5/4/1/3/5 … 86.gif?366
I have been working for a long time on it but it wont work.
Heres the code:Code:
getBooleanAttribute: t1 | t2 | (vars includesKey: t1) ifTrue: [^ vars at: t1]. t2 _ t1 localized. 'pen down?' localized = t2 ifTrue: [^ self t1 penDown]. 'draggable?' localized = t2 ifTrue: [^ self t1 isDraggable]. 'is a clone?' localized = t2 ifTrue: [^ self t1 isClone]. ^ falseit does not work yet.
Still cannot get this to work. It gets the attribute for a boolean. Like if its a clone pen is down or if its draggable.
This probably isn't what you wanted, but I tried to make something of the sort:
Blockspec:
'%m is pen down?' #b #isPenDown:
isPenDown: sprite ^ sprite penDown
It works for me...is that what you wanted to make, or am I misunderstanding you?
EDIT: I see now. You wanted to have multiple boolean attributes in one block. Sorry
Last edited by hpotter134 (2011-01-22 21:28:59)
Offline
Marioblender wrote:
I have a new code for the <%e recieved?> block:
Code:
eventReceivedNamed: t1 | t2 t3 | self isSprite ifTrue: [^ (self ownerThatIsA: ScratchStageMorph) eventReceivedNamed: t1]. t2 _ self scripts select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]]. t2 _ t2 asOrderedCollection. self submorphsDo: [:t5 | (t5 isKindOf: ScriptableScratchMorph) ifTrue: [(t5 scripts select: [:t4 | t4 class == EventHatMorph and: [t4 eventName caseInsensitiveEqual: t1]]) do: [:t6 | t2 _ t2 copyWith: t6]]]. t3 _ t2 select: [:t4 | t4 scratchProc notNil]. ^ t3 size > 0This blockspec could replace the old one:
Code:
('%e received?' #b #eventReceivedNamed:)
That code isn't new. You just took that right from Panther.
_________________________________________________________________
Pecola1 wrote:
Pecola1 wrote:
Can someone help me with this? http://www.weebly.com/uploads/5/4/1/3/5 … 86.gif?366
I have been working for a long time on it but it wont work.
Heres the code:Code:
getBooleanAttribute: t1 | t2 | (vars includesKey: t1) ifTrue: [^ vars at: t1]. t2 _ t1 localized. 'pen down?' localized = t2 ifTrue: [^ self t1 penDown]. 'draggable?' localized = t2 ifTrue: [^ self t1 isDraggable]. 'is a clone?' localized = t2 ifTrue: [^ self t1 isClone]. ^ falseit does not work yet.
Still cannot get this to work. It gets the attribute for a boolean. Like if its a clone pen is down or if its draggable.
Try this:
getBooleanAttribute: t1 of: t2 | t3 | t3 _ self coerceSpriteArg: t2. (t3 isKindOf: ScriptableScratchMorph) ifFalse: [^ false]. 'pen down?' localized = t1 ifTrue: [^ t3 penDown]. 'draggable?' localized = t1 ifTrue: [^ t3 draggable]. 'is a clone?' localized = t1 ifTrue: [^ t3 isClone]. ^ false
Offline
That's what i was going to suggest. I don't have scratch open right now, so I can't test it.
Offline
sparks wrote:
I don't think something should add ALL the block library blocks at once to a copy of Scratch. What if you don't want some?
I thought about this and decided that I could make it just like panther has, the code could be more like when you click the button show library blocks it would ask you how many you wan't to show, you could say 'all' or the number you want. It would be simpler than I thought it would! I could add a global variable that would be websiteBlocksShowing
and then for the code i would need to make it... NVM this will be a challenge, but i was mainly making it for RKT so people don't have to always get the new version and the new blocks would update.
Offline
I have been working for a long time.
Blockspec:
('%B for %m' #b #getBooleanAttribute:of:)
Go to Scratch-blocks CommandBlockMorph all uncoloredArgMorphFor:
And add the strip:
$B = t2 ifTrue: [^ ChoiceArgMorph new getOptionsSelector: #booleanAttributeNames; choice: 'pen down?']
Heres the method:
getBooleanAttribute: t1 of: t2 | t3 | t3 _ self coerceSpriteArg: t2. (t3 isKindOf: ScriptableScratchMorph) ifFalse: [^ false]. 'pen down?' localized = t1 ifTrue: [^ t3 penDown]. 'draggable?' localized = t1 ifTrue: [^ t3 draggable]. 'is a clone?' localized = t1 ifTrue: [^ t3 isClone]. ^ false
booleanAttributeNames ('pen down' 'draggable' 'is a clone')
Its weird that the simplest thing stopped me! Credit to rubiks_cube_guy238 for showing me I needed the
of: t2
| t3 |
t3 _ self coerceSpriteArg: t2.
(t3 isKindOf: ScriptableScratchMorph)
ifFalse: [^ false].
Last edited by Pecola1 (2011-01-23 17:03:26)
Offline