Describe the problem or limitation you are having in your project
I've made a super convenient script that handles saving and loading via node paths. If I input the node path "World/Tilemap:position", then the position of the tilemap will automatically get saved and loaded, no extra code needed! The issue with this is I can only save / load data that is exposed to GDScript, and it currently seems that the layers of a tilemap are not exposed.
Inspecting the .tscn of a file containing a tilemap in a text editor reveals a list of PackedInt32Arrays containing all the tile data for each layer, this is what I would like access to in GDScript.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a tilemap.raw_data variable which returns the array of PackedInt32Arrays that represents the raw data of the tilemap. The user can get and set this like usual, and setting this variable would update the tilemap internals
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Expose tilemap.raw_data which simply returns the raw data that the tilemap uses, as seen in the .tscn of a scene containing a tilemap.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Nope, can't currently access this data
Is there a reason why this should be core and not an add-on in the asset library?
Describe the project you are working on
A metroidvania game
Describe the problem or limitation you are having in your project
I've made a super convenient script that handles saving and loading via node paths. If I input the node path "World/Tilemap:position", then the position of the tilemap will automatically get saved and loaded, no extra code needed! The issue with this is I can only save / load data that is exposed to GDScript, and it currently seems that the layers of a tilemap are not exposed.
Inspecting the .tscn of a file containing a tilemap in a text editor reveals a list of PackedInt32Arrays containing all the tile data for each layer, this is what I would like access to in GDScript.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a tilemap.raw_data variable which returns the array of PackedInt32Arrays that represents the raw data of the tilemap. The user can get and set this like usual, and setting this variable would update the tilemap internals
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Expose tilemap.raw_data which simply returns the raw data that the tilemap uses, as seen in the .tscn of a scene containing a tilemap.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Nope, can't currently access this data
Is there a reason why this should be core and not an add-on in the asset library?
Tilemaps are core