As far as maps/arrays go, I’m only seeing it done in the demo on the Game Instance. I’ve simplified and removed the save world. The GUID is Generated on the MainCharacter. but it contains several structs/arrays/maps/etc. The position of the character is loading fine. but nothing else.
You can remove all that and just use “Save Game Mode” and “Load Game Mode” nodes, if that character is player character.
You have to make sure your generated Guid is always the same, you can log to test that.
Properties are only saved when they are marked with the “Save Game” checkbox on the Blueprint.
If you are trying to save custom structure properties that contain refences to objects, that is not supported;
The “container” to refences of objects must be an Actor/Object, not a Struct, if you want them to load correctly.
If you have a inventory system that contains references to weapon actors, that is a very different setup than what you do in these screenshots.
For something like that you would use “Save Actor Hierarchy” and “Load Actor Hierarchy by GUID” nodes, depending on how your inventory based on Actors was built.
There’s a list of plugin functions here:
Would I need to specify each of those actors to have their own Generated GUID?
You’re a boss and I figured it out, thank you.
The plugin can be a bit confusing at first, because it’s built in a way to provide you with an API for you to build your own save rules based on particular needs of your project.
Once you figure out the way the nodes work, it’s very quick to use those nodes to fit the unique way you are building your game, instead of forcing you to make drastic changes to your game or forcing you to go into C++ to achieve your goals.
There are several different ways some game feature can be built, so to save a class, it all is relative to how that class was built;
This is why there are so many nodes that seem to do similar things, but they are just trying to serve different types of games.
Keep in mind that you can also turn on “Debug” and “Deep Logs” on your slots (advanced drop-down list) and the save system will communicate in output log panel what it is doing, so you can observe if it is not the behavior you expect when saving and loading data to disk.
Correction, mostly got it. struggling with one of the actors. but, progress. still thank you
Maybe I could get some insight, in my save and load I took my map and converted it to a Struct array that holds 2 values the Struct for the Equipment and the Actor.
When looping over after loading, the Struct inside of the struct. is loading correctly, the Actor on the other hand is not loading anything.
BP_MasterArmor is the actor that is being saved inside of the struct, this actor is a child of another actor, however I assigned the SGUID to the top level and the procedural interface.
(Sorry for the pestering, I’m an indie dev with a rather large project here haha)
As I said before, the plugin cannot load Actor references into instances of a Struct.
If you absolutely need it that way, you should make a Struct of Soft Actor References instead, because soft references are stored as value, not pointers.
The plugin actually knows that SaveArmorInfo has a reference to an object, but it won’t do what you want because it is forbidden, your engine would crash.
Your Struct should instead store a Soft Object Reference to that object.
So i’m using a soft actor reference now and it’s not saving still. I have a debug, when I hit the P key to Save and then Press M it shows the correct output. but the moment I load and press M it’s gone.
I can only guess the actors are not spawned when you try to load?!
“Load Actor Hierarchy” nodes do not respawn dead/gone actors.
If they are there, then they have no SGuid.
maybe I can get away with a class reference… no cigar, same results. I’m just using the “Class Defaults” now
Email me a screeshot of the blueprint actor you are trying to save, and a copy of the save file.
So I can take a look later.
If you can send a zipped level for me to inspect is better.
This kind of problem is usually something missing or slot configuration of Scopes is wrong, etc.
after setting it to soft class array, I’m getting an error stating that it can’t parse the default value for an enumerator… thinking it could have something to do with that. is there a preferred email?
You can get email address on marketplace page or from Editor’s Plugins panel.
I think your slots are just not configured to save the classes you want to save, in Scope lists.
Doing a spawn actor seems to have fixed it. … all besides the helmet slot… xD which is slot 0.
The way “professional” studios do things like this, usually for RPG or MMOs, is they keep a struct containing a series of enums to indicate body parts equipped by the character.
Th enum can be converted to a single byte value, so it is cheap to store into a data base or a save file and is easier to work with.
Inventory systems that store references to equipped objects have to keep a path to all these possible objects, more complicated to save and saved data also eat a lot of unnecessary space.
Thats “Kind of” what I have as well. but I use actors for the type of object being equipped so I can create new types of armor by making them children of armor types. I’m not sure how to get around that one I guess other than spawning default class values aha. which. is what I did here.
project started crashing, I limited the save slot to 1 component and 2 of my actors.
calling save actor hierarchy and getting Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectGlobals.cpp] [Line: 2262] Object is not packaged: MetaSlot SlotMeta
Edit: fixed itself after like 30 crashes and 20 deleted save files… would like to know what caused it though… also. in order to load Spawned actors in the world how would I do that without calling Load World?
I have no idea about that crash without a call stack.
To load spawned actors without the load world node, you have to keep a list of guids to save, then you manually respawn them before loading each actor’s properties from target slot. That’s what the Load World node does.
Do you have an example of this being done? I’ve been attempting to add actor GUID to an array, calling my save functions and it will re-iterate the SGUID back to me with debugging, but when I call find actor with GUID and spawn actor. it doesn’t seem to like this. I would use load world, but I’m also using a voxel plugin which I have a loading system for on that as well and when I call load world it re-calls voxel loading. Pain in the rear end.