How do I save to savegame what level and player start to use when loading game?

Hopefully someone answers I rarely get any luck here. But I’m stuck. I followed this tutorial on a save game system:

It was extremely helpful and works for everything in my levels like showing and destroying actors, integer variables in the character, etc.

Then I followed this tutorial on how to make the game mode override which player start to use when opening a level.:

This tutorial also worked great and was able to travel to a level, then go back to a new level and not have the player start at the very beginning.

Now the only problem is I’m having trouble combining them. They both work great during the same game instance. But once I close the game in editor, for some reason it won’t “remember” what play start to use and spawns me all the way back at the start of the level. Any tips? answers? or general advice in the right direction? will be greatly appreciated. Here’s some bp pics:

This is the main menu loading and creating game functions. Calls to game instance. See on create game how I set the name variable, which chooses which player start to use. I want that to always be “StartGame” when we create a game so we start at the first player start.

This is the loading the game function from my game instance called from main menu

This is the override function in my game mode. Chooses which player start to use based on if we find a matching tag that we set previously

Here’s a simple example of a collision box, once player walks into it. We set the new start “teleportation tag” so that we can spawn at player start further in the level.

Again, all works good if you don’t close the program, but for some reason it won’t save to the hard drive when everything else does.

You could use a TMAP in your saved game, of level names or objects to location vectors, on begin play query the current level to the map and call set actors location with the returned vector

Just use this node when you saving game data:

image

Then when load game get it and " open level by name ". Then you start game in saved location.

1 Like

For anyone interested in the future. The main problem was that I was trying to save something that didn’t really need saving. I kinda just made it more complicated for myself.

I was trying to hold onto a system that I only am going to use once. So the whole choose player start system isn’t really necessary. I can simply just save the players last saved location and by what level thanks to node given in replies by @Consoler_whole. Really gave me inspiration for the whole fix thx

So i scrapped the whole choose player start and I’m only going to have one player start then I’ll just teleport the player on begin play. I thought that if I did this it would be jank and would look bad especially if for a split second you see the player in one place then teleport to where you left off. But I decided to try it anyways and it works great. Very seamless and since I’m using motion matching the player barely sways when spawning in but still looks great.

As for the one time I wanted to use the choose player start system. I’m just going to teleport the player to that spot on begin play