Announcement

Collapse
No announcement yet.

Multiplayer Question: Run event to all connected players

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multiplayer Question: Run event to all connected players

    Hi All!!

    I'm facing some problems due my poor (for now) multiplayer programming and I need some help.

    I have two players connected to a session, they should choose their avatar. When player clicks on "choose" button I check on GameState if all clients are ready. When all players have they chosen avatar, the game begins but... I want to show a countdown on both players. The "Start Game" event could be fired from client or server, it depends who choose it avatar later.

    When a player is spawned the widget for the countdown is assigned to the PlayerState so when all the players are ready I call a function on GameState which starts the countdown:

    Click image for larger version

Name:	1.PNG
Views:	1
Size:	78.1 KB
ID:	1216148

    The StartCountdown function:
    Click image for larger version

Name:	2.PNG
Views:	1
Size:	110.6 KB
ID:	1216149

    And finally inside the widget, when the countdown is finished if it's server I call ServerTravel. It's supposed that both should run the countdown but only one ServerTravel is called.

    Click image for larger version

Name:	3.PNG
Views:	1
Size:	112.8 KB
ID:	1216150

    The problem: it only works when is the server who make the last chooice and the other players dont see the countdown of his widget...

    Any idea??

    Thanks!

    #2
    Originally posted by ColibriLive View Post
    Hi All!!

    I'm facing some problems due my poor (for now) multiplayer programming and I need some help.

    I have two players connected to a session, they should choose their avatar. When player clicks on "choose" button I check on GameState if all clients are ready. When all players have they chosen avatar, the game begins but... I want to show a countdown on both players. The "Start Game" event could be fired from client or server, it depends who choose it avatar later.

    When a player is spawned the widget for the countdown is assigned to the PlayerState so when all the players are ready I call a function on GameState which starts the countdown:

    [ATTACH=CONFIG]136173[/ATTACH]

    The StartCountdown function:
    [ATTACH=CONFIG]136175[/ATTACH]

    And finally inside the widget, when the countdown is finished if it's server I call ServerTravel. It's supposed that both should run the countdown but only one ServerTravel is called.

    [ATTACH=CONFIG]136178[/ATTACH]

    The problem: it only works when is the server who make the last chooice and the other players dont see the countdown of his widget...

    Any idea??

    Thanks!
    Hi. Server travel (probably) wont work on 1 machine. Epic made tutorial but tested server travel on pc + laptop...
    However, some months ago it was probably bugged and it worked for me... so no idea whats true.

    Comment


      #3
      Hi!

      Server Travel is working properly. My problem is when both player are ready, the countdown only runs on server side, clients does not see it.

      thanks

      Comment

      Working...
      X