Yet-another Multiplayer Demo (with capx)

  • Thank you for all the input people :D

    Gonna try out the several ideas to see what I like the most and to learn more about javascript :)

    Later on I think it would be best to run even more on the server side.

    Like health of players so that no cheating happens and that players die on all clients and not just the ones in perfect sync.

    But that after I get this to work :)

  • Schoening I'm planning to work the health thing out :)

    Here's my to-do list:

    • make nameplates
    • server-side healths
    • figure out how to make accounts for reloadable status
    • graphics and other fancy stuff

    And if I can make somehow accounts, than I can try to make achievements and other competitive stuff.

    Any idea people for anything above? :)

  • Check out Clay.IO for the stats, and achievements. I am sure the owner could help as well.

    What do you mean graphics? C2 for the visuals for me ^^ Else I would just work with some libaries

  • Try Construct 3

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

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

    A good and easy place to learn javascript is at codecademy.com

    It's a good place to start and learn the fundamentals and some of the advanced stuff too.

    BarneyK

    For nameplates...I don't really know, although I'll try to think of something.

    Maybe we should open another thread later on, that has all the javascript and capx files for each socket.io capability.

  • Schoening

    Under graphics I meant the backround, sprites and other things, because I have now just some stickmen for testing:)

    Great idea for opening thread for that!

  • Help! I get this error:

    Script:

    C:\Users\Matthew\Downloads\socket-io-mod\example_server.js

    Line: 5

    Char: 1

    Error: Object Expected

    Code: 800A138F

    Source: Microsoft JScript runtime error

  • InvaderX

    You haven't installed node or socket.io

    You're running this without these two and therefore it doesn't work. Once you install node and socket.io use node example_server.js

  • C:\Users\Matthew\Downloads\socket-io-mod>node example_server.js

    module.js:340

        throw err;

              ^

    Error: Cannot find module 'socket.io'

        at Function.Module._resolveFilename (module.js:338:15)

        at Function.Module._load (module.js:280:25)

        at Module.require (module.js:362:17)

        at require (module.js:378:17)

        at Object.<anonymous> (C:\Users\Matthew\Downloads\socket-io-mod\example_server.js

    er.js:5:10)

        at Module._compile (module.js:449:26)

        at Object.Module._extensions..js (module.js:467:10)

        at Module.load (module.js:356:32)

        at Function.Module._load (module.js:312:12)

        at Module.runMain (module.js:492:10)

    C:\Users\Matthew\Downloads\socket-io-mod>

    I get that error now. I downloaded both Socket.io and Node! It's weird!

  • InvaderX

    Ok, I walk you through this.

    Open a cmd prompt and type 'npm install socket.io'

    make sure you are in the directory where your server file is.

    Packages such as socket.io are downloaded to that specific directory. It isn't install on the system, and only files that are in the same folder as the socket.io directory can access socket.io.

  • Thanks. Its apparently working. So, how would I go about setting this up on my own game? Is there anything that I need to know first? Sorry, I stink when it comes to this stuff :S

  • InvaderX

    Have you used the example that was linked? You can probably look through that and figure it out. But if helps if you know JavaScript.

  • Ok.. I fucked up somehow.. I installed the newest version of NodeJS.

    And now I have trouble with the socket..

    I did npm install socket.io.

    <img src="http://imageshack.us/a/img259/2103/nodefail.png" border="0" />

    I probably just have it in the wrong location.

    NeverTheLess.. Help !

  • Schoening

    If you add the -g (= global) flag to the install command (npm install socket.io -g), that should ensure that it'll be on a filepath where the node command can locate it. (My PATH environment includes: C:\Program Files\nodejs\;)

    [ADDED]

    For reference:

    My node.exe is in

    C:\Program Files\nodejs

    My socket.io files are in

    C:\Program Files\nodejs\node_modules\socket.io

    My server development files are in:

    C:\Program Files\nodejs\dev\c2mp

    When I installed

    Executing 'node server.js' in C:\Program Files\nodejs\dev\c2mp\ transparently accesses all necessary files/modules (including of course socket.io).

  • Hm.. not really working :s It does get installed in wierd places! App Data for instance

  • Schoening

    What do you mean by weird places? Why weird? And what's App Data?

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