Chris' Tutorials
Docs/Grid Placement

Class

TerrainSaveData

Generated GDScript class reference for GridPlacement.TerrainSaveData.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.

Resource holding serialized terrain cell data for a TileMapLayer. Each entry in [member terrain_cells] records one painted cell: {"x": int, "y": int, "terrain_set": int, "terrain": int, "layer": String (optional)} The on-disk shape is the dictionary form for backward compatibility with saves produced by . New save/load helpers in [TerrainPersistence] convert between the dictionary wire shape and the typed [TerrainCellRecord] view used at runtime. Usage: [codeblock] var data = TerrainSaveData.new() data.add_cell(Vector2i(3, 4), 0, 1) ResourceSaver.save(data, "user://terrain_save.res") [/codeblock]

Source: addons/grid_placement/placement/terrain/terrain_save_data.gd

Syntax

class TerrainSaveData extends Resource

Members

NameKindSummary
cellPropertyTyped read-only view of one painted cell record. The save format remains dictionary-based for backward compatibility, but the persistence code now exposes this typed record so callers do not thread [code]entry.get("x", 0)[/code] reads through the codebase.
terrain_setProperty
terrainProperty
layerProperty
terrain_cellsPropertyArray of cell records. Each dictionary has keys: - "x" (int) — cell x coordinate - "y" (int) — cell y coordinate - "terrain_set" (int) — terrain set index in the TileSet - "terrain" (int) — terrain index within the terrain set - "layer" (String, optional) — source TileMapLayer node path
source_layer_pathPropertyTileMapLayer path (from the scene root) that these cells belong to. Stored for documentation / validation; not required for load.
format_versionPropertySave-format version for forward-compat. Increment this when the cell-record shape changes so loaders can branch on it. The wire shape remains the dictionary form so pre-v1 saves still load.
add_cellMethod
entryProperty
as_typed_recordsMethod
typedProperty
recProperty
get_cell_countMethod
is_emptyMethod
clearMethod

Source

addons/grid_placement/placement/terrain/terrain_save_data.gd

Plugin docs root:gdscript/plugins/grid_placement_dev/docs