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 compatibility with tiled 1.9 #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cromerc
Copy link

@cromerc cromerc commented Jul 13, 2022

This PR adds compatibility with tiled 1.9. A major breaking change is that they changed the type attribute to now be called class.

I left the old type attribute in for now so that it should work with both 1.8 and 1.9.

This fixes the issue #157.

@bitbrain
Copy link

bitbrain commented Jul 19, 2022

I created a setup like this in 1.9 (custom class with object attributes):

Capture

but currently get these errors when loading the tilemap:

 Missing information in custom properties (around line 0).
 res://addons/vnen.tiled_importer/tiled_xml_to_dict.gd:291 - Invalid get index 'properties' (on base: 'int').
 res://addons/vnen.tiled_importer/tiled_map_reader.gd:1151 - Invalid get index 'y' (on base: 'Nil').
 res://addons/vnen.tiled_importer/tiled_map_reader.gd:1151 - Invalid get index 'y' (on base: 'Nil').
 res://addons/vnen.tiled_importer/tiled_map_reader.gd:1151 - Invalid get index 'y' (on base: 'Nil').
 res://addons/vnen.tiled_importer/tiled_map_reader.gd:366 - Invalid operands 'String' and 'Nil' in operator 'in'

Another thing to consider is how we want to store this information of child attributes (those can then again have child attributes in a cascading manner) within Godot. One way could be to create a child node of type Node and configure meta information on those.

@cromerc
Copy link
Author

cromerc commented Jul 19, 2022

Do you have a demo project I can use to debug the issue?

@bitbrain
Copy link

@cromerc there you go. It contains a simple class that contains another class as an attribute. That class then has a bunch of objects it references in the world.

tiled-1.9-demo-project.zip

@cromerc
Copy link
Author

cromerc commented Jul 22, 2022

I just did some testing, and those errors also appear when using 1.8.6 of tiled as well. So this PR and the 1.9 changes have nothing to do with your problem and should be a separate issue.

Please open a separate issue with your problem to keep this PR clean, and I will try to see what is causing the error once I get a chance.

@bitbrain
Copy link

Created #161 on the back of that!

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

Successfully merging this pull request may close these issues.

None yet

2 participants