Save game - isn't saving, need help

#Main problems:

Saving returns: True, but loads nothing.

Printing - SaveReferenceActor List shows correct values during Gameplay.
However, when it loads - it loads nothing.

When i print string the list on startup, it’s empty.

All of my logic is inside GM_Main
I have a BP_SaveGame where i store all my SaveReference variables.

I’m sharing my blueprint via blueprintue.com and if anything else is needed i’m willing to share more.
I’m really at a loss here… Thank you.


[Main][2]

[Set actor location][3]

[Load actor location][4]

Here, when you make a new save game, you need to save it to slot

When you make it, nothing gets written to disk. You have to do that with SaveGameToSlot.

Hi thanks for the help.
I added it after my Set’s but to no avail.

However - i do get some new interesting warnings in my log now.

LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class

Not sure as to why it would say it’s a null class when i print the class name succesfully during gameplay.
So it does save, but it just doesn’t load correctly probably due to some faulty code on my end.

It saves now, but doesn’t load appropriately.

Could you shed some light as to why my error message says “NULL” when i can succesfully print them when they’re in world?

You probably can’t save actor references in a save game. We did our save system (4.23) by storing the actors transform and the actors class and spawn them on loading. If you have actors placed in your level (not spawned by player) I would do the same but instead of spawning new actors I would box-trace to get the right actor reference (your ActorList). Hope that helps.

Instead of saving an array of actor references, you need to save an array of class references. You can convert the actor reference by using the GetClass or GetObjectClass function.

Then when you load your save game, use the SpawnActorOfClass function and plug in your class reference and transform

instead of having ActorListGM, you just need a single variable of Actor Class (it should be purple). Then you spawn a new actor at each transform

it should look something like this. Only save the class variable and the array of transforms. You dont need the actor array

This solved it. Thanks a bunch.
Very useful feedback!

You can save actor ref, its just you can’t do anything with it. You can’t save transform or any other data. It will just point to the actor in your map. You can destroy actors and move them and get values, but they will be the current actor values and they will go back after playing again. Every level has an Actor Array which is populated on construct and I think it points to that.

check this. Saving & Loading Your Game In Unreal Engine With C++ - YouTube