Yet-another Multiplayer Demo (with capx)

Show us your completed creations made in Construct 2

Post » Fri May 25, 2012 4:17 pm

@B10KILLER : do you mean thst people connecting inside your lan do see your updates, but people connecting from the internet (outside your lan) can't see the updates? If so, it might be that your router is blocking connections to the port you are using for node.js.
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Fri May 25, 2012 11:43 pm

@j1k I just downloaded and installed v0.6.18 of node.js few days ago and installed socket.io without any problem.
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Sat May 26, 2012 12:49 am

yeah sorry I didnt check the server.js to understand how it works lol my bad..it works now
B
1
Posts: 4
Reputation: 383

Post » Sat May 26, 2012 6:16 am

Hi @juantar !!
I followed your excellent instructions, and in 10 mins I have a Construct 2 Multiplayer game running across my LAN! This is simply amazing - I can't thank you, Zacko, and everyone else involved enough for making this possible! Good work guys - the C2 community continues to absolutely astound me on a regular basis with incredible innovation and creativity :D
B
34
S
8
G
3
Posts: 328
Reputation: 7,692

Post » Sun Jun 03, 2012 9:19 am

This is great stuff Juantar.

Would you be willing to show how to incorporate "Rooms" with SocketIO.

See here(SocketIO Readme):

### Rooms
Sometimes you want to put certain sockets in the same room, so that it's easy to broadcast to all of them together.

Think of this as built-in channels for sockets. Sockets `join` and `leave` rooms in each socket.

#### Server side

js
var io = require('socket.io').listen(80);

io.sockets.on('connection', function (socket) {
socket.join('justin bieber fans');
socket.broadcast.to('justin bieber fans').emit('new fan');
io.sockets.in('rammstein fans').emit('new non-fan');
});
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Mon Jun 25, 2012 7:46 pm

Hi there!

I cannot open the project with the last stable release (r95), it says:

"Could not open project. Cannot find condition by ID"

, is it possible I'm doing something very wrong or that there is some incompatibility?

Thanks!

Rahms
B
10
Posts: 8
Reputation: 635

Post » Tue Jul 24, 2012 8:04 pm

Hi!

First of all, thanks for the great job. I got the server started, but i cannot open the .capx file. Same problem as rahms above. I got the latest update too (Release 95) Is it possible you could make a .capx file in the new version?

/Michael
B
3
Posts: 1
Reputation: 427

Post » Wed Jul 25, 2012 3:56 pm

I put a new version that I tested succesfully with r99. Also, when extracting the plugin make sure the files are directly in the socket-io-mod folder in the plugins folder, in other words you should see a runtime.js dated today in plugins\socket-io-mod. Previous versions of this plugin might have dumped the files into a folder named "socket-io", if you have that folder, delete it.

Also, if you see any old files with "(Picture-That)" in their names, you need to delete those. Those were backup copies included by accident in the previous version.juantar2012-07-25 15:57:47
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

Post » Wed Jul 25, 2012 10:39 pm

@juantar
hello, I have installed the node.js and am reviewing the example you left, is very good, but wanted to ask if "Controller" is a plugin where I can find that if I can do that only two players are playing and at time and if I can remove a player if you enter another, thanks for this tutorial and look at this super blog and also helped me clear my good a couple of questions I had thanks
B
16
S
3
G
3
Posts: 15
Reputation: 2,813

Post » Fri Jul 27, 2012 7:56 pm

@itza3985
No, Controller is not a plugin. It is just an empty TiledBackground object that I use to hold some variables related to controlling the networking logic.
If I understand the rest of your post correctly, you want to allow only 2 players at all times. You also want to "kick out" one player when another connects. There is probably a way of doing that, and the best place to put the logic is in the Node script (example_server.js) somewhere after "//assign number", a high level overview of the code would be:
1. call disconnect in one of the players
2. change the line that increments the myNumber variable to increment only if the number of players is less than 2.
Right now, the example just allows any number of clients to connect.
B
26
S
7
G
3
Posts: 118
Reputation: 4,264

PreviousNext

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 4 guests