Blueprints or code?


Author: Riley Darling 

 Posted on 5/17/2024

Adding a save and load system to a game seems relatively easy at first, especially since Unreal has a built in system so you don't have to read or write from any external files at all! The problem comes from one simple function that wasted most of my week, AsyncLoadGameFromSlot, everything else with the saving and loading was working just fine until I tried to implement this function in code. You see it is rather simple to setup in blueprint as you can just drag off the "completed" pin to connect up to what you want to do when the load has been completed, super simple and easy:


The only issue with this is in code, you have to connect that "completed" option to a built in delegate from a different class!



The solution I found to this problem that took a good part of my week was ignoring the async load and just using the normal LoadGameFromSlot function. This may be a problem later down the line if we need to use async when our save files become too large but that is a hurdle we can deal with when we get to it. I still don't know how to set a delegate type that is from a different class, and if I do end up needing to fix this I will simply add the async code into a blueprint, even if that's not the professional way to handle the situation. I've already wasted enough time on this silly little system as it is.

Leave a comment

Log in with itch.io to leave a comment.