Joining new multiplayer room returns blank name?

0 favourites
From the Asset Store
An educational game for Fill in the Blanks. An easy to use template for developers to build larger games
  • Hi. In my new game all players join a "lobby" room and when they join a new game they should leave the lobby and auto-join a new game room. But when I output the current room name its always empty. I tried different events or just joining a new room without leaving the old one, but everytime I try to join a new room it does not seem to work and return a blank room or the "lobby". With the events above a blank "Current Room" is returned. :/

    Any ideas why no new room is joined?

  • Don't retrieve data from the Multiplayer Plugin until you have receieved a call back.

    Your code maybe will work 1 time, but may not over repeated calls. MP really requires the shifting from instant returns to only doing MP data work after call backs are made.

    My suggestion is instead of

    Auto Join room

    Set text to room

    to instead

    Auto join room

    OnJoined Room

    set text to room

    Good luck, keep it up. But MP is not a linear hurdle. You will get there with perseverance. Keep asking questions. but also expect to do some head bashing.

  • OMG! Don't know how I could forget about that. I will try it again later. Thank you for pointing that out.

    I am too much used to coding with another app where the next action is executed after the one before has finished.

  • jayderyu I tried to add the "On joined room" but it's still not joining the new room. Since the trigger is OnMouseClick I added a variable to check if it was clicked and the room should be joined. I tried it with and without line 33 (on room left).

    And I tried it as sub event and as single event but it does only show "Leaving Current Room" (Line 32 above). Any ideas?

    (I added a line to set the JoinRoom Var back to 0 after leaving the room)

    /Update: I tried it like shown below but still not working.

  • Do you need to disconnect from the server before you can join an other room? It's not working like expected.

  • Have a look at my Tic-Tac-Toe tutorial: https://www.scirra.com/tutorials/1003/t ... th-a-lobby

    I went through all of this - it takes some work to do a lobby with all of the cleanup. There is one small fix I need to add, but 99% of this is correct.

  • Hi. I will add the lobby later its not used for now. Just need to switch to a new room for a new game.

    Can you explain how you use groups to join new rooms please blackhornet ?

    [quote:234ecv5a]SwitchRooms

    This just cleans up our lobby state, deactivating all of the lobby/transition groups, activates the MainRoom and joins the main room with the instance of our dual-player game. NOTE: this is done this way as you can not Join a new room until you are completely out of any previous room. The Join can not be called directly from the left-room or disconnected triggers as there is still context to the old room. Doing the old active/deactivate with a group manages this.

    So that's why my code above with "on left room" > join new room does not work? I could not open the Client example because it requires 2 addons.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I found the plugin download links in your first part but they are not working. When I open Construct 2 I get this error:

    ---------------------------

    HTML5 exporter

    ---------------------------

    Unable to load plugin in 'D:\Programme\Steam\steamapps\common\Construct2\Construct2-Win64\exporters\html5\plugins\rex_board\': Cannot open file 'D:\Programme\Steam\steamapps\common\Construct2\Construct2-Win64\exporters\html5\plugins\rex_board\common.js'

    This plugin will not be available in the editor.

    ---------------------------

    OK

    ---------------------------

    And this one:

    ---------------------------

    HTML5 exporter

    ---------------------------

    Unable to load plugin in 'D:\Programme\Steam\steamapps\common\Construct2\Construct2-Win64\exporters\html5\plugins\rex_board_squareTx\': Cannot open file 'D:\Programme\Steam\steamapps\common\Construct2\Construct2-Win64\exporters\html5\plugins\rex_board_squareTx\common.js'

    This plugin will not be available in the editor.

    ---------------------------

    OK

    ---------------------------

  • I don't know anything about Steam & plugins unfortunately. Maybe start a new thread to broaden the scope for this particular issue.

    You should be able to install the demo version of C2 and open the files that way, just to have a look.

  • Other plugins like System Date/Time work on the Steam Version of C2. :/

    blackhornet - Can you explain how leaving a room and then joining another room works (with groups), please?

    Why does Leave Room > On room left > Join Room not work?

  • Does Ashley or anonye else know why joining a room after "on room left" is not working? Do I need to wait longer? Or something else I am missing?

  • Why would you want to do that anyway? Presumably the room was left for a reason, such as the player deliberately quit, the server kicked you off, or the connection dropped. For any of those reasons you wouldn't want to re-join immediately, and you could risk setting up a wasteful infinite loop of join-leave-join-leave...

  • Thank you for visiting my topic Ashley

    I used the "Leave Room" action in a single triggered MouseClick event so it should not create a loop?

    What happens:

    First all Players are joining a "lobby" (will be used to find players later and to see how many players are online). But when someone wants to host or join a multiplayer game he clicks on Multiplayer and selects a level. Then the lobby should be left and a new game room joined. So all game data is only synced between the two players in the game room and not between all players in the lobby.

    Is there something wrong with my code (example above) or are there some restirctions on how to leave/join rooms I don't know about?

  • You need to try to look at my tutorial. It takes some work to get this to work properly - that's why I keep pushing you that way. There is no good reason those plugins shouldn't work. Also, the C2 install option is perfectly viable.

  • I tried some other plugins and they are working fine. Are your plugins from part1 too old for r174 and not compatible anymore??

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)