How to sync TArray elements value between editor and runtime

Hi I have subclass of USaveGame; Inside I have declared UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = “Settings”)
TArrayHDRIArray; Now if add elements to array at runtime they don’t show in editor mode. So for example the array is still showing with zero elements. But at runtime the data is there . Is there a way to be able to sync this somehow with editor utility or scripting or force it with console command? Thanks in advance for your reply.

What are you looking at in the Editor? The editor deals with ini and uasset files. I’m guessing your looking at the blueprint of your USaveGame child class. Are you looking at it while PIE is running? You might not have the debug instance selected in the upper-right of the blueprint. If PIE isn’t running, then I wouldn’t expect you to be able to see anything. I’ve never heard of an editor utility for inspecting save games.

Yes I am looking at USaveGame blueprint child class. So basically you are saying there is no way of having access to the elements of the array in editor despite they exist at runtime? I would like to be able to see how many element are there and edit them in editor and equally at runtime. I don’t understand what you mean with debug instance selected.

Yeah, that’s not a thing. At least not by default, you’d have to write custom tools for that.

Savegames are for the game, not the editor. So they should only be relevant when PIE is running (or you’re running a non-editor version of the game of course). You can debug and inspect your savegame while your game is running but you can’t treat it as another asset type that you can just edit however you like.

Thank you for the reply. If savegame is not designed for editor but game only, is there any other data type within Unreal(or plugin) that supports persistent data between sessions and can both be edited at runtime or editor?

You could maybe use a custom ini file to save out information for editor use

Anything that you can edit in the editor has to be, by definition, session agnostic.

At best, you could use ini’s for some user data but that’s usually at the application level, settings and whatnot. What you’re editing in the editor are more like default values though. But nothing session specific. That’s stored in a save game and loaded by the game when needed. If you’re doing MP, maybe you have a database or something that you could edit while the game’s not running but again if you want to edit that from the editor it’s probably a custom tool.

If it is just a one-time thing that you need to do, you can store the runtime values in an Actor instance, pause the simulation, select the actor, and sync its runtime values back to default (blueprint).

image

I think you need an Actor because I’m not sure if it is possible to select an object like this. But if you know how, then it could work too.