How do I sync a text in multiplayer?

Get help using Construct 2

Post » Wed Dec 02, 2015 1:59 pm

condolent wrote:@lennaert maybe it's not even necessary to sync the text? The position is synced and works but it's the name of the host-player that I want it to show up as


Just refer to the Multiplayer.PeerAliasFromID(peerobject.PeerID)
Who dares wins
B
53
S
13
G
11
Posts: 1,758
Reputation: 13,830

Post » Wed Dec 02, 2015 5:12 pm

@lennaert not sure how I'm supposed to do that, could you take a look at my .capx and show me a example??
Website Twitter Indie Developer
B
20
S
5
G
4
Posts: 206
Reputation: 2,904

Post » Wed Dec 02, 2015 11:33 pm

You actually need to set a player name .... currently in your capx it's playername = ""

And you also login with that... not sure how that pans out, but it would be wiser to actually set a name :P
Who dares wins
B
53
S
13
G
11
Posts: 1,758
Reputation: 13,830

Post » Thu Dec 03, 2015 8:23 am

@lennaert there's a login screen in that capx, that gets the text you type in and sets PlayerName to it in uppercase. and you do login with PlayerName as alias xd
Website Twitter Indie Developer
B
20
S
5
G
4
Posts: 206
Reputation: 2,904

Post » Thu Dec 03, 2015 2:33 pm

Ahh, sorry yes, I had started your app without the login screen.

I've gone over your events, and your not settings any peer IDs for objects, which you should.


Take a look at the template examples, and make sure that in your app the host and newly connected peers get a PeerID.

For the host side:
On peer connected: create peerobject, set peerobject.peerID to multiplayer.PeerID

For the peer Side:
On peerobject created, set peerobject.PeerID to multiplayer.PeerID


Then, each player/peer or host has peerobjects with their own PeerID's, which you can use as reference, for Multiplayer.PeerAliasFromID(peerobject.peerid)
Who dares wins
B
53
S
13
G
11
Posts: 1,758
Reputation: 13,830

Previous

Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], KailSaisei, Magistross and 11 guests