Comments (6)
Maybe setting the "Add class as metadata" option is useful for you.
You could then set the class attribute to e.g. "TeleporterEntry" and after import it should show up in the metadata.
Would this be an acceptable solution for you?
Besides that you can always add a custom property e.g. "object_id" and set it to some value to identify it.
Every custom property which is not a godot internal one is added to the metadata.
PS ok, I now have understood the problem, the 3 is coming from Tiled internally.
I have yet to think about that.
from yati.
Ok, I'll implement it in a future release.
In the meantime I see two possible workarounds:
- Change the custom property 'exit' to type string and give it the value 'TeleporterExit'.
or
- Add to TeleporterExit a custom property of name 'object_id' and of type object and link it to itself.
This way a change of the id in Tiled should be automatically be reflected in a change of this value.
from yati.
Ok, I'll implement it in a future release.
Very good, thank you! I have "hacked" a workaround until then. In the beginning of the function handle_object (in TilemapCreator.gd) I remember the object id:
func handle_object(obj: Dictionary, layer_node: Node, tileset: TileSet, offset: Vector2) -> void:
var obj_id = obj.get("id", null)
Further down every time the "class" metadata is set I also set the object id. For instance:
if _add_class_as_metadata and class_string != "":
obj_sprite.set_meta("class", class_string)
if obj_id != null:
obj_sprite.set_meta("id", obj_id)
I'm not remotely sure if that is correct but it works for my use case for now.
Maybe setting the "Add class as metadata" option is useful for you.
This is an indication for me that I might have picked the right places :)
Add to TeleporterExit a custom property of name 'object_id' and of type object and link it to itself.
This way a change of the id in Tiled should be automatically be reflected in a change of this value.
That is very clever! This even works when you copy/paste the object. The property becomes a self reference of the new object.
from yati.
Just released v1.6.2 where I added a new option 'add_id_as_metadata' working similar like 'add_class_as_metadata'.
I choose to guard it by that option because you never know if someone might not like that.
from yati.
Thank you very much! I plan to integrate the new release during this week.
from yati.
Works perfectly for me. The issue can be closed as far as I'm concerned.
from yati.
Related Issues (20)
- godot_node_type and/or res_path are not loaded from property types file. HOT 12
- Godot 4.2 - `TileMap.CellQuadrantSize` got renamed HOT 2
- AstarGrid2D (get_cell_tile_data) does not detect "custom data layer" in Tilset HOT 1
- How do I access raw tile id data? HOT 4
- Error `Can't find file 'uid://byk7emqeyttmh::::res://assets/mytilemap.png'.` HOT 3
- Reimporting multiple maps at once with same tileset results in hundreds to thousands of errors HOT 2
- Add a way to set the TileSet Texture NormalMap Texture and Specular Texture HOT 5
- Maps in projects exported on macOS are lacking collision data HOT 7
- Can't add multiple Tiles Collision Shapes with different physics_layer HOT 3
- Tile Collision Polygons not updating in Godot. HOT 3
- Make runtime loading compatible with threads ? HOT 2
- Need some help for the c# version HOT 1
- Support TileMapLayer nodes from Godot 4.3 HOT 7
- Error when enabling HOT 5
- GDScript Installation fails with Class "CustomTypes" hides a global script class HOT 6
- Option to import TSX files as an external TileSet resource HOT 6
- Custom Properties defined on object tile definitions do not propogate. HOT 4
- add_id_as_metadata does not work on instance items HOT 3
- Runtime package breaks when project is exported HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yati.