I was looking forward to this a loot of time but I cant find any reference to that, using the command “servertravel Map?Game=/Game/Blueprints/MyGameMode.MyGameMode_C” doesnt work, the server dont do nothink
If I use “servertravel Map” it works, but the loaded game mode is the maps default game mode so, how can I change the game mode when using servertravel()?
I just hit the same problems. I want to reuse a map with different GameModes but I just can’t get it to work. Did you get it to work with “open Map?Game=GameMode”.
Any luck on your side? Didn’t look into it that much, but I am reaching a point in development where I have to figure this out. I really want to reuse maps for different GameModes.
I will probably just hook it up on LoadLevel() in c++, but I’d prefer a working default implementation
This seems to pop up in the Search Results and the last answer suggests that Server Travel doesn’t work with specifying and changing the GameMode.
THAT IS WRONG!
You can indeed change the GameMode via every travel when specifying ?game=<Shortcode> or the classname with module name in front.
What DennyR posted above is correct in terms of telling UE4 to change the GameMode.
The only thing that you might need to keep in mind is that if you perform a ServerTravel with “RELATIVE” mode, it will grab the data from the current URL, which is your current GameMode.
You need to make sure that you travel “ABSOLUTE”. The Console Command should do this by default, but if you travel via C++, you might need to pass in an extra “TRUE” to the ServerTravel function.
Hope that helps peeps that are encountering this in the future.
PS: The Shortcode can be specified (by now?) in your Project Settings. Go to the Maps&Modes page and expand the top most advanced menu. There you should find the GameModeClassAliases map, where you can specify the Shortcode and select the GameMode Class for it.