Utility for saving and loading painted terrain cells on TileMapLayer nodes. Terrain paint data (set via [method TileMapLayer.set_cells_terrain_connect]) is ephemeral — it lives only on the live TileMapLayer and is lost on scene reload. This class provides [method save_terrain] and [method load_terrain] to serialize/deserialize terrain cell data so painted terrain survives across sessions. Each cell record captures (cell, terrain_set, terrain) — the three values needed to restore via [method TileMapLayer.set_cells_terrain_connect]. The TileSet is assumed to be the same resource used at paint time; terrain indices are scoped to that TileSet. Usage: # Save TerrainPersistence.save_terrain(tile_map, "user://terrain_save.res") # Load TerrainPersistence.load_terrain(tile_map, "user://terrain_save.res")
Source: addons/grid_placement/placement/terrain/terrain_persistence.gd
Syntax
class TerrainPersistence extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
save_terrain | Method | |
save_data | Property | |
tile_data | Property | |
terrain_set | Property | |
terrain | Property | |
result | Property | |
load_terrain | Method | |
loaded | Property | |
save_data | Property | |
save_all_terrain | Method | |
save_data | Property | |
layer_path | Property | |
tile_data | Property | |
terrain_set | Property | |
result | Property | |
load_all_terrain | Method | |
loaded | Property | |
save_data | Property | |
map_by_path | Property | |
cells_by_layer | Property | |
unlayered_cells | Property | |
target_map | Property | |
fallback_map | Property | |
groups | Property | |
key | Property | |
group | Property |
Source
addons/grid_placement/placement/terrain/terrain_persistence.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs