Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta dictionary to individual tiles #23714

Closed
wants to merge 3 commits into from
Closed

Add meta dictionary to individual tiles #23714

wants to merge 3 commits into from

Conversation

Lucrecious
Copy link

@Lucrecious Lucrecious commented Nov 15, 2018

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) -> Dictionary

Gets the value associated with the tile id and key in the meta properties of the tile
tile_get_meta_property(id : int, key : Variant) -> Variant

Sets 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) -> void

Bugsquad edit: Fixes #12634.

@aaronfranke
Copy link
Member

Is this related to #18591 ?

@Lucrecious
Copy link
Author

@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).

@aaronfranke
Copy link
Member

To avoid confusion, perhaps it shouldn't contain the word "meta". Why not "tile property dictionary"?

@Lucrecious
Copy link
Author

That's a fair point - although, I'll mostly be making these changes after 3.1 has been released :)

@akien-mga
Copy link
Member

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.

@akien-mga
Copy link
Member

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.

@akien-mga akien-mga modified the milestones: 3.2, 4.0 Oct 4, 2019
@Lucrecious
Copy link
Author

Closed since #23864 seems like a good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Giving tiles a property dictionary
5 participants