Add meta dictionary to individual tiles - #23714
Conversation
|
Is this related to #18591 ? |
|
@aaronfranke no, individual tiles on a tileset are not objects, so they don't have the capabilities of having a dictionary for meta values. this would be used if, for example, you want textured tiles (say grass sounds play on grass tiles and dirt sounds on dirt tiles). |
|
To avoid confusion, perhaps it shouldn't contain the word "meta". Why not "tile property dictionary"? |
|
That's a fair point - although, I'll mostly be making these changes after 3.1 has been released :) |
|
This addresses #12634, but as mentioned there without a way to set properties from the TileSet editor this is not so useful. If it's only available programmatically then one can just as well define a Dictionary property in the TileSet's script to achieve the same result. That's why the similar PR #3089 by @neikeq was not merged back then as it seemed unsatisfactory to have a proper tile property system. |
|
I guess #23864 might be a more comprehensive approach that addresses the issue mentioned above. It hasn't been thoroughly reviewed nor merged yet, though. |
|
Closed since #23864 seems like a good solution. |
A simple way of adding properties to individual tiles in a TileSet.
This isn't finished, mostly just a simple proof of concept.
Here is the current state of things:
Gets a copy of the meta properties associated with the given tile id
tile_get_meta_properties(id : int) -> DictionaryGets the value associated with the tile id and key in the meta properties of the tile
tile_get_meta_property(id : int, key : Variant) -> VariantSets a value to the given key in the meta dictionary associated with the tile id
tile_set_meta_property(id : int, key : Variant, value : Variant) -> voidBugsquad edit: Fixes #12634.