[Crash] ConsoleCommand in Blueprint 'ServerTravel MapName?listen' doesn't work
Hello! After quiet a few days of trial and error I'm getting forward, however now my problem lies somewhere else. Quick overview of whats going on:
I have 2 players.
Both join the Main Menu map.
After Creating Session and joining Session from oneanother and a level load to Lobby (which is working fine).
(I have the space after ServerTravel - I tried putting B in without a string and hardcode it)
When in the Lobby, everyone is ready, and i click my start button the ServerTravel MapName?listen command is fired and i promply get an error like this:
I get this error twice, for each Standalone window that just crashed. My Editor stays up and running, and I could play again after dealing with the Crash Reporter.
I tried different Mapnames for the ServerTravel, and noticed that when I would go back to MainMenu with that command, it did not crash!
When I use any other way to load the Level everything is working as expected, except for the part that I dont ServerTravel. Which is what I want to use in this case.
I've loaded the map before and after this crash fine if I do it in any other way. The ServerTravel Mapname?listen one seems to not like my Map. Any ideas?
Ok so I have done a similar thing but much simpler I feel. I believe you may have clients crashing as the console command is perhaps running on all? You should be calling this command by RPC (Run on Server) event. If not, fix this first!
Once it is se to be a run on server event, remove the get player controller from the specific player pin. It isn't a requirement and might only cause issue. If the event only fires on server it won't need a specific player anyhow.
Hope this helps!
Ah you are doing this from game instance. In that case, run from server is indeed pointless and you can revert back and, you need to create the session first.
From your HostGame event, make a create session node first. I'm guessing they are crashing as they are not currently in a networked session and so it can't perform a server travel as there is no defined session settings.
Here is a Game Instance Event I have in my Tutorials Set:
The difficulty with your own is that you are running a console command each time before people are in the session.
If your game starts into a lobby where people can join then all travel (Think rocket league style) then I would have in your GameInstance Class:
Now, when the game initialises it will create a session, load the level for lobby. Now players can join and so on. Once ready, you could perhaps have a UMG widget or event that fires to trigger the ServerTravel event. For simplicity I made one event to handle this with a Boolean which dictates which type. Game will always start as lobby but then all you would need to do is Get Game Instance, Cast to it, call the Create Session event and input into the function the desired level name and ensure Game Lobby is false.
This should theoretically work! Let me know :)
answered Jul 10 '16 at 01:03 PM
Bump for visibility. Someone please help me...
answered Jul 12 '16 at 09:07 AM
Try To use the ServerTravel Command in the GameMode...
answered Feb 24 '19 at 03:05 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here