Setting Gamemode before Loading a Map

Hi Blue-Printers,
i’m trying do create an All-In-One Gamemode Map, First-Person, Third-Person and VR, and it should be able to be loaded from the Main Menu Map, by Selecting the Gamemode. If you are wearing an VR-Device, it should switch automatically into the VR-Game Mode.

Everything works perfect…in the Editor. But if i package the Project, the switching between theese 3 Modes doesn’t work anymore. Have you an idea to solve this?

Thank you!
Reinhard

There’s a few ways I can think to go about this, id think the simplest and easiest would be to set the game mode selection at menu,like you have already, save it to a variable in a saved game, then in the level BP load and set the game mode on begin play

1 Like

Might be an issue of the gamemodes not being packaged because they are not referenced (string refs are not real refs).
In Packaging Settings there is an option “Directories to Always Cook”, try adding /Game/User/Gamemodes there.

1 Like

Thank you, for your reply!

How could i set the GameModeOverride GameMode after loading a Map? Up to now, i didn’t found a way to do that.

Ich can get the GameModeOverrideValues, but i can’t set them.

Greetings!
Reinhard

Thank you very much for your response!

That’s, what i think, that the link to the GameModes will not be compiled!

Greetings,
Reinhard

On begin play, get saved game, get the game mode variable, set game mode

Thank you, for your response!
But, there ist no “set game mode” node available. I can create my GameMode Variables. But i can’t assign it after loading the map.
Greetings,
Reinhard

Ah, forgive my lack of knowledge! Perhaps you could use an input mapping or class change on load?

Thank you

Sodala, i found the solution for this issue: The setting of the Gamemode via Options as string, requires that all used gamemodes are included into the packaging. I add all used gamemodes as variables into the Widget blueprint and now, even the packed versions can switch between my 3 Gamemodes: FirstPerson, Third Person and VR Game, without the need of creation for different Gamemode maps.

Thank you,
Reinhard

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.