Questions about multiplayer

Get help using Construct 2

Post » Wed Sep 23, 2015 7:35 am

Hi, I'm having some problems understanding how the multiplayer object works.

I'm trying to create a chat system which uses the Facebook plugin to grab a users Facebook ID, name and stores them in global variables 'facebookName', 'facebookID'. I then use 'facebookName' as the alias to join a game.

On peer connected I can create a Player object with 'peerID', 'facebookID' instance variables, I can then set the created Player object's 'peerID' using Multiplayer.PeerID but how do I set the 'facebookID'?

This is how I have it setup but for each peer/host it replaces the 'facebookID' in all Player objects with it's own global variable. Is it even possible?

https://www.dropbox.com/s/p6959uhpcf9z3 ... player.png
Have retro games for sale? Buy & Sell Retro Games UK
B
9
S
2
Posts: 68
Reputation: 768

Post » Thu Oct 01, 2015 6:12 pm

In the peer group, you do not need the set facebook variable.

Seeing as you sync that variable, it takes a moment after creation and the host then sets the facebook ID.
So you should remove the "set facebookId" from the peer group.


Also, you do not need to add the "sync variable peerID" in event 5. You can remove that.
The multiplayer object takes care of this. you only need to set them on host and peer end, as you have done.


Question: The facebook ID is all numbers, right ? remember that syncing object variables do not accept Letters.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests