SgtConti's Recent Forum Activity

  • Why do people like Steam?

    Its a great publishing platform for small and big studios.

    Its very cheap during sales.

    Its community is big and the social components of steam are good for gamers.

    Its the biggest distribution platform on pc.

    Thats why stesm is great, i own over 170 games there, and son also c2, you can share screenshots there, earn achievements, everything a true game needs.

    I dunno how the fees are, that only the publishers know, i only know its great ;)

    • Delted -
    • Delted -
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made a Tutorial for Socket.IO

    You can take a look at it here:

    scirra.com/tutorials/571/modded-socketio

    Hope you like it <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Ok i managed it to get the server running, and emitting data through.

    And making an Automatch system for 2 players.

    but now i have a problem, everytime im emitting a string form my text box through, then i get it back the first time right.

    Second time x 2

    3rd time x3

    4th time x 4...

    I have no idea why. Heres a part from my server code in case something is wrong with that:

    socket.on("message", function(data){

              socket.on("chatmessage", function(data2){

                   io.sockets.in(data).send("chatmessage," + data2);

              });

              socket.on("GameSettings", function(data2){

                   io.sockets.in(data).send("GameSettings," + data2);

              });

         });

    I know the post is old, but better keeping this alive then always making a new thread for almost the same topic...

  • var io = require('socket.io').listen(1337);

    // usernames which are currently connected to the chat

    var usernames = {};

    var rooms = {};

    io.sockets.on('connection', function (socket) {

         // when the client emits 'adduser', this listens and executes

         socket.on('adduser', function(username){

              // we store the username in the socket session for this client

              socket.username = username;

              // add the client's username to the global list

              usernames[username] = username;

              // echo to client they've connected

              socket.emit('updatechat', 'SERVER', 'you have connected');

              // echo globally (all clients) that a person has connected

              socket.broadcast.emit('updatechat', 'SERVER', username + ' has connected');

              // update the list of users in chat, client-side

              io.sockets.emit('updateusers', usernames);

         });

         // when the user disconnects.. perform this

         socket.on('disconnect', function(){

              // remove the username from global usernames list

              delete usernames[socket.username];

              // update list of users in chat, client-side

              io.sockets.emit('updateusers', usernames);

              // echo globally that this client has left

              socket.broadcast.emit('updatechat', 'SERVER', socket.username + ' has disconnected');

         socket.on('getrooms', function(){

              //

              //

              io.sockets.emit('updaterooms', rooms);

              //

              socket.broadcast.emit(socket.rooms);

         });

         });

    });

    that would be my server (just example), my problem is i cant connect.

    Construct 2 client side i say: Socket.io connect to "localhost" port 1337

  • Well unfortunately it doesnt show anything on how to use it.

    Maybe im just stupid and dont get it...

    I really need to know from the basics, how you should script something, how it all works.

  • Sry for the lack of explanation.

    Server: Node.js but im open for better options

    C2 Plugin: Zack0Wack0�s modded plugin

    The Message should create a enemy soldier on the other players screen.

    No, you only can control one player, the message is only there to say to the other client, that my player builld a soldier, and that it should make that on his screen.

    So, its my own player wich others need to display ;)

  • hello i didnt wrote anything in the last tome, but now its changing:

    example explanation:

    I press the "Build Soldier" button, it builds a soldier on my screen and sends the data: "Enemy build soldier" to the other client.

    Its a RTS. the server should be like, a Multiroom Autojoin server.

    I have problems understand the servside scripting, and communication between the clients, sending the "messages".

  • Bad thing we cant use it to export our projects if using file:///

    the images should be packaged inside the Exe exported with Node-Webkit

  • Thank you, now i got an idea how it all works.

    Im thinking about using Socket.io to send dictionary values.

    But it wont work, always if i say send: Dictionary.Get(Spawned)

    It say Unkown Expression. Sry for the question but im total noob with Construct 2, before i used to use Cpp.

  • i looked at those, but they don�t seem to fit what im planning to do.

    I a good tutorial(would be best) on how to do this,

    something that describes how i could realize this:

    If button pressed: build soldier and send "build enemy Soldier" to Client2

    ---and:---

    If Multiplayerbutton pressed: Connect server, find room(max 2 players) if no room, create room.

    Something like that ^^ should be done with socket.io i just dont know how.

SgtConti's avatar

SgtConti

Member since 20 Apr, 2013

None one is following SgtConti yet!

Connect with SgtConti

Trophy Case

  • 13-Year Club
  • Forum Contributor Made 100 posts in the forums
  • x2
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Quick Draw First 5 people to up-vote a new Construct 3 release
  • Email Verified

Progress

20/44
How to earn trophies