[quote:3fkvm5ld]But when would I send this message ? If someone joins after the message was sent, this peer won't have a timer.
Earlier, you said that the timer is to give each player a timelimit on how long he can take to make a pick.
I would generally say that you start the game no earlier than when all players joined a room (room is full).
This will prevent you from needing to synchronize the timer every second or so.
If a player disconnects during a game, I wouldn't let him join until the current round is over. That makes the whole process easier-
_______________________________
[quote:3fkvm5ld]I will need to be sure everyone send their answers upon host's signal
Alright, that's quite a requirement.
I would take the following approach:
Since you are playing over LAN, latency shouldn't be much of an issue.
This means that the timer's current times wouldn't be very different for each peer anyways.
Do this:
- When the round starts, the host gives each player the signal to start the timer
- the timer for the peers is used to control the displayed timelimit only.
That means that they will have visual feedback on their time left. (You probably wanted to do that anyways)
But when the peer's timer reaches 0, they won't send their message yet.
They will wait until the host broadcasts a message, that his timer is over.
This will probably cause a slight difference delay the peer's visual timer reaching 0 and the host's message arriving, but this will guarantee that each player sends his message at the same time.
Long story short:
- The peer's timer is started at the same time as the host's timer
- The peer's timer is only used for displaying the time left, not to send the message when the timer reaches 0
- When the host's timer reaches 0, he broadcasts a message (e.g. "timer"). When the peers receive this message, they send their answer (synchronized)
__________________________________
[quote:3fkvm5ld]I tried to do that after including "int(value)", but it stills doesn't work for the group value. The peer never gets their message upon connection, so there must be a problem on host side.
Alright.
Try to set the "Send message" Peer ID to Multiplayer.PeerIDAt(Multiplayer.PeerCount-1).
(I'll explain that if it actually works)