Doesn't MMO stand for Massivly Multiplayer Online? If it does we should start calling the game MMOG for Massivly Multiplayer Online Game. XD
Last edited by Magnie (2009-04-04 10:01:35)
Offline
Someone make it so I can get Adobe AIR!! Like make it so I can choose where to install it. Please!
EDIT: I looked into Adobe AIR (I still can't install it) but it says you can have online application on your computer. I thought could you make it so Snyff can be an online application? Then you don''t need to download anything but the game/scratch project.
Last edited by Magnie (2009-04-06 14:41:15)
Offline
Magnie wrote:
Someone make it so I can get Adobe AIR!! Like make it so I can choose where to install it. Please!
![]()
EDIT: I looked into Adobe AIR (I still can't install it) but it says you can have online application on your computer. I thought could you make it so Snyff can be an online application? Then you don''t need to download anything but the game/scratch project.
Thats not possible. Letting an online program like that would pose a security risk. At least that was the case with my flash program. If I ever do finish it it will be the same as the snyff except in an exe format with no install.
Offline
Well it like said that "Keep your favorite browser games on your computer"....
Offline
Magnie: I uploaded a zipped windows version (snyff.zip) here:
http://scratchconnections.wik.is/User:Chalkmarrow/Snyff
Last edited by chalkmarrow (2009-04-07 13:09:28)
Offline
Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!
EDIT: It requires AIR....
Last edited by Magnie (2009-04-07 16:44:54)
Offline
Magnie wrote:
Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!
EDIT: It requires AIR....![]()
Right. The zipped file just lets you bypass install of snyff using AIR. You're still going to have to run it on AIR. Even if there is a portable AIR executable, I could not distribute it on a website without a distribution agreement. Your best bet is still just to ask your administrator to download it.
The other alternative is for someone to convert it to a .swf file that runs in a browser (it was created in Adobe Flex using the AIR settings, so it includes components that are AIR-specific).
Offline
Admins = My Parents
My Mom says I have to talk to my Dad. So I guess I'll try that.
But please keep trying thank you.
This may be off topic. My Dad says that Flash is not in his interests so he won't install that so I might not be able to get AIR.
Could you explain the second solution? Thanks!
Offline
Just say its like an add on for scratch. If he lets you install scratch then air should be fine too.
Offline
Actually I put Scratch on my desktop.
Offline
omg! XD yesterday the link was broken, but today it works!!! my first thing will be to make a chatroom with this then from there add a game to the chatroom, hopefully I can make some intersting stuff with this
edit:
XD I'm controlling the scratch cat with another program!!! this is great!
Last edited by dingdong (2009-04-13 14:02:49)
Offline
technoguyx wrote:
Sounds cool, but why is this on Sensor Boards?
![]()
Because it uses similar techniques as the Sensor Board to communicate with Scratch. And to turn on Remote Sensing (which it uses) you have to right-click on a Sensor Board block and pick the Remote Sensing option.
But maybe you are right, maybe this would be more at home in the Advanced Topics area. What do you folks think?
Offline
Yea. I was wondering the same thing. I think it should be in Advanced Topics.
Offline
Yeah. I had the same thought, but it seems to fit within the description of the forum, viz.: "Topics relating to Scratch Boards, PicoBoards, and Scratch sensing and responding to things happening in the world around it." But Perhaps Advanced Features would be better.
Offline
I agree that Snyff is probably the most advanced Scratch-related topic I have seen in a long time. How about renaming the "Sensor Boards" forum section into something like "External Devices"? That way it would be open to discussions about all kinds of peripherals interfacing with Scratch, not just the - awsome - Picoboard.
Offline
Jens wrote:
You know, there's also an experimental "hidden" feature in the public Scratch Source Code which you can unlock without having to get much into Smalltalk-programming at all, and which will let you connect any number of Scratch sessions via TCP to do your MMO's without any middleware involved: http://scratch.mit.edu/forums/viewtopic.php?pid=96799#p96799
I tried that option some time ago, and it works perfectly and it's so fun!
I'm quite tired of Scratch dozens of hidden things behind Shift-Clicks, Control, Right-click-on-blocks-in-the-library and seemingly even switching a variable to true in the source code... OK if the feature is not working yet but this one certainly is.The shift click is taken out in 1.4 - good job . When really lots of people need a feature - like the project summmary or the single stepping speed - it would be so cool to just have those options in a menu...
Joren
Offline
is it possible to make games that support more than two players using snyff?
Offline
dsdude10 wrote:
is it possible to make games that support more than two players using snyff?
I believe that was the point of Snyff.
Offline
Hey Chalkmarrow-
I've done a couple of tests with Snyff and 1.4 and I can't seem to get either computer to recognize sensor-updates so neither one can read the others' variables. Broadcasts work fine, though. Everything works great when I use the same setup with 1.3. Have you encountered the same problem?
Offline
I am having the same issues as fullmoon
Offline
I got 1.4 to receive sensor-updates with the following AS3 class:
package{ //Import everything we need to work with flash.net.Socket and handle its events import flash.events.Event; import flash.events.ProgressEvent; import flash.events.IOErrorEvent; import flash.utils.ByteArray; import flash.net.Socket; import flash.net.navigateToURL; import flash.net.URLRequest; public dynamic class ScratchSocket { //Reserve space for socket, but don't declare it private var socket:Socket; public function ScratchSocket() { //Declare socket socket=new Socket ; connect(); } private function connect():void { //Connect with Scratch on localhost, which responds to port 42001 socket.connect("localhost",42001); socket.addEventListener(Event.CONNECT,socketConnect); socket.addEventListener(Event.UNLOAD,socketConnect); socket.addEventListener(Event.CLOSE,socketConnect); socket.addEventListener(IOErrorEvent.IO_ERROR,socketConnect); socket.addEventListener(ProgressEvent.SOCKET_DATA,dataIn); } public function update(sensor:String,value:String):void { //Function to send a sensor update to Scratch sendScratchMessage("sensor-update "+sensor+" "+value); } //Function to send a broadcast to Scratch public function broadcast(broadcast:String):void { trace("ScratchSocket.broadcast"); sendScratchMessage('broadcast "'+broadcast+'"'); } private function sendScratchMessage(sendData:String):void { //The Scratch Connections protocol requires every message sent to Scratch to //be preceded by four bytes indicating the message length var bytes:ByteArray=new ByteArray ; //Here are three '0' bytes bytes[0]=0; bytes[1]=0; bytes[2]=0; //Here's the actual message length bytes[3]=sendData.length; //Now we write the preceder plus the actual message to the socket for (var i:Number=0; i<4; i++) { socket.writeByte(bytes[i]); } //Here comes the airplane! socket.writeMultiByte(sendData,"us-ascii"); socket.flush(); } private function socketConnect(Event):void { //Handle connection events linked in constructor switch (Event.type) { case 'connect' : trace("connection successful"); update("sc.io.connectionReady","true"); break; case 'close' : trace("connection failed"); update("sc.io.connectionReady","false"); connect(); break; case 'ioError' : trace("connection failed through IOError"); update("sc.io.connectionReady","false"); break; case 'unload' : update("sc.io.connectionReady","false"); break; } } private function dataIn(event:ProgressEvent):void { trace("ScratchSocket.dataIn"); //Create an empty string var inString:String=""; while (socket.bytesAvailable) { //Read the next part of the socket data into inString inString+=socket.readUTF(); } //Send inString off to class SCparse for evaluation evaluate(inString); } // Parse the data received from Scratch private function evaluate(input:String) { trace("ScratchSocket.evaluate("+input+")"); // Look for broadcast from Scratch // Matches any string starting with 'broadcast ' followed by a string of non-return characters in "quotes" var pattern1:RegExp=/broadcast\s\"(.*)"/; var result:Object=pattern1.exec(input); if (result!=null) { trace('Scratch broadcasted:'+result[1]); if (result[1].charAt(0)=="!") { interpret(result[1].slice(1,result[1].length)); } } // Look for sensor-update from Scratch // Matches any sensor-update string Scratch sends var pattern2:RegExp=/sensor-update\s\"Scratch-(.*)\"\s\"(.*)\"/; result=pattern2.exec(input); if (result!=null) { trace('Scratch changed variable '+result[1]+' to '+result[2]); //If the variable changed is 'sc.io.command' then interpret it. if (result[1]=="sc.io.command") { interpret(result[2]); } } } private function interpret(input:String):void { trace("ScatchSocket.interpret("+input+")"); var command:Array=input.split(" :: "); trace(command); var returnVal=""; //If the command returns to an invalid sensor then return to the default sensor, 'sc.io.defaultReturn'. if (command[2].slice(0,6)!="sc.io.") { command[2]="sc.io.defaultReturn"; } //Find out what the command wants switch (command[0]) { case "getURL" : trace("sc.getURL"); navigateToURL(new URLRequest(command[1])); returnVal="success"; update(command[2],returnVal); break; case "nospace" : trace("sc.concat"); var a:Array=command[1].split(" "); for (var i=0; i<a.length; i++) { if (a[i]=="") { a[i]=" "; } } break; case "charcode" : trace("sc.charcode"); update(command[2],command[1].charCodeAt(0)); break; case "store" : //update(command[0],ScratchStorage.store(command[1])) break; } } } }
If you're interested in replicating this, you must instantiate a new ScratchSocket and call its update method:
var s:ScratchSocket=new ScratchSocket(); s.update(variableName,value)
Last edited by fullmoon (2010-10-31 01:25:24)
Offline
fullmoon wrote:
I got 1.4 to receive sensor-updates with the following AS3 class:
Code:
package{ //Import everything we need to work with flash.net.Socket and handle its events import flash.events.Event; import flash.events.ProgressEvent; import flash.events.IOErrorEvent; import flash.utils.ByteArray; import flash.net.Socket; import flash.net.navigateToURL; import flash.net.URLRequest; public dynamic class ScratchSocket { //Reserve space for socket, but don't declare it private var socket:Socket; public function ScratchSocket() { //Declare socket socket=new Socket ; connect(); } private function connect():void { //Connect with Scratch on localhost, which responds to port 42001 socket.connect("localhost",42001); socket.addEventListener(Event.CONNECT,socketConnect); socket.addEventListener(Event.UNLOAD,socketConnect); socket.addEventListener(Event.CLOSE,socketConnect); socket.addEventListener(IOErrorEvent.IO_ERROR,socketConnect); socket.addEventListener(ProgressEvent.SOCKET_DATA,dataIn); } public function update(sensor:String,value:String):void { //Function to send a sensor update to Scratch sendScratchMessage("sensor-update "+sensor+" "+value); } //Function to send a broadcast to Scratch public function broadcast(broadcast:String):void { trace("ScratchSocket.broadcast"); sendScratchMessage('broadcast "'+broadcast+'"'); } private function sendScratchMessage(sendData:String):void { //The Scratch Connections protocol requires every message sent to Scratch to //be preceded by four bytes indicating the message length var bytes:ByteArray=new ByteArray ; //Here are three '0' bytes bytes[0]=0; bytes[1]=0; bytes[2]=0; //Here's the actual message length bytes[3]=sendData.length; //Now we write the preceder plus the actual message to the socket for (var i:Number=0; i<4; i++) { socket.writeByte(bytes[i]); } //Here comes the airplane! socket.writeMultiByte(sendData,"us-ascii"); socket.flush(); } private function socketConnect(Event):void { //Handle connection events linked in constructor switch (Event.type) { case 'connect' : trace("connection successful"); update("sc.io.connectionReady","true"); break; case 'close' : trace("connection failed"); update("sc.io.connectionReady","false"); connect(); break; case 'ioError' : trace("connection failed through IOError"); update("sc.io.connectionReady","false"); break; case 'unload' : update("sc.io.connectionReady","false"); break; } } private function dataIn(event:ProgressEvent):void { trace("ScratchSocket.dataIn"); //Create an empty string var inString:String=""; while (socket.bytesAvailable) { //Read the next part of the socket data into inString inString+=socket.readUTF(); } //Send inString off to class SCparse for evaluation evaluate(inString); } // Parse the data received from Scratch private function evaluate(input:String) { trace("ScratchSocket.evaluate("+input+")"); // Look for broadcast from Scratch // Matches any string starting with 'broadcast ' followed by a string of non-return characters in "quotes" var pattern1:RegExp=/broadcast\s\"(.*)"/; var result:Object=pattern1.exec(input); if (result!=null) { trace('Scratch broadcasted:'+result[1]); if (result[1].charAt(0)=="!") { interpret(result[1].slice(1,result[1].length)); } } // Look for sensor-update from Scratch // Matches any sensor-update string Scratch sends var pattern2:RegExp=/sensor-update\s\"Scratch-(.*)\"\s\"(.*)\"/; result=pattern2.exec(input); if (result!=null) { trace('Scratch changed variable '+result[1]+' to '+result[2]); //If the variable changed is 'sc.io.command' then interpret it. if (result[1]=="sc.io.command") { interpret(result[2]); } } } private function interpret(input:String):void { trace("ScatchSocket.interpret("+input+")"); var command:Array=input.split(" :: "); trace(command); var returnVal=""; //If the command returns to an invalid sensor then return to the default sensor, 'sc.io.defaultReturn'. if (command[2].slice(0,6)!="sc.io.") { command[2]="sc.io.defaultReturn"; } //Find out what the command wants switch (command[0]) { case "getURL" : trace("sc.getURL"); navigateToURL(new URLRequest(command[1])); returnVal="success"; update(command[2],returnVal); break; case "nospace" : trace("sc.concat"); var a:Array=command[1].split(" "); for (var i=0; i<a.length; i++) { if (a[i]=="") { a[i]=" "; } } break; case "charcode" : trace("sc.charcode"); update(command[2],command[1].charCodeAt(0)); break; case "store" : //update(command[0],ScratchStorage.store(command[1])) break; } } } }If you're interested in replicating this, you must instantiate a new ScratchSocket and call it's update method:
Code:
var s:ScratchSocket=new ScratchSocket(); s.update(variableName,value)
ehh, what?
Offline