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"

Change gamemode on loading a new level.

Hello,

I need to change the current gamemode to a different gamemode when the level changes. This is due to a great deal of logic being built into the controller, that I do NOT want to execute until a certain level is loaded.

How can I change the gamemode when I load a new level?

For instance: (level 1: gamemodeA) (Level2:gamemodeB)

**also if what I am asking is not possible, can the default controller be changed on level load instead?*

Thanks very much for your help.

Product Version: UE 4.16
Tags:
more ▼

asked Sep 26 '17 at 11:20 PM in Blueprint Scripting

avatar image

spacetackle
6 1 2 1

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

3 answers: sort voted first

Hey spacetackle,

It's 100% possible to change gamemodes between levels. In your level's world settings, under the game mode section, you are able to select your own gamemode in the gameMode override dropdown. You can create a new game mode by clicking the '+' next to the game mode dropdownalt text

gamemode.png (21.4 kB)
more ▼

answered Sep 27 '17 at 01:03 AM

avatar image

vivalabugz
729 10 8 13

avatar image vivalabugz Sep 27 '17 at 06:25 PM

hey spacetackle did this help?

avatar image theonecalledtom Aug 24 '18 at 12:29 AM

thinking about this now. What if you want to use the same level with multiple game modes? For instance sometimes the map is Deathmatch and sometimes it's CaptureTheFlag.

Is the solution to have small wrapper levels that pull in the game logic then load a sub-level with the world assets?

Another related question is where should we be putting runtime code that needs to update all the time? For instance your social feed that happens in the main menu AND whatever mode you are playing. At the moment I have this updated from a GameMode class because the GameInstance class doesn't have a tick function but that's going to become messy with multiple game modes.

avatar image theonecalledtom Aug 24 '18 at 12:31 AM

Perhaps the main game logic needs to be in a plugin, with a Tick function. I've been sort of dancing around that idea for a while, beyond the massive earthquake in source control this would imply I'm not sure what the implications are. The way Unreal is structured though this seems like a fairly attractive way to encapsulate the overall game behavior.

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

I know this is super old, but I wanted to comment with what worked for me.

In my HUD widget (I was working on a simple main menu that lets me choose game modes), I used Open Level to load the level and added this as a parameter in the options input:

?Game=/Game/Player/Blueprints/ThirdPersonGameMode.ThirdPersonGameMode_C

Don't be fooled, the _C at the end will not be in the name of your game mode. If it is, you might need another _C at the end. This is awful design in my opinion, as nothing anywhere in my gamemode/files had an _C at the end.

more ▼

answered Apr 20 '19 at 01:28 AM

avatar image

Nostrildumbass
6 1

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

I know is

more ▼

answered Apr 20 '19 at 01:26 AM

avatar image

Nostrildumbass
6 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