Joining new multiplayer room returns blank name?

Discussion and feedback on Construct 2

Post » Mon Jun 30, 2014 12:02 pm

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?
Image
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Mon Jun 30, 2014 2:11 pm

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.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Mon Jun 30, 2014 2:49 pm

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. :)
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Mon Jun 30, 2014 5:16 pm

@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? :?
Image
(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.
Image
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Tue Jul 01, 2014 1:52 pm

Do you need to disconnect from the server before you can join an other room? It's not working like expected. :(
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Tue Jul 01, 2014 2:29 pm

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.
ImageImageImage
B
71
S
21
G
232
Posts: 3,696
Reputation: 129,868

Post » Tue Jul 01, 2014 3:33 pm

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 ?
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. :?
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Thu Jul 03, 2014 1:45 pm

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
---------------------------
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Thu Jul 03, 2014 2:27 pm

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.
ImageImageImage
B
71
S
21
G
232
Posts: 3,696
Reputation: 129,868

Post » Thu Jul 03, 2014 3:49 pm

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? :?:
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Next

Return to Construct 2 General

Who is online

Users browsing this forum: BackendFreak, Huemerson, Yahoo [Bot] and 8 guests