Portponky / better-terrain

Terrain plugin for Godot 4
The Unlicense
433 stars 21 forks source link

Detecting decorations? #53

Closed hunterloftis closed 8 months ago

hunterloftis commented 8 months ago

Is there a way to detect whether or not a decoration has been placed? For example:

  1. Given a tree_base tile and a decoration tile that represents the tree-top, peered to N of tree_base
  2. Randomly drawing tree_base tiles (programmatically), which also decorates them
  3. Randomly drawing other tiles, like rock, after first checking that neither a tile nor a decoration is in the target cell

It seems like get_cell returns -1 for decorations, as if they were empty. Is there an alternative way to query the state of the cell that would disambiguate between "empty" and "decorated?"

hunterloftis commented 8 months ago

Closing as this can be trivially worked around by querying the TileMap directly via get_cell_source_id (looking for -1, which is "really empty")