Save structure in blueprint?

Hello, I’ve created a blueprint struct with various game data variables. Below shows a number of facial setups for characters.

I then made a scene with on screen buttons and sliders so we can visually edit those game variables while seeing the characters faces.

My problem: I can’t figure out how to save the modded variables back to the structure? I don’t want to use save games, because it’s just internal data used for the game. So how can I make the modded data actually get saved back to the blueprint structure above (so if you were to look at that structure, you’d see the changed data)?

Thanks!

Long story short, you can’t, using only blueprints, with the supplied nodes from Epic. There are many reasons for this, but the main one is, there is no way to “write” back to disk.

A structure should be thought of, well, as exactly what it is, a structure, just a set of data that one can group together with a name (i.e. the name of the structure), it’s nothing more nor less, and as it appears to be “typed” differently than the rest of the system (i.e. try casting that structure to something else, so it appears to be a “object type” that has no parent). As there is no inherent abilities to write to disk (assuming “disk” analytics would work, then a way could be cobbled together, but so far, I’ve only got error messages from that, as the Editor cannot find some DLL’s at startup), then the structure, is just a variable with no parent, and cannot be used to write to disk.

If you roll your own C++ code, then you could create a “node” for blueprints in order to have this functionality. Also you may wish to check Rama’s free library here in the Wiki to see if it has that.

Hope this helps,

I just find it strange that you can easily read a user generated struct but can’t write back to it.

I’m cool with a c++ node, but I’d have no where to begin, as it automatically reads your struct data from the variable (there’s no node needed to read it), so there’s no ‘load struct’ node I can look at for reference.

Rama has nothing of the sort. Maybe I can just use my editor to display the values, then enter them manually into the struct.

It’s a shame, as this functionality is Perfect for making in-engine editors for internal use.

You can do that just fine and pretty easily. All you have to do is get the struct and set members in it and done.

Like this:

To select which members of the struct you want to change, just click on the “set members…” node and on the left side in it’s detail pannel you will be able to select the pins of the variables you want to expose as input. Then you just plug your new variable in it and it will save it to the struct without losing any other variables that are already in the struct.

What this node basically does is internally transfer all the data from the struct to a new version of it except for the variables you changed, those are then integrated into the “newly” formed struct and thus using this node you are able to push updates to a struct very easily.

In our project we use this fo all our customisation and saving, including game options. Everything is updated on the go, exactly the way you want.

1 Like

I didn’t see this, but I’m grateful I just found it. It’s amazing and works just fine. Thanks for this!

THANK YOU SO MUCH !!!