technoboy10 wrote:
Here's my (rough) plan for executable Snap! extension servers.
That's all fine, but the key point is that you have to be able to inject the corresponding .xml into Snap! itself. And this has to work even if the user is running two or more extensions at once. So, your program has to be a web server itself, like the extensions, and when you click its "Start Snap!" button, it has to send to the user's browser the URL
http://snap.berkeley.edu/snapsource/snap.html#open:http://localhost:3986?extendme
where 3986 is the assigned port for your program itself, and "extendme" is interpreted by your server to mean "concatenate the XML files for all the chosen extension modules" (probably not quite literally concatenate; you have to have just one XML wrapper for the whole thing).
It would be even better if this could be done from within Snap!, so that an extension module could be added easily to an already-running Snap! instance, but Jens questions whether we should have that degree of smooth connection because the user should know that s/he is doing something that breaks the Javascript sandbox. He's probably right. In fact your program's menu should say in red up at the top "External Snap! extensions do not have the same assurance of safety as Snap! itself. Use extension modules only from sources you trust."
Offline
blob8108 wrote:
So, for example, I can convert a Snap! variable to a Scratch list if you use list blocks on the variable. This won't work for all cases, but I think I can raise warnings for most of them.
You mean, "if you use only list blocks on" it. But consider the situation in which a variable is assigned a value that's reported by a custom block, and that custom block reports a list. And the variable itself is merely passed as input to other custom blocks, so it's never used with a list primitive.
PS I hate when I wake up in the morning and there are a zillion posts and when I answer the first one my answer starts a new page, and I have to keep switching back and forth! (But I do like waking up to a zillion posts!)
Offline
bharvey wrote:
consider the situation in which a variable is assigned a value that's reported by a custom block, and that custom block reports a list. And the variable itself is merely passed as input to other custom blocks, so it's never used with a list primitive.
Scratch 2.0 doesn't have reporter blocks, so that's already a failure
Offline
blob8108 wrote:
Scratch 2.0 doesn't have reporter blocks, so that's already a failure
Oh yeah huh. That's the other problem about finding a zillion posts when I wake up!
But you have to plan ahead for 2.1 or whatever they call the version that does.
Offline
The project ID is the number at the end of the URL to the file.
For help, type "python snapin8r.py -help".
Remember to cd into the snapin8r directory!
I keep getting an invalid syntax error. I typed "python snapin8r.py number", "python snapin8r.py -number", and "python snapin8r.pynumber" and none of them work.
Offline
Zygorithm wrote:
I keep getting an invalid syntax error.
Did you install Python 2.7?
Offline
bharvey wrote:
concatenate the XML
Or, Snap! could get the ability to import multiple modules. (i.e. #open:this&that&other)
bharvey wrote:
smooth connection
I was wondering about that myself. It's probably better that users have to intentionally run extensions.
bharvey wrote:
your program should say in red
Of course.
I've had to learn how to multi-quote just because of this thread.
Offline
technoboy10 wrote:
I've had to learn how to multi-quote just because of this thread.
You know that you can just say [quote] rather than [quote=foo] after the first time, right?
About open=this&that, we'll see what Jens thinks, but there's so much else going on in Snap! itself right now that if you can have an entirely self-sufficient program it'd be up for users much sooner.
Offline
technoboy10 wrote:
bharvey wrote:
concatenate the XML
Or, Snap! could get the ability to import multiple modules. (i.e. #open:this&that&other)
Or a JSON format, e.g., #{language:'en-US',modules:[],project:''}
Offline
Zygorithm wrote:
The project ID is the number at the end of the URL to the file.
For help, type "python snapin8r.py -help".
Remember to cd into the snapin8r directory!I keep getting an invalid syntax error. I typed "python snapin8r.py number", "python snapin8r.py -number", and "python snapin8r.pynumber" and none of them work.
That's strange… can you paste the entire output?
EDIT: It shouldn't be just number, it should be:
python /path/to/snapin8r.py -p number -f /full/path/to/desired/output/file.xml -open
Use -f and -open are optional flags (-open automatically opens Snap! with the converted project). -p is required.
You should have gotten:
The -p flag is mandatory. Run './snapin8r.py -help' for help on flags.
if you didn't add the -p flag…
Last edited by Hardmath123 (2013-04-04 23:44:42)
Offline
Zygorithm wrote:
Code:
python /path/to/snapin8r.py -p number -f /full/path/to/desired....I still get an invalid syntax error. Here's what I did.
https://dl.dropbox.com/u/45677595/SyntaxError.png
It's because you're using Python version 3.3. You'll need to download Python 2.7 instead.
Offline
Zygorithm wrote:
I notice Snap! doesn't have a permanent list block. How do I store my permanent databases such as stats, bag items, party list, save states, etc?
Make a variable, assign it a list value.
The big idea: Binding a name to a value is a single capability, regardless of the type of value. A special make-a-list button is no more necessary than a make-an-integer button.
(Yes, I know, in principle this argument applies just as well to the make-a-block button. But blocks have all these special properties -- shape, color, inputs, all that -- and have to appear in the palette. I've always wanted the variable blocks to turn into command, reporter, or predicate shape when the variable is given a procedure as its value, but the trouble, as Jens keeps reminding me, is that the variable assignment doesn't happen until too late to put that block in a script.)
Offline
blob8108 wrote:
Zygorithm wrote:
Code:
python /path/to/snapin8r.py -p number -f /full/path/to/desired....I still get an invalid syntax error. Here's what I did.
https://dl.dropbox.com/u/45677595/SyntaxError.pngIt's because you're using Python version 3.3. You'll need to download Python 2.7 instead.
I can try to use 2to3…
Offline
Here's a converted version that should work on your computer: https://docs.google.com/file/d/0B1UC0dD … sp=sharing (2to3 converted).
As for the startScene error, Snap! doesn't support the Scene blocks so you can't convert projects that use those. Sorry.
Offline
Announcing (finally!) the first prototype Snap Tutorial. (The link is a .mov.zip file.) The plan is to number the tutorials to match sections of the Reference Manual, and I started at building a block, so this is Tutorial IIIA1, the first tutorial on section III.A of the manual. Comments welcome on format, fidelity, whatever. It'd be better if I could figure out how to do anything in the new "improved" iMovie.
Offline
Wow, nice video! I really think you did a nice job with it. I like that you included a few "try doing this yourself" moments and you explained everything at a good pace.
Offline
40MB?! How long is it?
Offline
Hardmath123 wrote:
40MB?! How long is it?
10 minutes of 1080p. (It has to be HD because, last I checked, YouTube compresses non-HD video with some algorithm that's fine for actual movies but really messes up sharp edges, whereas their HD looks okay.)
But if you know how I should have made it smaller, by all means teach me!
The screen capture was in Snapz Pro X using the Apple Animation codec, and then I did a small amount of editing in iMovie. Before the iMovie step it was 217Mb.
PS If you think downloading it is bad, imagine uploading it over asymmetrical DSL!
Last edited by bharvey (2013-04-07 00:31:11)
Offline
As for the startScene error, Snap! doesn't support the Scene blocks so you can't convert projects that use those. Sorry.
My project does not use any Scene blocks. It was converted from Scratch 1.4 and I did not use any Scratch 2.0 features like Scene, clone, cloud variables, etc.
Offline