Technical questions about C2

Discussion and feedback on Construct 2

Post » Wed Dec 07, 2011 6:31 pm

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
B
3
G
2
Posts: 9
Reputation: 1,143

Post » Wed Dec 07, 2011 8:19 pm

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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Dec 07, 2011 9:54 pm

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
B
3
G
2
Posts: 9
Reputation: 1,143

Post » Wed Dec 07, 2011 10:13 pm

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.Kyatric2011-12-07 22:15:01
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Thu Dec 08, 2011 3:22 am

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.

http://www.youtube.com/watch?v=ZK1eCYNhMG0&feature=player_embedded

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

SF
B
3
G
2
Posts: 9
Reputation: 1,143

Post » Thu Dec 08, 2011 3:52 am

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

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Thu Dec 08, 2011 4:00 am

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.rexrainbow2011-12-08 04:04:57
B
97
S
22
G
176
Posts: 4,109
Reputation: 103,021


Return to Construct 2 General

Who is online

Users browsing this forum: glerikud and 11 guests