Questions about multiplayer

0 favourites
  • 2 posts
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • 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? ... player.png

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)