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
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)
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
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
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...
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
You might as well save/load JSON files inside a subfolder in Saved/Configs
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?
UE has its own JSON library
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
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
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?
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
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
:interesting:
shudders at the mere thought of that idea
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
git gud :wonke:
git: 'gud' is not a git command. See 'git --help'
-# Responding to gitgud triggered by @RexHappy to help with C++ traumas questions :happyko:
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.