Storing cross-session data

I want to store some custom data on the client (it isn't relevant on the server-side) that my mod can read/write regardless of what save/session is loaded (kind of like mod configuration but that can be updated dynamically). I'm pretty new to Satisfactory modding and Unreal so I'm not sure if or how I can use the built-in mod configuration for this. Having it stored in JSON format would be nice, but is not strictly necessary. Either way, I don't need or want it to be directly editable in-game. Any ideas or guidance? P.S. the data is probably going to end up being pretty complex (arrays of structs or similar) so I don't think just pre-generated config properties would work, at least not as I currently understand it.
19 Replies
Robb
Robb2w ago
can you share some more info on what kind of things would be in the data, and why you specifically do NOT want it to be kept separate per save file? it should be possible to use the mod config system for this (you can have config properties hidden so they can't be edited)
Rex
Rex2w ago
I made Digby's Flashlight Settings mod use mod configs to store all the settings. This way the settings are per-player and save-agnostic, which is also good for MP compatibility
TrollyLoki
TrollyLokiOP2w ago
What Rex said is pretty much the same thing I'm trying to achieve I think my main problem is that the documentation on mod configs is pretty outdated and feels incomplete so I don't know how to do things like dynamically adding properties to an array in the config
Rex
Rex2w ago
Please elaborate further, I have no idea what your use-case is Without understanding your use-case I can only respond with "perhaps" or "try it and see", both of which are not particularly helpful...
TrollyLoki
TrollyLokiOP2w ago
I'm trying to implement setting presets basically Take that flashlight mod for example, and imagine you could save the current state of the settings as a preset and then there would be a dropdown or something in the corner so you could easily switch between the various presets you've made Similar to the color presets in the base game but for multiple things at once
Rex
Rex2w ago
You might as well save/load JSON files inside a subfolder in Saved/Configs
TrollyLoki
TrollyLokiOP2w ago
I was considering that as an alternative to abusing the mod config stuff, but I honestly have no idea where to start with doing something like that in Unreal Is there any JSON functions available separate from the mod config API?
Rex
Rex2w ago
UE has its own JSON library
Robb
Robb2w ago
I think UE5 comes with some json utils out of the box now, but only on the C++ side Ficsit Remote Monitoring uses them if I recall correctly
Rex
Rex2w ago
Ficsit Remote Monitoring has quite a bit of JSON stuff, yes I think it's mostly serialising to JSON but it should be a good starting point
TrollyLoki
TrollyLokiOP2w ago
Ah that would make sense cause I couldn't find anything useful in the blueprint functions I'll look into that Assuming that works I guess the only other Satisfactory-specific thing is is there a good way to get the path to the configs folder?
Rex
Rex2w ago
The answer to that is to look at what SML does to get the mod configs Since you want to do the same but inside a subfolder
Robb
Robb2w ago
if you don't want to deal with doing the file I/o yourself, you could stringify the json and put it in a normal SML config string option
Rex
Rex2w ago
:interesting: shudders at the mere thought of that idea
TrollyLoki
TrollyLokiOP2w ago
Looks like the ConfigManager subsystem class provides a static method that returns the path to the "Configs" folder I imagine that shouldn't be too hard to use I really gotta brush up on my C++ though lol
Rex
Rex2w ago
git gud :wonke:
FICSIT-Fred
FICSIT-Fred2w ago
git: 'gud' is not a git command. See 'git --help' -# Responding to gitgud triggered by @Rex
Rex
Rex2w ago
Happy to help with C++ traumas questions :happyko:
DarthPorisius
DarthPorisius2w ago
As far as finding out how FRM uses JSON, I suggest looking into the repo for what you may need. If you have any questions, feel free to ask me or reach out to those on the FRM Discord.

Did you find this page helpful?