I’ve searched for countless ways to save game objects to a file in Godot. I see that using var_to_str() in my save function and str_to_var() in my load function both using a FileAccess object allows me to save my custom object node to a text file and subsequently read data from it upon loading it successfully.
I’m afraid to fully implement this further due to the fact that I haven’t seen a single tutorial mention this. This is the only solution that appears to work for me so far and every other solution either fails for me, has security vulnerabilities (malicious code injection to saved resource files), or requires too much set up for my custom game objects (creating dictionaries that contain a reference to each property of a complex custom data type). var_to_str() and str_to_var() seem to be a promising simple way to accomplish my goals.
Is there any reason NOT to use these functions for saving and loading custom game objects to files??