So... I've managed to make a custom block appear in the list of blocks, and I can insert it into a script, but I have one problem; every time the script is run, it becomes obsolete. This is because I haven't actually inserted the code anywhere. I've added the
('distance to x %n y %n' #r #dist:and:)
bit (which I think is called the blockspec), but nowhere did it even ask me for the
dist: t1 and: t2 ^ (self xpos - t1 * (self xpos - t1) + (self ypos - t2 * (self ypos - t2))) abs sqrt
bit.
Where do I insert the code?
Offline
Yes, that's the blockspec.
Click down onto instance. Remember where class was? There.
Find the proper ops (looks like sensing ops). It should have some example text down there. Or, click on a method in the farthest right pane, delete all that (it won't really be deleted, don't worry), and paste in your new method (Alt+V).
Offline
Thanks, I'll try that.
I'm pretty sure I'll end up completely wrecking Scratch though xD
Offline
Wait, I can't find proper ops.
I've gone to "Scratch-Objects>ScratchSpriteMorph", but there's no "proper ops". Or am I looking in the wrong place?
Offline
It's not called "proper ops", I said you were probably looking for "sensing ops".
Offline
Oh, lol.
Anyway, before I go any further, is this right?
And then where do I paste the code?
Offline
Yes I have it
Thanks sci.
Offline
Yep, that was right.
Glad to help a new modder, even though I've mostly stopped with that.
Offline
Thanks Paddle.
Okay... Do control blocks go in ScratchSpriteMorph or ScriptableScratchMorph? I've put a control block in the block specs of ScratchSpriteMorph but when I click on instance there's no "Control ops", so I don't know where to place the code for it...
Offline
Y
RedRocker227 wrote:
Thanks Paddle.
Okay... Do control blocks go in ScratchSpriteMorph or ScriptableScratchMorph? I've put a control block in the block specs of ScratchSpriteMorph but when I click on instance there's no "Control ops", so I don't know where to place the code for it...
Just go to other ops.
Offline
I'm presuming you mean in ScriptableScratchMorph then, since there's no other ops in ScratchSpriteMorph.
Anyway... I've added the show/hide cursor blocks to the Control block specs in ScriptableScratchMorph, but I can't find the place the add the code. It doesn't come up in other ops :S
Offline
RedRocker227 wrote:
Thanks Paddle.
Okay... Do control blocks go in ScratchSpriteMorph or ScriptableScratchMorph? I've put a control block in the block specs of ScratchSpriteMorph but when I click on instance there's no "Control ops", so I don't know where to place the code for it...
I think that it's usually put in ScriptableScratchMorph in 'other ops'.
EDIT: oops-didn't see the 2nd page
Last edited by danwoodski (2012-03-16 16:11:09)
Offline
Wait I have it now.
Requesting to be closed again
Offline