Yet-another Multiplayer Demo (with capx)

Show us your completed creations made in Construct 2

Post » Fri Oct 12, 2012 5:07 pm

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

@lonehangman Great idea for opening thread for that!
B
4
Posts: 7
Reputation: 390

Post » Sun Oct 14, 2012 10:30 pm

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
B
29
S
7
G
3
Posts: 361
Reputation: 6,187

Post » Mon Oct 15, 2012 11:59 am

@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
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Mon Oct 15, 2012 1:14 pm

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!
B
29
S
7
G
3
Posts: 361
Reputation: 6,187

Post » Mon Oct 15, 2012 2:11 pm

@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.lonehangman2012-10-15 14:14:15
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Mon Oct 15, 2012 10:50 pm

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
B
29
S
7
G
3
Posts: 361
Reputation: 6,187

Post » Wed Oct 17, 2012 3:47 am

@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.
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Thu Oct 18, 2012 7:38 pm

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.




I probably just have it in the wrong location.

NeverTheLess.. Help !
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Fri Oct 19, 2012 1:54 am

@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).Velojet2012-10-19 05:40:33
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Fri Oct 19, 2012 1:02 pm

Hm.. not really working :s It does get installed in wierd places! App Data for instance
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

PreviousNext

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 1 guest