Last Major Revision: 7/11/12
This on Scratch Suggestions!
A Note For the Scratch Team:
Should this idea be accepted, I would be interested in helping develop the syntax (maybe the actual interface, if I learn Flash) and documentation for this API
Now, since this obviously would be too hard to implement for the 2.0 release, I'll ask for it for 2.1 or later
What I would like is an Plugin/Modding API (more extensive than the current Remote Sensors Connections) in Scratch 2.1 or a later release
For all those who don't know what an API is, here's a Wikipedia article
How it might work:
Scratch would pop up a dialog on startup asking which plugins to enable for this session.
On the user's computer, maybe in something like /appdata/roaming/.scratch, there is a folder /plugins which would contain all plugin folders.
Each plugin folder would contain a file, probably an XML format, that points Scratch to a file (like .jar, .js[see note at bottom], .exe, .bat [see note at bottom], .swf, etc). After this, Scratch opens a socket connection to that program and tries to connect. The program can then send messages like
Code:
new block(BlockSpec, returnFormat,);
creates a new block
new reporter(BlockSpec, returnFormat,);
creates a new reporter
new boolean(BlockSpec, returnFormat);
creates a new boolean reporter
new globalVariable(Name, value);
creates a new global variable with the name and value specified
new localVariable(Name, sprite, value);
creates a new local variable for the said sprite
updateGlobalVar(Name, value)
Changes the value of global variable Name
updateLocalVar(Name, sprite, value);
Update the local variable of sprite "sprite" and Name "name" to the value "value"
new dialogBox(type, title, message);
creates a new dialog/promt box in scratch
return(BlockSpec, value);
returns the value of the reporter/boolean with the given blockspec
broadcast(Message);
what do you think?
giveProjectPath();
returns the absolute path to the project
save();
saves the project
saveAs(Path);
saves the project to the given path
close();
opens the close dialog
open(path);
opens the "open" dialog box with the given path as default
upload();
opens the "Upload" dialog box
while Scratch could send these out:
Code:
callReporter(BlockSpec, args[]);
calls a reporter previously defined with the given arguments
callBoolean(BlockSpec, args[]);
same as above, but boolean
callBlock(BlockSpec, args[]);
same as above, but the block defined
updateSensors(Name, value);
same as in remote sensors connections
broadcast(message);
same as remote sensors connections
Some things it could allow for:
Custom blocks without modifications (Flash is hard to mod, so this would fix that)
More advanced coding
Integration of other languages
Ability to play audio formats other than those supported in Scratch
Auto-updating and uploading to other websites
Export to .exe, .jar, .app, maybe even import/export from/to .xml
More stuff
Now, with the blockspecs, they wouldn't be the standard squeak ones.
Each argument is preceded by either %, $, or #
$ means string
# means number
% means boolean
the name of the argument is after it, with no spaces
Supporters:
itsmomito
bobbybee
XenoK
veggieman001
SciTecCf
samtwheels
fg123
Bklecka
laser314
roijac (kinda)
me
Some examples:
If the plugin wrote this on startup,
new boolean("file at $1 is extension $2 ?", $1":"$2);
Then the block would be
<file at [] is extension []?>in a plugins category
Last edited by SJRCS_011 (2012-07-30 11:25:02)
Offline
Too hard to implement, which could make it rather improbable. But anyways, I support.
Offline
bobbybee wrote:
Too hard to implement, which could make it rather improbable. But anyways, I support.
there's a reason I suggested it for 2.1
Thanks for the support though
Offline
What are "remote sensor connections" anyway?
Offline
wow
I say yay, that would be great.
And they use JSON, not XML.
Last edited by veggieman001 (2012-05-14 10:12:47)
Offline
mythbusteranimator wrote:
What are "remote sensor connections" anyway?
Remote Sensors
Thanks for support veggie
Last edited by SJRCS_011 (2012-05-14 21:34:43)
Offline
roijac wrote:
kinda support the idea, but seems a bit too easy to manipulate and abuse
thanks
Maybe there could be some sort of limitation though
Plus each user would decide whether or not to use that certain plugin
Offline
Bklecka wrote:
You Got This From Minecraft's Upcoming Modding API But I Support.
Actually no. But thanks for support.
Offline
I support! Would this allow for multiple mods to be installed? I was thinking of making a mod for that in 1.4, but never got around to it.
Offline
@samtwheels: yeah, it would allow for multiple mods to be loaded at a time
Thanks SciTecCf, samtwheels, and fg123!
Offline
Support! It would be really awesome.
Offline