What is the ActorNumber/UserID naming scheme and clashing numbers?
Options
Chr0my
✭
Hi!
I have a 10 player lobby. I want to assign each player something, but I need to know the actornumber scheme. Is it just 0, 1, 2, 3, etc? or?
or
How can I make all the actor numbers +1 from 0?
also
Can there be 2 of the same actor numbers? if so any way to get a new number and how can you detect a clash?
thanks!
I have a 10 player lobby. I want to assign each player something, but I need to know the actornumber scheme. Is it just 0, 1, 2, 3, etc? or?
or
How can I make all the actor numbers +1 from 0?
also
Can there be 2 of the same actor numbers? if so any way to get a new number and how can you detect a clash?
thanks!
0
Best Answer
-
There is no host in Photon.
There is master client.
Master client can change.
If you mean room creator, initial master client, then yes if it's still in the room it will always have actor number 1 and player index (0 or 1) not sure what is the initial value used.
In any case, whether you use actor number or else, it also depends on your game, if it allows drops/disconnects and rejoins or if it allows late joins, etc.1
Answers
-
Hi @Chr0my,
You probably need player number or player index instead of actor number.
Read more here: https://forum.photonengine.com/discussion/comment/46285/#Comment_46285
and here
https://forum.photonengine.com/discussion/comment/51921/#Comment_519211 -
There is no host in Photon.
There is master client.
Master client can change.
If you mean room creator, initial master client, then yes if it's still in the room it will always have actor number 1 and player index (0 or 1) not sure what is the initial value used.
In any case, whether you use actor number or else, it also depends on your game, if it allows drops/disconnects and rejoins or if it allows late joins, etc.1 -
Oh thanks! Do you know where i can find out if it is 0 or 1 because I'm making a switch case?0
-
I checked PlayerNumbering code, I think it starts with 0.1
-
Last question:
Will this work?switch (PhotonNetwork.LocalPlayer.GetPlayerNumber()) { case '0': Debug.Log("0"); photonView.RPC("RPC_NickName", RpcTarget.All, nickName); break; case '1': Debug.Log("1"); photonView.RPC("RPC_NickName1", RpcTarget.All, nickName1); break; //ect players }
If not could you show me just a quick example of what would?
0