timbaker / tiled

Tiled is a generic tile map editor
http://mapeditor.org/
Other
16 stars 4 forks source link

Errors with Tilesets.txt file on Linux #5

Open Faalagorn opened 1 year ago

Faalagorn commented 1 year ago

After running application after compilation, it can't find the Tileset.txt file that's in the root location of the program. It expects it in tiled/bin/../share/tilezed/config/ instead. However, when copying the file there, it still doesn't launch as it have trouble renaming the file even if it seems to be successfully copied to ~/.TileZed/:

Here's the error displayed:

Error renaming file! From: To: /home/faalagorn/.TileZed/Tilesets.txt

Invalid cross-device link (while reading Tilesets.txt)

Distro: Arch Linux (rolling)

Faalagorn commented 1 year ago

I guess it might be an issue with some functions in cmake or the code itself with moving functions on a different OS/file system. I use F2FS.

CMakeLists.txt:106:file( COPY TileProperties.txt Tilesets.txt DESTINATION ${CMAKE_BINARY_DIR}/Debug )
CMakeLists.txt:107:file( COPY TileProperties.txt Tilesets.txt DESTINATION ${CMAKE_BINARY_DIR}/Release )
CMakeLists.txt:108:install(FILES TileProperties.txt Tilesets.txt DESTINATION .)
timbaker commented 1 year ago

I changed it to call QTemporaryFile::copy() if calling QTemporaryFile::rename() fails.

Faalagorn commented 1 year ago

Thanks! I totally forgot that the #3 existed with the same solution, yours being the cleaner one. I'm compiling now to see if it works and will close the issue if it does!

Faalagorn commented 1 year ago

Hm, compiling the most recent build didn't change anything for me, renaming all the instances of rename to copy did allow it to not show this error, but it did show this now, and copying the file from the Windows version to .TileZed/, tiled/ and tiled/bin/ still results in the software apparently not seeing it?

screenshot_2023-05-14-221839

BTW, keep in mind that this is all on the same filesystem, parition and drive.

Faalagorn commented 1 year ago

Okay, I finally got it to work by copying the TMXConfig.txt as well as BuildingTiles.txt, BuildingTemplates.txt and BuildingFurniture.txt files from Steam's PZ modding tools windows version to the config folder in /home/faalagorn/Git/github/tiled/share/tilezed/config/ and it seems to at least launch now, though it's clearly something wrong with copying files under Linux :thinking: (though I have no idea where to take them without Windows version; are these supposed to be generated by the software?)

timbaker commented 1 year ago

Those files are in tiled\src\tiled\BuildingEditor.

Faalagorn commented 1 year ago

Those files are in tiled\src\tiled\BuildingEditor.

Thanks! So now just to figure out while they aren't copied properly for me… I'll have a deeper look someday, at seems I had to modify the code and copy the files over, but at least I could get it working now, it seems that the icons in #6 are the same as with Windows version.

TerminalHash commented 7 months ago

In terminal: QFile::copy: Empty or null file name

It moves files, but it keeps giving this error. Void Linux distro.

image

TerminalHash commented 7 months ago

Why not check the directory itself for configs instead of copying them all time?

Xeraster commented 4 months ago

It's broken for me too. I'm on Arch. Is Faalagorn's "fix" still working for anyone? I tried to retrace his steps but I still can't get it to stop giving me that "Invalid cross-device link" error.

Does anyone know what he was talking about when saying he changed "rename" to "copy"? In what source files did he do that?

Xeraster commented 4 months ago

So I commented out "return false" in bool MainWindow::InitConfigFiles() in the file "mainwindow.cpp" in every code block containing the string "It's no good, Jim" and then manually ensured that all the same config files from 3 years ago when this program used to work on my machine were in my config directory. After pressing ok to ignore like 5 error messages, I seem to be able to open tmx files, view project zomboid assets, place project zomboid assets and when I save my map and reload it, it's still there. I have no idea if this will allow the program to work well enough to make an entire map or not as this is an incredibly dumb hack.

Xeraster commented 4 months ago

Nope, building editor doesn't work. Damn. If I attempt further hacks, I guess I'll start replacing that buggy qt string stuff with std strings, idk.

The golden ticket here would be if someone discovers a way to replace all the borked file path load stuff with hardcoded values, then at least anyone wanting to use this on something besides Ubuntu 20.04 could just modify the source code before compiling to point to the correct files.