How do I assign player numbers in multiplayer?

Get help using Construct 2

Post » Tue Jul 08, 2014 2:59 am

Hello - thanks for reading

I'm attempting a 4-person multiplayer game, and I'm looking to assign a player number to each player (host + three peers)

As people come and go in the session, I'd love to make sure the player numbers are always sequential - e.g. P1 = 1, P2 = 2, P3 = 3, but then P2 leaves, so P3 now equals 2.

Following the tutorials online, I'm adding/removing players' aliases to a peer list as they join/leave. I've tried to run the attached code every tick, but it doesn't work.

Any help is appreciated!
You do not have the required permissions to view the files attached to this post.
B
21
S
5
G
3
Posts: 68
Reputation: 2,852

Post » Tue Jul 08, 2014 11:53 am

As with any multiplayer game, the host should determine everyone's numbers, and then tell everyone what their number is. Peers should not determine their own number.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Wed Jul 09, 2014 1:33 pm

Thanks a lot Ashley — you made me realize I was looking at multiplayer in very much the wrong way. Everything is running great now. Much appreciated!
B
21
S
5
G
3
Posts: 68
Reputation: 2,852


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests