How do I reset multiplayer/room

Get help using Construct 2

Post » Fri May 08, 2015 11:05 am

Hi there,

So I am playing around with the Pong multiplayer example, trying to extend it and such.

I have made a lobby where you can change name but also profile picture, etc. There is a button to play a game, which takes you to the game layout.

You can play the game and after 5 points, you win, and are taken back to the menu layout/lobby.

However if you press to play again, you are taken straight back to the lobby from the game because the game thinks you have still won from last time. how do i reset this? i have tried using multilayer commands such as disconnect, leave room but this is not having any effect.

thank you for guidance!
We make Facebook games!

Please contact us if you want to work with us to release your game on Facebook - our team have generated millions of installs for our own C2 and Flash games, and we can do revenue-share deals with YOU, too!

https://u1stgames.com
B
12
S
2
Posts: 79
Reputation: 819

Post » Fri May 08, 2015 3:44 pm

It sounds like you need to reset the variables with scores upon entering the lobby.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri May 08, 2015 10:43 pm

hi lennaert, thanks for your reply, but which variables do i reset and how?

do i need to also disconnect from the room or signalling server? i am guessing and trying many combinations of variable deleting and leaving room but still yet no success.
We make Facebook games!

Please contact us if you want to work with us to release your game on Facebook - our team have generated millions of installs for our own C2 and Flash games, and we can do revenue-share deals with YOU, too!

https://u1stgames.com
B
12
S
2
Posts: 79
Reputation: 819

Post » Fri May 08, 2015 10:51 pm

The variable with the score which makes you win, I would guess setting it to zero could do it.

But without your capx its uncertain to say whats happening.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri May 08, 2015 10:54 pm

lennaert i am using the multiplayer pong capx that comes with construct2

the score is associated with each paddle. i dont understand though how the score is retained after disconnecting from the signalling server???
We make Facebook games!

Please contact us if you want to work with us to release your game on Facebook - our team have generated millions of installs for our own C2 and Flash games, and we can do revenue-share deals with YOU, too!

https://u1stgames.com
B
12
S
2
Posts: 79
Reputation: 819

Post » Fri May 08, 2015 10:57 pm

There is no way to tell without knowing what you changed :P
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri May 08, 2015 11:15 pm

okay i have discovered that after finishing the game, you need to reset the global variable "game state" to waiting.

now i can restart a new "game" (game layout) but still am unable to join a new room for some reason
We make Facebook games!

Please contact us if you want to work with us to release your game on Facebook - our team have generated millions of installs for our own C2 and Flash games, and we can do revenue-share deals with YOU, too!

https://u1stgames.com
B
12
S
2
Posts: 79
Reputation: 819

Post » Sat May 09, 2015 1:50 am

Leaving the room, and going back to the lobby to join a new room would be the way.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Sat May 09, 2015 9:45 pm

hi lennaert thank you for your replies, but then where should the code be for connecting to the signalling server? in the default pong project, this is in the "game" layout so does that mean that at the end of each game i should disconnect from the server? or just the room as you have mentioned?
We make Facebook games!

Please contact us if you want to work with us to release your game on Facebook - our team have generated millions of installs for our own C2 and Flash games, and we can do revenue-share deals with YOU, too!

https://u1stgames.com
B
12
S
2
Posts: 79
Reputation: 819


Return to How do I....?

Who is online

Users browsing this forum: darkrealos, luckyrawatlucky and 22 guests