I’m trying to create a common sublevel to use in persistent levels, and manage the weather and time.
Editing the sublevel actors makes it easy to edit the environment.
The problem is that sublevel edits are not independent, so editing one will affect all of them.
How can I maintain different sublevel states for each persistent level?
Surely it’s the other way around? You can use the persistent for the weather and time, and load your sublevels into that?
Wow, I’ve never received such a fast response to a question before!
So does this mean my approach was wrong from the start?
I only use the persistent level to set the game mode and leave it empty. It was a pain to have to place actors individually in the persistent level to use the same thing, so I put them all in a sublevel. Just load the sublevel and you’ll have everything i need.
I can also create new sublevels if i need a different environment.
I need is some small changes, like editing the lights or wind direction, to be applied when the sublevel loads. The assets used are exactly the same, so I just need to change a few values, but I don’t know how to keep them.
It’s a little bit like blueprint inheritance. Put all the stuff that is common to everything in the parent.
In this case everything you’re always going to need, goes in the persistent. Stuff like sky, post process, directional light, skylight, fog etc. Obviously no actors ( objects ), unless they will also always be needed.
Just to be clear here, I’m talking about using streaming, or level instances?
So you always have the persistent loaded, and can load sub-levels with other stuff in using either ‘load streaming level’ or ‘load level instance’ ( or streaming volumes ). I’m talking about runtime, not during level editing.
If you want to tweak stuff in the persistent depending upon which sub-level you have loaded, you can give the code that decides when to load sub-levels the information to make the tweaks. For instance, I have a blueprint which contains all lighting and the sky, it also has a map variable so I can lookup the level I just loaded, and get all the values I need
I hope I didn’t go off on a huge tangent there
The reason I stored everything in sublevels was because I needed to change the persistent level to change the gamemode. (I couldn’t find a way to change the gamemode class)
So for me, the persistent level is not permanent despite its name.
This means that operations on the persistent level are effectively synonymous with operations on the sublevels.
The big difference is that the “base” changes, so there is no gamemode, actors, etc. during the load.
Ok, I don’t quite get your setup, but understand about the game mode. Nope, you can’t change that.
I guess all you could do is ‘open level’ to open a new persistent with a different game mode, and then stream the rest.
I’ll try to see if I can make changes to the sublevel through the game instance. I can’t think of any other way.
Thank you for helping me solve the problem!