Kiamo2/YATI

Failed to import a tiled map after installation

Closed this issue · 5 comments

Describe the bug
Unable to import a simple tiled map.

To Reproduce
Steps to reproduce the behavior:

  1. Install YATI to addons/YATI
  2. Copy map_tiles.tsx to asset/maps/test
  3. Drag/drop map.tmx to asset/maps/test
  4. Double-click asset/maps/test.tmx

Expected behavior
Map is opened or a scene is created.

Actual behavior
The tmx map shows up, and sometimes an incomplete scene shows up. The incomplete scene doesn't render the tiles at all. The following output is shown:
importing
Import file 'res://asset/maps/dev/test.tmx'
ERROR: Image file '../Tiles/building_center_N.png' not found.
res://addons/YATI/TilesetCreator.gd:274 - Attempt to call function 'get_width' in base 'null instance' on a null instance.
Import finished with 1 error.
opening
No loader found for resource: res://.godot/imported/test.tmx-c64eac05962bf4aafb175d31b1bd83da.tscn.
Failed loading resource: res://asset/maps/dev/test.tmx. Make sure resources have been imported by opening the project in the editor at least once.
editor/editor_node.cpp:1270 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Version 10
  • Godot Version 4.0.2
  • Tiled Version 1.9.2

Examle map (zipped)
example.zip

Additional context
Add any other context about the problem here.

Kiamo2 commented

According to the error message the image file 'building_center_N.png' is not found where it's supposed to be.
This file (and all other .png files) must be INSIDE the Godot project.
See also usage pt#2 "Please check: Tiled editor should seamlessly work inside your project i.e. all its references must be ok"
I've lookeed into the .tsx file (this is a readable text file) and there are lots of file references like '../Tiles/builing_center_N.png'
As ../Tiles is a relative path seen from the perspective of the .tsx and the .tsx is located in 'res://asset/maps/dev' the image files are expected in a folder "Tiles" parallel to the folder "dev" i.e. 'res://asset/maps/Tiles'.
Please ensure that this folder exists and contains all 244 image files.

And please don't double click on the .tmx. This won't work in Godot4.
The import (if running successfully) should create a file 'test.tscn' and this can be double clicked on.

Thanks for the comment, I'm able to import the tmx file without errors being reported in the console. It appears that all the tiles, layers and objects made their way into godot, but the actual tilemaps aren't rendering. Attached is the imported map and a screenshot of the edit. I don't know anything about the tiled map support that godot has, so I don't really know what to expect on that. I thought maybe it was the overlapping tilemap layers I had, test.tmx has layers and test_cpy.tmx only has one. They both don't work. Is there any chance you could take a look?

editor_screenshot
example.zip

Kiamo2 commented

Yes, with the full example I can reproduce the problem(s) and I will investigate this further.
(Interestingly, I also get error messages).

Kiamo2 commented

The latest release 1.2.4 (hopefully) fixes the problem.
After updating the plugin files and starting Godot

  • please reimport by selecting the .tmx files + the choose the Import Tab (top left side) and press 'Reimport' (left side)
  • Force reloading e.g. by minimizing and maximizing the Godot window and confirm the reload proposal with OK
Kiamo2 commented

Issue closed upon no further questions or objections so far.