Set up PeerID with more than one player in multiplayer?

Get help using Construct 2

Post » Wed Apr 16, 2014 1:58 am

I came across a problem when I was setting up my multiplayer card game. The game involves 4 players joining a room to play at once and I wanted to distribute cards to each one of them, but I found out that you could only set up one person to have the Multiplayer.PeerID. Is that correct? Or am I doing something wrong? What would be a good way to store their unique ID (peerID) and tell the computer to store it in a global or instance variable? Thanks.
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Wed Apr 16, 2014 12:42 pm

You're doing something wrong. Multiplayer tutorial 3 shows how to link peer IDs to players. You must set it to an instance variable in an 'On created' event.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,250

Post » Wed Apr 16, 2014 10:35 pm

Hmm I tried it that way but now my players are having the same peerIDs. Can you check out what is wrong with my project please. I can't get them to be their own player.

https://www.dropbox.com/s/cxt2auw8tv1stpx/NewThockThay.capx
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Thu Apr 17, 2014 10:15 am

@Wsoukkachang - it looks like you don't have any 'Sync object' actions. So you are not in fact syncing anything. 'Sync instance variable' only works when you are already syncing the object.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,250

Post » Thu Apr 17, 2014 12:47 pm

Oh wow! That was the solution! Thank you again Ashley. I am really learning so much from you. Also the new beta release was really helpful, in that it kept telling me which objects I haven't yet synced up. Cheers!
B
19
S
3
G
1
Posts: 37
Reputation: 1,433


Return to How do I....?

Who is online

Users browsing this forum: ismailsawan, ketramtu18, mekonbekon and 10 guests