Godot Version
4.3 Stable
Question
How do I modify an explicitly declared variable’s properties from within an instanced class?
For example, consider the following:
I would like to use ResourceSaver to save the variables, ‘name’ and ‘data’, to a .TRES file. However, ResourceSaver will only save @exported variables.
While I can @export ‘name’ because it’s a String, I cannot export Variants. In any case, I’m not trying to edit the contents of these variables in the editor. I’m trying to store them to an external file.
So I want to modify the ‘usage’ property of these variables to be PROPERTY_USAGE_STORAGE.
I have referred to the documentation, however it only seems possible to append new properties and not edit existing ones. Or rather, if there is a way to override the _set(), _get(), and _get_property_list() methods to achieve this I have not figured out how.
Any insight into this matter would be greatly appreciated!