Do you want to work on this issue?
You can request for a bounty in order to promote it!
TileMap.autoMap() does not have a default search path, and/or could be helped by tiled.scriptPath #3485
juanitogan posted onGitHub
Is your feature request related to a problem? Please describe.
TileMap.autoMap()
is difficult to use for creating extensions. It does not say what its default path is, but it appears to be tiled.applicationDirPath
. This is not helpful to any use case.
Describe the solution you'd like
When giving a rulesOrMapFile
arg that is not an absolute path, it might be useful to apply the default search path for rules.txt
that the menu option uses.
It might be more useful, however, if that default search path put the path to the script file up front (or make it the only default path), so that it is easy to put your rules files with your scripts (without needing an absolute path with autoMap()
).
Regardless of default search path or not, it would be helpful to provide something like a tiled.scriptPath
property so that I can build the absolute path properly.
Describe alternatives you've considered
Currently, the best I have found thus far is to partially hard-code the path:
map.autoMap(FileInfo.path(map.fileName) + "/extensions/foo/foo-rules.txt")
... which requires the user to keep the extension in a specific place.
I am also considering not including automaps with the tilesets and scripts, and just scripting it all instead. More work, perhaps (could be less work, given the number of automaps required), but more flexibility as well, which I could certainly make use of. On the other hand, scripts might be more intimidating for users to mod than automaps are.