Kiamo2 / YATI

Addon to import Tiled maps into Godot 4
MIT License
141 stars 18 forks source link

Trouble setting up plugin #23

Closed MythgardStudios closed 11 months ago

MythgardStudios commented 12 months ago

Hello there, I am contacting you because I am having trouble getting the plugin installed correctly into Godot 4.1.2. Myself and another collaborator have attempted but seem to be unable to get the plugin functioning like intended. We have followed you instructions and also searched for solutions online. i hate to ask, but you provide a simple step by step explanation of how to correctly install the plugin and what save format we should use to make sure all of our tilesets and tilemaps transfer into Godot? I really appreciate the help. thanks

Mythgard Studios

Kiamo2 commented 12 months ago

The (tiled) save format should be no issue, both formats (.tmx and .tmj) are supported. Please be a bit more specific about your problem

MythgardStudios commented 12 months ago

So I am using the GDscript version. Sorry for not explaining that part. When i go into Project settings>plugins. it does not show up to enable. So i guess thats where my first error is occurring.

MythgardStudios commented 12 months ago

Okay so i got the plugin to show up withing the project settings area, i put the map and its used tilesets in the godot project folder. i reloaded the project, but i didnt see anything different besides a red X being beside the tiled map.

MythgardStudios commented 12 months ago

res://addons/YATI/TilemapCreator.gd:152 - Invalid call. Nonexistent function 'sort_custom' in base 'Nil'. Error importing 'res://test tiled yati plugin.tmx'.

Kiamo2 commented 12 months ago

Hmm, ok, I suspect that the function tileset_creator.get_registered_atlas_sources() returned nothing. Despite the fact that this error could be handled better, there must be some quite unusual condition in your Tiled design. I was not able to reproduce such a behaviour. Would it be possible for you to zip the Godot project and append it here?

MythgardStudios commented 12 months ago

well i got it working then it broke again, ill sed you what i have, ive tested a lot of possible issues, but im not sure why it works one second then refuses the next, if you do find out what im doing wrong let me know. I had to start a brand new project to get the plugin to function correctly, and the file im sending you will be that exact project that is breaking now. I do appreciate the help. Its an awesome plugin. Sending Zip next

MythgardStudios commented 12 months ago

Tiled Yati Test.zip

Kiamo2 commented 12 months ago

The Tiled design inside the Godot project turned out to be inconsistent i.e. several .tsx files and .png files were wrongly located. As soon as I loaded RoM.tmx into Tiled it looked like this: RoM_loaded_into_Tiled

Please note that for all files Tiled is using their names and (mostly relative) paths are stored inside the .tmx and .tsx files. (You can see that by loading .tmx or .tsx files into a text editor, paths can be found at the beginning of the file) -> If you copy a Tiled project to another location better keep it's directory and file structure. Luckily that can be repaired inside Tiled by relocating the missing resources.

And that's what I've done.

  1. First I shifted all .tsx files into the (empty) folder 'Tsx Files' and all .png files into folder 'Png Files' to clean up
  2. I restarted Tiled and loaded RoM.tmx
  3. I relocated all references by clicking through the missing messages and using 'Locate...' (right at the bottom)
  4. I saved all changed files.

After that the project imported smoothly into Godot. Appended is the repaired Project. Tiled Yati Test (repaired).zip

Kiamo2 commented 11 months ago

Since no further comments were made, the issue appears resolved.