Technical questions about C2

0 favourites
  • 7 posts
From the Asset Store
A cool way for kids to write and practice English Alphabets
  • Hi,

    I stumbled on C2 and I do have few technical questions to know whether or not I can use this tool:

    Does this tool allow me to retrieve external messages or responses from web server / socket server so I can rendering based on those events? If yes, any link so I can read more how this can be done.

    Or some plugin which allows me to talk to a socket server or websocket server which just simply forward responses or pushes messages and also allow me to send request to.

    How can I use JS variables so objects created with this tool react accordingly? Is this possible?

    Thanks!

    SF

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the how do I FAQ there's a section AJAX with topics about how to use AJAX to send and retrieve values from a web server (php in the case of those examples I think).

    There is a websocket plugin (socket) that you can find in the Plugins for Construct 2 forum. Apart from the original topic of the plugin, there is not really documentation for it, but it is a basic socket.

    You'll have to code your server-side outside of construct2 though.

    This tutorial might bring you some technical informations and links to other useful documentation about the use of CC and C2.

    I strongly suggest you to read the blog article about C2's architecture that is linked in this tutorial. It's well written and clear.

    I think those links should get you going for a while and answer most of your questions.

    If you still have some, just post them out.

  • Thx for the quick reply!

    Cool, I've read quickly the websocket plugins and the ajax parts but I do have the following question.

    How do I sent a JSON object to the server and how I can parse it back from the client when the onMessage of websocket comes back? Any plug-in allows me to serialize/deserialize Json objects? Any code snippet so I can try it out?

    SF

  • Nothing so far about JSON.

    I guess you would have to make a plugin (SDK) for C2 to parse the JSON to your needs.

    The plugins section holds a CSV plugin though.

  • Thanks Kyatric!

    That's probably the missing part which I need to do if I want to use C2 to port my current texas hold'em game using HTML5 Websocket and Cubeia's poker for my own site.

    Here is my current work in progress but it's getting hard to maintain and time consuming. But it is working solid. So I was wondering if C2 will make less painful doing the front end.

    youtube.com/watch

    I'm playing more with C2 to see how it goes.

    SF

  • As it's kind of your line of work, what's your input on this topic ? Care to join the discussion there ?

  • I try to make a chat server run at windows by tronadio2 which introduced by zack in his socket-io plugin, and another chat client plugin by socket-io client.

    For command composing/parsing, I will make another plugin connecting to my function plugin, so that I can use the interface of function plugin to compose/parse command.

    Now I can create a very simple chat-room, but still need more testing for debugging, especially for synchronize issue.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)