How do I turn a block I made in Panther into a normal block in Scratch for a Mod?
No answer
How do you add more tabs like pen and control? Tell us once and for all.
No answer
Climber59 asked:
How does the [replace costume() with []] block work?
No answer
Last edited by johnnydean1 (2010-05-31 12:03:30)
Offline
climber59 wrote:
How does the [replace costume() with []] block work? I only care about the import function, not paint, camera, or stage.
I Can Answer That. It Mainly Works Like The List Block, [replace item (1) of [list] with [thing] ] Except It Uses Costumes, Camera, Import, etc.
Offline
That doesn't help me because I want to make a block that has a space for you to define the filepath to an pic but no matter what I try it doesn't work.
Basically I need to know how the import part works, not the replace.
Offline
1: You shouldn't be stealing from Panther in the first place,
2: He's already told us lots of times, you just aren't looking hard enough,
3: (A) You shouldn't be planning to steal that block either (B) Why should you care? (C) I don't truly know, but I think it works the same way as you dragging them to different places with the actual mouse.
Offline
climber59 wrote:
That doesn't help me because I want to make a block that has a space for you to define the filepath to an pic but no matter what I try it doesn't work.
Basically I need to know how the import part works, not the replace.
Take a look at the source code for panther. That might help.
Offline
1. CYOB? If so, just make a method with the arguments defined, copy your code, and insert the blockSpec in the desired place.
2. henley is right.
3. it takes a symbol and an integer as arguments and replaces the costume at the given index with a form retrieved by comparing the symbol with some constants
Offline
No answers have helped me, I'm trying to make a block that does the same thing except you type in the filepath, so you don't have to use the dialog. Just it doesn't work when I try it because I don't understand most of the code. This is what I want, 
Also I am not stealing anything, it's for my own use and/or a Panther project I may upload.
Last edited by climber59 (2010-05-31 15:10:46)
Offline
nXIII wrote:
1. CYOB? If so, just make a method with the arguments defined, copy your code, and insert the blockSpec in the desired place.
I tried it but its like this
__
NAME $variable$ |__|
|t1 t2 t3 t4|
CODE
So when I put it in a mod it does not work.
Offline
johnnydean1 wrote:
nXIII wrote:
1. CYOB? If so, just make a method with the arguments defined, copy your code, and insert the blockSpec in the desired place.
I tried it but its like this
__
NAME $variable$ |__|
|t1 t2 t3 t4|
CODE
So when I put it in a mod it does not work.
What ARE you talking about...?
Offline
Ok ill post the code:
Name:Get $Variable$ from Mesh
Code:
|t1 t2 t3 t4 |
(t2 _ self ownerThatIsA: ScratchStageMorph) ifNil: [^ 0].
t2 scratchServer
ifNotNil:
[t3 _ t2 scratchServer sensorValueFor: t1.
t3 ifNotNil: [^ t3]].
'tilt' = t1 ifTrue: [^ WeDoPlugin tilt].
'distance' = t1 ifTrue: [^ WeDoPlugin distance].
t4 _ t2 sensorBoard.
t4 tryToOpenPort ifFalse: [^ 0].
^ t4 sensor: (self indexForSensorName: t1)
Offline
johnnydean1 wrote:
Ok ill post the code:
Name:Get $Variable$ from Mesh
Code:
|t1 t2 t3 t4 |
(t2 _ self ownerThatIsA: ScratchStageMorph) ifNil: [^ 0].
t2 scratchServer
ifNotNil:
[t3 _ t2 scratchServer sensorValueFor: t1.
t3 ifNotNil: [^ t3]].
'tilt' = t1 ifTrue: [^ WeDoPlugin tilt].
'distance' = t1 ifTrue: [^ WeDoPlugin distance].
t4 _ t2 sensorBoard.
t4 tryToOpenPort ifFalse: [^ 0].
^ t4 sensor: (self indexForSensorName: t1)
Why did they have to make smalltalk/squeak so confusing...
Offline
johnnydean1 wrote:
Ok ill post the code:
Name:Get $Variable$ from Mesh
Code:
|t1 t2 t3 t4 |
(t2 _ self ownerThatIsA: ScratchStageMorph) ifNil: [^ 0].
t2 scratchServer
ifNotNil:
[t3 _ t2 scratchServer sensorValueFor: t1.
t3 ifNotNil: [^ t3]].
'tilt' = t1 ifTrue: [^ WeDoPlugin tilt].
'distance' = t1 ifTrue: [^ WeDoPlugin distance].
t4 _ t2 sensorBoard.
t4 tryToOpenPort ifFalse: [^ 0].
^ t4 sensor: (self indexForSensorName: t1)
t1 is already defined, why did you put it in your temp vars section?
Offline
nXIII wrote:
johnnydean1 wrote:
Ok ill post the code:
Name:Get $Variable$ from Mesh
Code:
|t1 t2 t3 t4 |
(t2 _ self ownerThatIsA: ScratchStageMorph) ifNil: [^ 0].
t2 scratchServer
ifNotNil:
[t3 _ t2 scratchServer sensorValueFor: t1.
t3 ifNotNil: [^ t3]].
'tilt' = t1 ifTrue: [^ WeDoPlugin tilt].
'distance' = t1 ifTrue: [^ WeDoPlugin distance].
t4 _ t2 sensorBoard.
t4 tryToOpenPort ifFalse: [^ 0].
^ t4 sensor: (self indexForSensorName: t1)t1 is already defined, why did you put it in your temp vars section?
So how do I do it?
Offline
SeptimusHeap wrote:
nXIII, could you PLEASE make my laser thing!
PLEASE!!!
Here: the laser thing
Offline
Yes as with question no.1 he is the only 1 who can help
Offline
Ok then I posted the code earlier, so what do I do to put it in my mod!
Offline
@JD1: To convert a CYOB block to a block in your mod, you make a method like this:
whatever you want the method name to be here(if there are any arguments, like $Variable$ in the code you posted, put in the following, otherwise, skip it): t1 (if there are multiple arguments, follow this with more text, then put :, then t2, if there are more, more text, :, t3, ect. here's an example) andEatCheese: t2
put your CYOB code here then right click, accept and if it asks, enter your initials. Then navigate to block specs and add: ('name of block, but replace the $Variable$ with %v (I think that's it, or maybe it's %V)' #type of block #whatever your names the method, like examlesAreFun: (notice you don't put t1 in the block specs) andEatCheese: ), right click and accept.
Hooray!
Offline