[PLUGIN] Zack0Wack0's Construct 2 Plugins

0 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • I've tried everything I can think of to get this plugin to minify but with no luck.

  • Hey guys, i've got this game my team developed that i've ported to construct 2. It's a two player versus game that i want to be able to access on portable devices so i was digging around for some sort of peer-to-peer connection solutions for construct (and also im very new to network stuff for games). I read the multiplayer faq but didnt quite see a clear answer.

    is this plugin (socket-io plugin) able to do this (not by itself i'd imagine)?

    and is a peer-to-peer not a good idea for a 'player vs player' game?

  • rexrainbow

    Thanks heaps! i havent had much time lately but i'll be studying those links :)

  • greetings.

    someone could help me I have already installed and socket.io node.js but I have no idea how I'm going to do to implement it in the game because it already and been trying and not let me. can you help me giving me a quick step by step guide please

  • Everything is better now. I think after my computer restarted it was all better.

    Re-installing Java might have done the trick. Unless restarting my computer and getting r100 fixed the issue.

    ~No Clue.

    Edit: Nevermind. After a few refreshes it minify still continues to break this plugin.

  • Taurian - i was also having problems with getting socket.io/node.js plugins from or rexrainbow to work once i switched layouts...

    What I eventually figured out was that in each layout, I had to re-add the parent condition:

    Socket --> Is Data Available?

    with the event

    Socket --> Split Data Received

    to all of the socket-data-processing parts of the new layout. I hadn't done that on subsequent layouts - i was moving right into the socket.lastdataelement processing...

    Hope this helps someone else not waste four hours of Charles-assisted debugging... (OK, that's not fair. I saw some great repo man reality shows on TruTV - not all was lost.)

  • You can check out modded version of this plugin here:

    Link with minify problem sorted out!

  • Thank you so much for the wonderful plugin:)

    Hi could someone please tell me how the Socket.LastDataElement(Index) works?

    I've been sending data back and forth from the server and find it frustratingly inconsistent. Was hoping someone could tell me how to determine the index of the data I'm sending back and forth. According to the cmd it is broadcasting:

    websocket writing 5:::{"name":"message","args":[["10"]]}

    It works with Socket.LastData (though the capx keeps giving me a pop up error with that if anyone knows what that is?), but would like it to be more specific with LastDataElement.

    Thanks for any help, and once again, really great plugin

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi!

    First you have to SplitDataReceived to get some consistent LastDataElement.This plugin splits data where is a comma sign, eg.

    If your message looks like 'message',"Some,data,here" it will be split like this:

    Socket.LastDataElement(0)="Some"

    Socket.LastDataElement(1)="data"

    Socket.LastDataElement(2)="here"

    As you can notice, Socket.LastDataElement requires an index number, starting from zero.

    As for the error i cannot really tell you something useful, if you could post .capx and server code, it would be possible to pin-point the error more accurate.

    Also, there is a few versions of that plugin on the forum (it's pretty unstable plugin, there is great community effort to make it more stable, hence a few versions of it exist), so if you could tell us where did you download Socket plugin, or share the plugin here!

  • Hey Johnny,

    Thanks for the great answer though unfortunately my game is still not receiving data properly until the non-specific Socket.LastData expression is used.

    I'm using the socket.io version that was updated by Rexrainbow, and I'm following this guide/example of how to set up multiplayer: jptarqu.blogspot.com.au/2012/04/how-to-create-online-multiplayer-html5.html

    I've followed exactly, the socket is receiving and seems to be writing messages just fine, so all i can figure is I'm doing something wrong with the Socket.LastDataElement(index).

    I would post the file for downloading but I'm not sure how to do that:P Will gladly post it otherwise.

    Currently my socket is writing

    debug- websocket writing 5:::{"name":"M,10"}

    debug- broadcasting packet

    and I have construct 2 set up to receive like this:

    Socket On Connect

    Socket: Is data available? - socket: Split Data Received

    System: Socket:LastDataElement(0) = M - System: Set M to Socket:LastDataElement(1)

    Thanks again for any help:)

  • If you're using rexrainbows socket.io plugin, you should probably follow his instructions. I think he made a special plugin to communicate with his server, so i don't believe it will work with juantars demo. As i haven't read the source of rexrainbows socket.io plugin, i really cannot tell you how it works, so you could maybe ask him?

    To set up juantars demo, you can use this mod or this mod of the plugin.

    Both should do the work.

  • JohnnySheffield

    Sure, the protocol of my plugin to send command/data is different with juantars's. And my server is different with juantars's.

  • Hello,

    I have a external game server running on port 8000. Can I connect to that port and communicate with the server using socket.io plugin.

    I have installed node.js and socket.io Then what shall I do next to do this?

  • github page not found????

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