x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[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).

alt text (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:

alt text

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?

Product Version: UE 4.12
Tags:
more ▼

asked Jul 10 '16 at 09:51 AM in Blueprint Scripting

avatar image

Heidi
116 3 6 7

avatar image Heidi Jul 10 '16 at 12:00 PM

I've recreated this in a new project. The errorlog looks slightly different.

alt text

Am I using ServerTravel wrong? Or is that something else

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

4 answers: sort voted first

Hi Heidi,

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!

more ▼

answered Jul 10 '16 at 09:57 AM

avatar image

TechnicallyLew
134 7 3 8

avatar image Heidi Jul 10 '16 at 10:50 AM

alt text

This gives me the Hello text and then promptly crashes aswell.

This also happens when i rightclickt my .uproject and Launch Game.

However this does not happen in PIE. There I just get the Hello Print and it seems like the ConsoleCommand doesn't have any effect, or is canceld out to avoid the crash.

But since this is MyGameInstance it is Serversided anyway. I cant even check for 'Has Authority' because of this. Seems to be something else...

Edit: This only happens when i use

ServerTravel MapName?listen

When i use

open MapName?listen

i dont get a crash, but thats not realy the option that i need :P

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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: alt text

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: alt text

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 :)

gi.png (543.2 kB)
gi2.png (644.8 kB)
more ▼

answered Jul 10 '16 at 01:03 PM

avatar image

TechnicallyLew
134 7 3 8

avatar image Heidi Jul 10 '16 at 01:58 PM

After comparing my Blueprint with your example i noticed that you Create 2 Sessions. I thought I create a Session for the Lobby where all players can join and then just travel the maps. Seems like i need to Create a new Session before i use the ServerTravel command.

After rebuilding your example like this: alt text

All i get is the Print with Error:FailedToCreateSession! Are you sure about creating a 2nd session because it always returns the On Failed pin.

When from MainMenu i create a session and open the lobby. And other client from MainMenu joins the session. Both are in Lobby and working as expected. How can I move both clients to my GameMap now???

avatar image TechnicallyLew Jul 10 '16 at 03:51 PM

Oh! Noob mistake! Sorry yes, you don't need to create the new session for the Server Travel one!

avatar image TechnicallyLew Jul 10 '16 at 03:51 PM

Once your initial session is created and clients have connected, the server travel option without the second session create should work

avatar image Heidi Jul 10 '16 at 07:02 PM

Well it doesn't. Thats what this post is about. I get the error I posted above.

avatar image TechnicallyLew Jul 13 '16 at 09:53 AM

So did you rework your above without the second session creation and it still fires the error?

avatar image Heidi Jul 13 '16 at 01:13 PM

yes, i also did that in a new project, the error log of that is above. both failed

avatar image TechnicallyLew Jul 16 '16 at 05:17 PM

Are you using the steam subsystem, or any online subsystem for that matter?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Bump for visibility. Someone please help me...

more ▼

answered Jul 12 '16 at 09:07 AM

avatar image

Heidi
116 3 6 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Try To use the ServerTravel Command in the GameMode...

more ▼

answered Feb 24 '19 at 03:05 PM

avatar image

Baaaalllss
1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question