Open al0fdf opened 2 years ago
The main problem is that class-specific information is only stored within the .tiled-project file which currently is not parsed anywhere. As a result, this plugin is unable to set the default values for those. I'd actually expect us not to parse the .tiled-project file but rather on tiled map export, those class default values being auto-populated inside the templates and objects, however, this is currently not the case.
This seems to be indeed a bug within the Tiled editor itself: https://github.com/mapeditor/tiled/issues/3411
The only workaround for this is to manually set the attributes on each node, unfortunately.
This seems to be indeed a bug within the Tiled editor itself: mapeditor/tiled#3411
The linked bug is only about properties that are classes, Tiled doesn't correctly resolve their members, plain custom properties like the ones in OP's example are correctly resolved with the resolve properties export option in Tiled. The issue in this thread is unrelated.
However, OP mentioned the "type" on the object is null
- could this perhaps be related to the change from "type" to "class" in 1.9? Is the importer perhaps looking for the "type" attribute that no longer exists? Try setting the 1.8 compatibility mode in the project settings in Tiled, and see if saving the files with that enabled helps. (Though their screenshots seem to be from 1.8 or earlier, so maybe that's not it.)
Lastly, the class (type) information can be exported into JSON and XML files that work the same as objecttypes.xml did in older versions, as well, so if someone wanted to extend the importer to support default values, parsing the entire project is not necessary.
Plugin version Tiled Map Importer v2.4 Godot v3.4.stable.official
206ba70f4
Plugin downloaded from githubIssue description Default or "unmodified" properties from Tiled (ones that are grey) are not imported, showing
Null
Steps to reproduce
Specify a new object type. View->Object Types Editor
Use the object type in a tileset.
Create an object out of that tile (use
Insert Tile
on an object layer)When trying to import level in Godot, the "type" property of the object is
null
When going into the map file and adding and removing a space to make to property no longer grey, the property is imported.
Sample map or tileset
.zip
file containstest-map.tmx
,test-tileset.tsx
,game.gd
andobjecttypes.xml
reproCase.zip