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 Defold tilesource path to Defold tilemap export as custom property #4131

Closed
divSelector opened this issue Dec 31, 2024 · 4 comments
Closed
Labels
feature It's a feature, not a bug.

Comments

@divSelector
Copy link

divSelector commented Dec 31, 2024

Is your feature request related to a problem? Please describe.
Every time you export a map as a Defold tilemap, you have to reset its tilesource path in Defold. A tilesource is plaintext file that points to a tileset png and has metadata included on it.

Describe the solution you'd like
This is what an exported Defold tillemap might look like

tile_set: ""
layers {
  id: "ground"
  z: 1e-04
  is_visible: 1
  cell {
    x: 0
    y: 59
    tile: 16
    h_flip: 0
    v_flip: 0
    rotate90: 0
  }

Notice that it includes the tile_set property but it's a blank string.

What I suggest is that you should be able to specify a custom property on the tilemap that will result in

tile_set: "/assets/tilesets/test.tilesource"
layers {
id: "ground"
z: 1.0E-4
cell {
  x: 0
  y: 0
  tile: 16
}
@divSelector divSelector added the feature It's a feature, not a bug. label Dec 31, 2024
@bjorn
Copy link
Member

bjorn commented Dec 31, 2024

Did you try the tile_set property documented at https://doc.mapeditor.org/en/stable/manual/export-defold/ ?

@eishiya
Copy link
Contributor

eishiya commented Dec 31, 2024

Did you try the tile_set property documented at https://doc.mapeditor.org/en/stable/manual/export-defold/ ?

The property is apparently called tilesource, not tile_set ;D

@bjorn
Copy link
Member

bjorn commented Dec 31, 2024

Ah, that depends on which plugin you're using, or are the docs wrong? For the "defoldcollection" it is documented as "tilesource" indeed.

@divSelector
Copy link
Author

divSelector commented Jan 1, 2025

Well, it is a bit ridiculous that I didn't consider the possibility that this feature already existed before posting I suppose. What's even more ridiculous is that I wrote an extension to fire a subprocess that uses sed to put the tilesource filename in there.

But yeah it's a bit weird, the filetype in Defold is a ".tilesource" but the property in the .tilemap file that refers to it is tile_set. Honestly, if you want my opinion as a Defold user, calling the property in Tiled "tilesource" is more intuitive because Defold users call that file a tilesource, not a tile_set, that's just something under the hood in Defold for some reason -- probably just an old decision someone made a long time ago and now is the way it is.

Sorry for bothering you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

3 participants