Hello, I recently just finished my Autosave system Following this tutorial https://youtu.be/PPQz3GGZMxE?si=MS5Ii_73oFEF5Pqv and for some reason in any of my other Levels except the First one Spawns in the position of the Player Start Actor but with the other levels they spawn somewhere else where the Player Start Actor is not at.
Can you post screenshots of the save functionality along with any begin play functionality that may use saved variables
Hey @VintageSCollecto!
I suspect you’re loading the save game on Begin Play inside the character blueprint’s Event Graph.
You just need these to save and load the game:
I used debug keys here but you can call these two saving & loading functions however you like.
For example, since you mentioned autosave, that’d also work by calling the function above. And if you wanned to load automatically, you’d utilize the function below that, and wouldn’t need to load the game on Begin Play.
Hope this helps!
I Don’t use the debug keys the logic is supposed to be stored here. Here are 4 screenshots 2 being the code for the Game Save and Load and the other two being the issue like I said the player for some reason doesn’t spawn at the Player Start Actor the whole Save System is Supposed to Autosave the players location every 60 seconds.
The errors only occur when the 5 seconds is up and when it saves
Hey @VintageSCollecto!
I’ll take a look at it soon I must go for a while.
I wanna note a couple things though:
-
Don’t use Sequence when it’s not necessary, it might cause issues (I didn’t take a look at your blueprint code yet, I’m not saying that’s the issue but something to look for in general)
-
Not for OP but for future viewers, don’t mind the blueprint code I shared in my previous post. I wrote it very quickly and not only there’s a mistake the whole thing is pretty pointless, that’s not how you save & load the game
Anyways I’ll be back
Alright!
So here’s how you can achieve your objective @VintageSCollecto, without encountering any access errors and no issues when switching between levels:
The Event Graph:
The save function:
And the load function:
Also have this inside your level blueprints:
Hope this helps
I would like it to spawn back to that position if thew player quits if its saved of course.
and to where if there is no save data on the other levels the player should spawn where ever the Player Start Actor is
without any keys
if it’s possible.
it works but when I play test it and hit Q it doesn’t load it but it does spawn where the Player Start is.
also is the “Auto Save Interval” Float the time it takes until it saves?
and it instantly saves when I hit play, I would like to have it wait for 6 seconds instead of constantly saving kind of like in that one tutorial i sent earlier https://youtu.be/PPQz3GGZMxE?si=aucfAgSXySOVrBKs
Hey @VintageSCollecto!
I think there’s a confusion somewhere. I didn’t mention it for the first time here:
But now I think it’s time to clear things up.
Take a look at this explanation again:
The snippets I provide are to be integrated with your existing project. You obviously don’t use debug keys for your mechanics, the one I used was just to indicate the start of the execution chain. You can use the function it triggers however you like.
Let’s do this then, since your next goals will also use our existing functions, I’ll explain what you need to do and you try to implement it okay? I think that’d be better for you as you’d be actively learning
Just trigger the save function again before the Quit Game node then. And we already save the player start location upon opening levels so that second thing won’t be a problem.
Simply place a delay before our logic inside the level blueprints. However you’d also need to open the last level along with setting the actor’s transform that way, otherwise the player character will be teleported to a meaningless location in the new map.
Now about your questions & issues:
Yep!
Sounds like you’re not saving then. Make sure to tick the Looping checkbox inside our Set Timer by Event node, and set the Auto Save Interval variable’s default value.
If you keep encountering issues, share your setup for us to take a look
also, would there be a video about this that you recommend.
So @VisAgilis I followed that one tutorial again I just need to know why the player is always avoiding the Player Start Actor on every Map I have like when I place the Actor somewhere else in the level it does not spawn where I put it there for it Just falls into the void.
i just need to know why it doesn’t spawn where the player spawn is.
Forget about the tutorial.
Could you try implementing the setup I provided in a new blank project?
Is it all in the Player Blueprint Without Functions?
Everything except for this part:
is inside the player character Event Graph