The way I do it, is that I have "custom variables" which are just types with a name and a value field... And I have another flag that indicates wheter the custom var is saveable, and one that indicates that it should be deleted after saving (and also after loading, after I did the right things with them).
That way I can loop trough my cvars and write the name/values of the saveable ones to a file easily.
Basically the same principle as the arrays in the post above, but having names instead of numbers makes it a bit simpler to me.
That way I can loop trough my cvars and write the name/values of the saveable ones to a file easily.
Basically the same principle as the arrays in the post above, but having names instead of numbers makes it a bit simpler to me.