How do I travel my connected players BACK into the lobby FROM my online Game Mode?
Hi folks. I used Wes Bunn's excellent Blueprint Multiplayer tutorial and getting my players connected in a lobby and then having them server travel to a new map and online gamemode works GREAT!
But when the win/end condition occurs in my game mode, what is the proper way to get all my connected players right back into that lobby map so we can just select a new map and go there?
Simply calling the console command servertravel /etc... like we did to get to the game map just crashes the game. What is the proper way to get the host and clients connected to a new lobby map session?
asked Sep 15 '16 at 07:03 PM in Blueprint Scripting
Jumping in here with a possible solution to your question. I'm not quite sure why your project would be crashing though when using the servertravel command, would have to look at your project to see what's going on.
In any case, continuing from the end of the Blueprint Multiplayer Tutorial series you could make the changes in this video to achieve what you are after: Bonus - Blueprint Multiplayer Tutorial (Returing to Lobby from Gameplay).
I do use the servertravel and seamless travel inside the GameplayGM Blueprint but there are some other things that you need to do inside the LobbyGM Blueprint when returning to it from a gameplay map as you are not "logging" in at that point but instead swapping Player Controllers from the GameplayPC to the LobbyPC.
Have a look and let us know if you run into any more issues.
answered Sep 16 '16 at 05:05 PM
Wes Bunn ♦♦ STAFF
SOLVED. So on each of my Character Blueprints my Player Controller blueprint (GameplayPC) was selected under "Ai Controller." I saw that as unnecessary since they are player controlled. So I set the AI Controller to none. This coupled with setting both the Lobby Game Mode and Gameplay Game Mode default character to "default pawn" so they would match for good measure. (My Game Mode blueprint was originally setting default character to none.)
Tested and working. My guess is that there were extra player controllers (GameplayPC) spawning in the level since each character blueprint had one pre-assigned under "AI Controller" which caused server confusion? I can't quite say, but I know it's fixed and working!
answered Oct 06 '16 at 03:42 PM
I hate to necro this thread but it is a thread which most resembles the problem I am currently having. I am simply trying to send my two players back to the lobby after they have reached a 'game over' event. This was a functionality that worked well prior to implementing a steam interface utilizing a hard 'servertravel' but once I implemented the steam subsystem I was forced to move to 'seamless travel' and things stopped working from there.
Using the steam subsystem as well as seamless travel, I am able to have both players go from the main menu to a static lobby level where character selection happens (only 2 characters may be selected). One player hosts the game, the other player finds and joins it....simple enough. Both players select their character and the host then begins the game using console command servertravel with map name. The lobby game mode has seamless travel enabled and the game begins and both players load perfectly and the game plays just how I intend.
After the players lose or win, a "game over" screen appears and now the problem comes up. The host clicks on the "Restart Button" and I try to get the players back into the lobby.
We call the "RestartTheGame" event and do another server travel back into the lobby.
From here, both players seem to disconnect from the session and both players just go straight back to the main menu screen. This is where I am stumped. Like I said before, prior to utilizing the steam subsystem, restarting the game wasn't an issue as I was not using seamless travel. After being forced to use seamless travel with the steam subsystem, it won't let my players both go back to the lobby to select their characters and then seamless travel back into the gameplay map and play again.
Both lobbyGM and gameplayGM have seamless travel enabled.
Any help here is greatly appreciated as to why it seems to kick both players our of the session and back to the main menu rather than using servertravel to take them both back to the lobby. THANKS!!!
After removing the change state on game restart, my game session no longer gets destroyed and both players are taken to the lobby. Now my only problem is that the server has his lobby screen kind of squeezed into the middle of the screen like it was shrunken somehow. The clients lobby screen displays perfectly. Any idea as to why this might be happening?
Follow this question
Once you sign in you will be able to subscribe for any updates here