HollyB's Forum Posts

  • 4 posts
  • Hi,

    Managed to get a game and socket io server working fine on my computer thanks to these examples. But does anyone know how and where to host the game and the socket.io server files?

    I tried uploading them on nodejitsu, but unfortunately all I'm getting there is a 'welcome to socket.io' message instead of the very basic tester game I was hoping to see.

    Does anyone have any experience with uploading these files? If so, any info or pointers would be appreciated.

    Thanks!

  • Try Construct 3

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

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

    I've made a simple multiplayer game example which seems to be working fine, but I'm having trouble testing it as every time I try to open 1 of the 2 layouts, it refreshes the other one automatically.

    I have 2 layouts, for 2 players (they have some seperate game states so they must be seperate, not just different views of the same world) and would like to have a tab in the browser open for each. Anyone know a way to get construct 2 to do this without automatically refreshing all tabs to which ever layout I load?

    Thanks for any help:)

  • 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:)

  • 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

  • 4 posts