Photon Multiplayer: How do I display unique username in game

Get help using Construct 2

Post » Mon May 08, 2017 11:26 am

Hi all. I'm learning how to use the multiplayer Photon plugin, however I'm very green and there are not a lot of tutorials around for it. I've been working off this simple one and its excellent https://www.scirra.com/tutorials/5023/how-to-build-a-multiplayer-game-with-photon (capx included on page)

However there is one thing I wish to do with the chat box that I can't get my head around. The chat box currently displays the players unique ID as the number joined. So the chat screen currently looks like...
<1> Hello!
<2> Hello!
etc...

At the beginning of the layout I am adding a login screen with a text box to store the players name to a variable, but at the moment I can only find a way to display the same name for every player joined, which is useless. Would anyone know how to apply a unique name entered to be displayed for each player in the chat screen?
B
11
S
4
G
3
Posts: 46
Reputation: 1,954

Post » Thu May 18, 2017 12:48 pm

Its alright I figured it out for myself somehow eventually somehow

PhotonTest - Set name of local actor to ACTORNAMEVARIABLE

Chatlog - Set text to chatlog.Text & newline & PhotonTest.ActorNameByNR(PhotonTest.ActorNR) & ": " & PhotonTest.EventData.

Cheers me
B
11
S
4
G
3
Posts: 46
Reputation: 1,954


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 32 guests