i need to code these into something that'll work in scratch
http://www.filedropper.com/setvelocity
http://www.filedropper.com/chngey
http://www.filedropper.com/chngex
Offline
bump
Offline
It's impossible to make it work online, remember that.
For personal offline use, you can easily figure out the method selectors for each of the used blocks in BYOB and write them into a new method in Scratch.
For example, if the script is:
move (10) steps turn cw (20) degreesYou can replicate the same functions in a method using:
Offline
LS97 wrote:
It's impossible to make it work online, remember that.
For personal offline use, you can easily figure out the method selectors for each of the used blocks in BYOB and write them into a new method in Scratch.
For example, if the script is:move (10) steps turn cw (20) degreesYou can replicate the same functions in a method using:
self forward: 10.
self turnRight: 20.
k thx
Offline
LS97 wrote:
It's impossible to make it work online, remember that.
For personal offline use, you can easily figure out the method selectors for each of the used blocks in BYOB and write them into a new method in Scratch.
For example, if the script is:move (10) steps turn cw (20) degreesYou can replicate the same functions in a method using:
self forward: 10.
self turnRight: 20.
would i do this like this?
example:
setvelocity: x:t1 y:t2
Offline
KKdevelopers wrote:
LS97 wrote:
It's impossible to make it work online, remember that.
For personal offline use, you can easily figure out the method selectors for each of the used blocks in BYOB and write them into a new method in Scratch.
For example, if the script is:move (10) steps turn cw (20) degreesYou can replicate the same functions in a method using:
self forward: 10.
self turnRight: 20.would i do this like this?
example:
setvelocity: x:t1 y:t2
No.
Offline
KKdevelopers wrote:
LS97 wrote:
It's impossible to make it work online, remember that.
For personal offline use, you can easily figure out the method selectors for each of the used blocks in BYOB and write them into a new method in Scratch.
For example, if the script is:move (10) steps turn cw (20) degreesYou can replicate the same functions in a method using:
self forward: 10.
self turnRight: 20.would i do this like this?
example:
setvelocity: x:t1 y:t2
The title of the method could be something like
[setVelocityX: t1 y: t2]but under that you would need to put the code for each of the blocks that make up the BYOB blocks!
Offline
This looks like it would be useful, especially if it was generalized.
Offline
scratcher7_14 wrote:
This looks like it would be useful, especially if it was generalized.
It definitely would!
Hmmm... The plugin I made for scratchblocks code already offers a good base for me/someone to work on expanding it to this purpose!
Is it worth the effort, especially with the imminent release of 2.0? Maybe we should forget Squeak altogether by now.
Offline
LS97 wrote:
scratcher7_14 wrote:
This looks like it would be useful, especially if it was generalized.
It definitely would!
Hmmm... The plugin I made for scratchblocks code already offers a good base for me/someone to work on expanding it to this purpose!
That's why I made Scramble.
Is it worth the effort, especially with the imminent release of 2.0? Maybe we should forget Squeak altogether by now.
That's why I gave up on it.
Offline
Hardmath123 wrote:
LS97 wrote:
scratcher7_14 wrote:
This looks like it would be useful, especially if it was generalized.
It definitely would!
Hmmm... The plugin I made for scratchblocks code already offers a good base for me/someone to work on expanding it to this purpose!That's why I made Scramble.
Is it worth the effort, especially with the imminent release of 2.0? Maybe we should forget Squeak altogether by now.
That's why I gave up on it.
I see! That's a nice script that I'd seen before but forgotten it existed.
What's wrong with it / needs adding to it?
Offline
LS97 wrote:
Hardmath123 wrote:
LS97 wrote:
It definitely would!
Hmmm... The plugin I made for scratchblocks code already offers a good base for me/someone to work on expanding it to this purpose!That's why I made Scramble.
Is it worth the effort, especially with the imminent release of 2.0? Maybe we should forget Squeak altogether by now.
That's why I gave up on it.
I see! That's a nice script that I'd seen before but forgotten it existed.
What's wrong with it / needs adding to it?
Nothing's "wrong", but I had my heart set on drag and drop or something cool like that in the future; forms are a bit outdated these days. I suppose version 3.0 could actually be a Scratch patch which turns a script into its Squeak code. Would you mind helping me out? I'm horrid at Squeak.
Offline
Hardmath123 wrote:
LS97 wrote:
Hardmath123 wrote:
LS97 wrote:
It definitely would!
Hmmm... The plugin I made for scratchblocks code already offers a good base for me/someone to work on expanding it to this purpose!That's why I made Scramble.
That's why I gave up on it.I see! That's a nice script that I'd seen before but forgotten it existed.
What's wrong with it / needs adding to it?Nothing's "wrong", but I had my heart set on drag and drop or something cool like that in the future; forms are a bit outdated these days. I suppose version 3.0 could actually be a Scratch patch which turns a script into its Squeak code. Would you mind helping me out? I'm horrid at Squeak.
![]()
You'v never refused to help me with my math, and I'd love to help with this!
I don't know if you've actually managed to run my scratchblocks plugin in the end, but that could definitely be used as a starting point. After that, it should be easy: we just take arguments in order and plug them into the selectors after each colon.
Do you feel like working on it together and name it Scramble, or should I just work on it by myself since it sounds like the job isn't really worth putting effort into a collab
Offline
LS97 wrote:
Hardmath123 wrote:
LS97 wrote:
I see! That's a nice script that I'd seen before but forgotten it existed.
What's wrong with it / needs adding to it?Nothing's "wrong", but I had my heart set on drag and drop or something cool like that in the future; forms are a bit outdated these days. I suppose version 3.0 could actually be a Scratch patch which turns a script into its Squeak code. Would you mind helping me out? I'm horrid at Squeak.
![]()
You've never refused to help me with my math, and I'd love to help with this!
I don't know if you've actually managed to run my scratchblocks plugin in the end, but that could definitely be used as a starting point. After that, it should be easy: we just take arguments in order and plug them into the selectors after each colon.
Do you feel like working on it together and name it Scramble, or should I just work on it by myself since it sounds like the job isn't really worth putting effort into a collab![]()
I looked at your source, and though I can more or less figure out how it works, most of it just went over my head. I'm sure you know your code better, so I'm going to leave this in your hands. Since you won't be able to use both your plugin and the new Scramble together because of the menu changes, you ought to just combine Scramble and your plugin into one nice patch. A couple things to note, though, are that if there are timed blocks you'll need special blockspecs and special code; and that your code should ignore the hat block on top. Good luck, and thanks!
Offline
Hardmath123 wrote:
I looked at your source, and though I can more or less figure out how it works, most of it just went over my head. I'm sure you know your code better, so I'm going to leave this in your hands. Since you won't be able to use both your plugin and the new Scramble together because of the menu changes, you ought to just combine Scramble and your plugin into one nice patch. A couple things to note, though, are that if there are timed blocks you'll need special blockspecs and special code; and that your code should ignore the hat block on top. Good luck, and thanks!
![]()
OK, I will try
Combining the two was exactly what I was doing, maybe even in the future with a whole "export" menu and various sub-entries.
Timed blocks could be a problem, especially since I was planning on making this atomic. maybe the wait block could be replaced by the squeak Sleep function, or ignored altogether?
Another issue I came across yesterday (when I started development) was the say block; it has a different number of arguments than its method and it's a special block, which means the execution engine should be working to handle it. Maybe it's better if I replace it with code of my own there as well!
Then there's the ask block. It is impossible to keep it in a single method because it would freeze the VM and the user wouldn't be able to type anything in. Should I replace that with an input dialog?
Stop script would be translated to ^false.
Then I would manually change repeats, wait until, etc.
How would I do the forever block?
Offline
LS97 wrote:
Hardmath123 wrote:
I looked at your source, and though I can more or less figure out how it works, most of it just went over my head. I'm sure you know your code better, so I'm going to leave this in your hands. Since you won't be able to use both your plugin and the new Scramble together because of the menu changes, you ought to just combine Scramble and your plugin into one nice patch. A couple things to note, though, are that if there are timed blocks you'll need special blockspecs and special code; and that your code should ignore the hat block on top. Good luck, and thanks!
![]()
OK, I will try
![]()
Combining the two was exactly what I was doing, maybe even in the future with a whole "export" menu and various sub-entries.
Timed blocks could be a problem, especially since I was planning on making this atomic. maybe the wait block could be replaced by the squeak Sleep function, or ignored altogether?
Another issue I came across yesterday (when I started development) was the say block; it has a different number of arguments than its method and it's a special block, which means the execution engine should be working to handle it. Maybe it's better if I replace it with code of my own there as well!
Then there's the ask block. It is impossible to keep it in a single method because it would freeze the VM and the user wouldn't be able to type anything in. Should I replace that with an input dialog?
Stop script would be translated to ^false.
Then I would manually change repeats, wait until, etc.
How would I do the forever block?
Wow, that's a lot of problems I didn't think of. Lemme see.
Timed blocks should probably be ignored, and atomic blocks sound good to me. The say block (you mean the timed say block, right?) should be translated into a non-timed say block, which I believe is a normal method. Correct me if I'm mistaken there. Replacing the ask block with a dialog is a wonderful idea. Finally, I think forever should raise an exception and simply not be allowed.
Another problem would be glide and sound blocks. How are you going to handle those?
Last edited by Hardmath123 (2012-08-07 10:30:31)
Offline
That's a lot of problems indeed!
So, forever and other timed blocks will raise a warning and be converted into their non-timed equivalents. Glide could probably become a goto, and sound blocks will trigger a sound but won't wait for it to finish.
I got the basics perfectly working now. All non-special blocks compile as they should and work with arguments and other encased blocks. It's a shame those other blocks will have to be treated manually
Offline
LS97 wrote:
I got the basics perfectly working now.
Already? You're amazing.
Also, have you implemented Squeak comments? (To be honest, I don't know how comments are represented in Scratch, but if they're part of the script they may mess up your code.)
Offline
Hardmath123 wrote:
LS97 wrote:
I got the basics perfectly working now.
Already? You're amazing.
![]()
Also, have you implemented Squeak comments? (To be honest, I don't know how comments are represented in Scratch, but if they're part of the script they may mess up your code.)
I haven't implemented neither variables nor comments yet, and doubt I'll do the latter.
Should I use Scratch variables or should I translate variables to Squeak temporary vars?
Offline
LS97 wrote:
Hardmath123 wrote:
LS97 wrote:
I got the basics perfectly working now.
Already? You're amazing.
![]()
Also, have you implemented Squeak comments? (To be honest, I don't know how comments are represented in Scratch, but if they're part of the script they may mess up your code.)I haven't implemented neither variables nor comments yet, and doubt I'll do the latter.
Should I use Scratch variables or should I translate variables to Squeak temporary vars?
...
I don't know. Can you tell the difference between Scratch Global and Scratch Local variables? If so, you can temp-ify local variables only.
Offline
Hardmath123 wrote:
LS97 wrote:
Hardmath123 wrote:
Already? You're amazing.![]()
Also, have you implemented Squeak comments? (To be honest, I don't know how comments are represented in Scratch, but if they're part of the script they may mess up your code.)I haven't implemented neither variables nor comments yet, and doubt I'll do the latter.
Should I use Scratch variables or should I translate variables to Squeak temporary vars?...
I don't know. Can you tell the difference between Scratch Global and Scratch Local variables? If so, you can temp-ify local variables only.
Yeah, I can tell the difference. But then what's really the point of doing half and half...
Offline
LS97 wrote:
Hardmath123 wrote:
LS97 wrote:
I haven't implemented neither variables nor comments yet, and doubt I'll do the latter.
Should I use Scratch variables or should I translate variables to Squeak temporary vars?...
I don't know. Can you tell the difference between Scratch Global and Scratch Local variables? If so, you can temp-ify local variables only.Yeah, I can tell the difference. But then what's really the point of doing half and half...
True. Maybe you could ask users to prefix all temporary variables with "_" or "#".
Offline
Hardmath123 wrote:
LS97 wrote:
Hardmath123 wrote:
...
I don't know. Can you tell the difference between Scratch Global and Scratch Local variables? If so, you can temp-ify local variables only.Yeah, I can tell the difference. But then what's really the point of doing half and half...
True. Maybe you could ask users to prefix all temporary variables with "_" or "#".
Even more complicated
Really, the only choices I have is dump 'em all into the code or use Scratch's.
Besides, I already got bored of it
Working on a small screen while you're supposed to be on holidays isn't really very nice, so I will resume work when I get back.
Offline
LS97 wrote:
Hardmath123 wrote:
LS97 wrote:
Yeah, I can tell the difference. But then what's really the point of doing half and half...True. Maybe you could ask users to prefix all temporary variables with "_" or "#".
Even more complicated
![]()
Really, the only choices I have is dump 'em all into the code or use Scratch's.
Besides, I already got bored of itWorking on a small screen while you're supposed to be on holidays isn't really very nice, so I will resume work when I get back.
Sure, enjoy your vacation!
I never take my computer on a trip.
Offline
Hardmath123 wrote:
LS97 wrote:
Hardmath123 wrote:
True. Maybe you could ask users to prefix all temporary variables with "_" or "#".Even more complicated
![]()
Really, the only choices I have is dump 'em all into the code or use Scratch's.
Besides, I already got bored of itWorking on a small screen while you're supposed to be on holidays isn't really very nice, so I will resume work when I get back.
Sure, enjoy your vacation!
I never take my computer on a trip.
I used to not (if that makes sense), but now that the school gave us netbooks... it's just too practical!
Maybe not a good habit.
Offline