Download

Level changing and level saving

Im a little bit concerned about Worldswitches.
So you know the game Skyrim or Oblivion were you can switch between interiors and worlds and the variables still remain global.
So if reentering the origin world or interior it WONT reset everything.

How is that possible?
And how can i do this in ue4?

I cant just build everything in one level… and i like levelloading!

4.4 isnt new and this has mostly cpp. Im using 4.9.2 and bps. This does not help me very well…

google game instance

And how do you save level data that is dynamic. Like items that were taken already, enemy position and states. And google doesnt give me good answers. Im kinda mssing a real tutorial wich covers that all properly. Saving the player states seems easy but things that arent persistent like AI items even quests and destroyed actors inside a level.

thats for you to decide and build the system, i just told you there are a game instance class which dosnt reset after changing map. But for the oblivion the game, you would need much more than just a class which dosnt change, it need to be completely different approach for a state world saving. There are something about that on marketplace forum, called saviour, but i dont know how efficient those are.

Scenario:

I have a triggerobject with a state. The state is setted at beginplay. Its a bool-

I wont to save the state, but also have more of the triggerobjects in my levels.

One triggerobject in level 1 one in level 2.

How do i add the certain Index too them… The objects dont know of each other.

This is impossible.

I wish there we an easy way to just save all the blueprint data and redo it on the level so that my changes ingame were passed threw the level…

Im having to go through a similar scenario as yourself at the moment, Im studying into game instances but there doesn’t seem to be much in-depth examples/tutorials (not sure if its because its really all common sense and im stupid or its just really new at the moment). Rama’s explanation is great and all but im doing mine through blueprint also, another way someone suggested me to use is just “save game” but I feel that is kinda cheating when game instance seems to fit perfectly to what i need.

From what I have gathered, game instance looks like a blueprint to store just variables and when you require to have something saved then just cast to it. Some more info on how to blueprint within game instance would be awesome since the events are slightly different. For example, say I have a key and once that is picked up then it should cast to game instance storing a bool variable “hasKey?” to true and if i do traverse back to where that key was from a previous level then if “hasKey?” is true then destroy actor? <----- That is where I get confused on how to tell the key blueprint that from game instance.

Any advice would be great x.

GameInstanace should work fine for all this, you just have to set it up right first.

If you haven’t done that, here is how:
First create a new blueprint class, in the Pick Parent Class menu that appears click the All Classes drop down, and search for GameInstance, select this as your parent class.
Next you have to set your game to use this newly created game instance class.
Go to Edit>Project Settings>Maps & Modes, and you will see Game Instance at the bottom.
Select your game instance in the list.

Then you can create variables in your GameInstance blueprint as normal. From other bluepritns use Get GameInstance and cast it to your blueprint class, if you drag off from it, and type get hasKey, for example, it will show up. You can set variables in the same way.

So for Kanizitas, you jsut need to create bools for those states in your game instance, and set and get them as needed. GameInstance is persistent for the duration of the game, it will reset back to default when you close and reopen the game, so if you don’t want that you’d need to use saves, or config files even in some cases.