JohnnySheffield's Forum Posts

  • Raspberry can have a lot of different types of Linux on them (and other OS types).

    One could try to export the project to html5 and then run it form a browser, just like on any device. However my test have shown that performance is not so good.

    I think that your best bet is to install Android OS on your raspberry and try to export through cooconjs, or try to go with Firefox OS.

    What Linux are you specifically talking about?

    Is Linux absolutely necessary for your project?

  • I would first see will the official websocket plugin suits your needs. if not, there's aceofpack mod, with possibility to send and recieve JSON, but with unstable 'onanyevent' triggers, or my mod, but without json and anyevent. your best bet is to use either version and adapt it to your needs!

    Cheers!

  • Sorry, misread.

    But, nevertheless, the "on event recieved" is possible thanks to the same function as on "any enevt".

    It seems that you need custom event triggers; i.e. 'on myEvent'. My current solution is tho manually add triggers for everycustom event directly in runtime.js. I use this version of the plugin github.com/JohnnySheffield/C2_Plugins/tree/master/Socket_io-mod_stable

    I add a newcondition to the edittime.js, somewherearound line 22:

    addcondition('on my trigger', ,mytrigger','blahblah', 'onMyTrigger')

    In theruntime.js i add a new eventlistener:

    socket["on"]

              (

                   'Mytrigerr',

                   function(event)

                   {

    //trigger the ondatacondition here if needed               runtime.trigger(pluginProto.cnds.OnMyTrigger,instance);

                   }

              );

    And finally i add the condition

    :

    Cnds.onMyTrigger= function(){return true;}

    It needs more planning ahead, and is time connsuming, but in my experience it provides muchmore stable code.

    Sorry for the formatting, writing on mobile;

    Cheers!

  • Hi!

    I've uploaded this version of the plugin here as a kind of a dev version, but i will maintain the stable version here and add stuff as we make decisions!

    Cheers!

    edit:

    thatjoshguy

    The "on any event" is a pretty hackish stuff, and i would recommend that you don't use it. The socket.io support on the wildcard event is something that is discussed, but there is no news on implementing it. Solution for "on any event" used in this version of the plugin is taken from stackoverflow, and it misbehaved!

  • You can make node-webkit apps with free version, but you have to do the package process manually, and respect the license terms of the free version.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ahh, i was wondering how do you create installer for a complex program like Construct 2! Thanks for the tip!

  • jayderyu C2 packages app automatically when you export to node-webkit.

    Maybe something like this could be used to make an installer for a nw exported game?

  • Cool, thanks for the detailed answer and clarifying things up, when (if) i make some test, and get some decent results i'll post in forums.

    Cheers!

  • Hey, great idea, i wish you all the best with the application development business.

    I've completed the survey, so you got my data! Do you plan release the result of the survey when you're done with data-analysis?

    Cheers!

  • Yup, it seems that it isn't supported yet...

    I wonder would it be straight forward to implement these methods (functions? whats the proper name?) in a third-party plugin or are there any limits regarding C2 engine and/or Cocoonjs engine?

  • ahhhh... Don't run nodejs.exe. It's just node console, you can use that to test your ideas, or learn node.

    To start some .js file in node try:

    Open up command line (Start -> cmd) got to the folder where your .js file is, (c:/path/to/my/file) and then try "node myfile.js" command.

  • That's actually expected behavior...

    Node is waiting either for connections, or something else, depending on your code.

    So, let's say your code looks like this (a simple hello world http server):

    ---

    var http = require('http');

    http.createServer(function (req, res) {

    res.writeHead(200, {'Content-Type': 'text/plain'});

    res.end('Hello World\n');

    }).listen(1337, '127.0.0.1');

    ---

    It actually won't throw anything to the console, it just sits and waits for connections.

    If you add a line on the end of the file:

    ---

    console.log('Server running at http://127.0.0.1:1337/');

    ---

    It should write the message once you start your server.

    Cheers!

  • Just a quick response, im in a hurry, so sorry if this is just pile of crap;

    Runtime.js, around line 149 there's a workaround for cocoonjs:

                   if (method_ === "POST" && data_)

                   {

                        if (request["setRequestHeader"])

                        {

                             request["setRequestHeader"]("Content-Type", "application/x-www-form-urlencoded");

                             request["setRequestHeader"]("Content-Length", data_.length);

                        }

                             

                        request.send(data_);

                   }

                   else

                        request.send();

    Could you use this snippet, make a varible like this.myHeader which you can set, and then replace the "setRequestHeader" with this.myHeader (and other stuff you need), and in construct before making the ajax call set this.myHeader with an action, and then make the call.

    "Need to have something working by end of day :(" -> Ahh, the good 'ole deadlines :D

    Cheers!

  • I've read the User Media runtime.js, and it seems that it doesn't work on cocoonjs. Is this correct?

    If one would try to write a plugin to get access to a camera on cocoonjs, would it be possible to use the:

    CocoonJS.Camera.startCapturing(0, 50, 50, 30);

    CocoonJS.Camera.getAllCamerasInfo();

    methods to get access to a camera? (Methods from here)

    Cheers, and thanks for all the responses!

  • You could try and search "multiplayer" on the forums. There's a lot of demos and examples. You'll have to modify them to suit your needs, or write 'em ground up, or make somebody to do it for you!

    Cheers!