.xml file extension for Unity support #358

Closed
Uncade opened this Issue Feb 14, 2013 · 13 comments

Comments

Projects
None yet
5 participants

Uncade commented Feb 14, 2013

I'm on a mac, and just adding .xml when saving doesn't work, as it will just tack on the .tmx anyways.

Here's the original issue post:
I was wondering if anyone could add support for saving and loading tilemaps with the .xml file extension instead of .tmx.

If not, could someone more familiar with the source code point me in the right direction so I can add the feature in myself?

The reason for the feature is that Unity won't support files with the .tmx extension, so I have to manually change them to .xml. Normally this wouldn't be a big deal, but I'm using Tiled to design level chunks for a procedurally generated platformer, so the number of tilemaps will reach the thousands. Also, if you wanna check out the game it's at http://www.AnotherCastleTheGame.com
Screen Shot 2013-02-14 at 12 38 37 PM

Contributor

Ablu commented Feb 14, 2013

This issue is #357. You could have just reopened that one as @bjorn said.

Uncade commented Feb 14, 2013

How does one reopen an issue? I have rarely used github, and couldn't find where to do that. After a quick google search I found something that said I might need admin privileges, so I posted a new issue. My bad if I just missed something obvious.

Contributor

Ablu commented Feb 14, 2013

Ah right. Sorry. It looks like even the creator of the issue is unable to reopen it.

Sorry ;)

Owner

bjorn commented Feb 14, 2013

Ah, good to know reporters can't reopen issues (and how surprising, I think). In any case, you can still comment on closed issues and I would have reopened the other one in this case.

I noticed from your screenshot that you seem to be using a very old version of Tiled. Please see if you still have this problem with Tiled 0.9. I have a hunch it may be fixed since this problem does not exist on Linux or Windows (I do not have access to a Mac to verify).

jgoalby commented Feb 14, 2013

I can confirm that you cannot change the extension to xml in 0.9.0 version of tiled which I am using right now.

The op has plenty of other options including writing a shell script. If they don't mind paying then Hazel would be an ideal solution. Automator is also a good way to solve the issue of renaming the files. There doesn't really have to be any additional manual labor involved in renaming to the xml extension using one of the techniques I mentioned.

That said, it would be nice to have xml as an entry in the dropdown.

Uncade commented Feb 14, 2013

Just checked with 0.9.0 as well, same issue.

I actually have been using an automator script I found for automatically renaming files, but it ends up taking 10-30 seconds every time. Normally this isn't problematic, but like I said I'll be making thousands of tilemaps and that time adds up.

Owner

bjorn commented Feb 14, 2013

Alright, thanks for checking. Then I guess indeed for solving this problem on Mac the only option would be to include it as a separate entry in the dropdown. Unless there is some way to turn off this restriction, but I guess in general it has its merits.

jgoalby commented Feb 14, 2013

Just in case you are not familiar with Hazel, I would suggest taking a look because it would be useful for other situations too.

http://www.noodlesoft.com/hazel.php

You could set it up to monitor a folder and automatically create xml versions for you.

I have a script that monitors a folder for a changed markdown file and converts it to html (among other things) and then uploads it to a web server.

It is $25 but I think it is worth it in saved time.

A quick look at the source suggests that TmxMapWriter would be a good place to start. If you have the source, and can compile it, then potentially changing the header file to return a different nameFilter may be a quick solution. Note that I have not tried it and will likely get reprimanded by bjorn for making this suggestion :-)

lzantal commented Feb 14, 2013

Why not just use the good old terminal? I have this in one liner in a shell script but you can just copy and paste it into the terminal
for i in *.tmx; do mv "$i" "${i/.tmx}".xml; done
This renames all the tmx files to xml in the current directory, it also accounts for spaces in filenames.

Laszlo
http://twitter.com/LZAntal

On Feb 14, 2013, at 12:42 PM, jgoalby notifications@github.com wrote:

Just in case you are not familiar with Hazel, I would suggest taking a look because it would be useful for other situations too.

http://www.noodlesoft.com/hazel.php

You could set it up to monitor a folder and automatically create xml versions for you.

I have a script that monitors a folder for a changed markdown file and converts it to html (among other things) and then uploads it to a web server.

It is $25 but I think it is worth it in saved time.

A quick look at the source suggests that TmxMapWriter would be a good place to start. If you have the source, and can compile it, then potentially changing the header file to return a different nameFilter may be a quick solution. Note that I have not tried it and will likely get reprimanded by bjorn for making this suggestion :-)


Reply to this email directly or view it on GitHub.

Contributor

Ablu commented Feb 14, 2013

Saving as .xml works fine here:
2013-02-14-220315_641x442_scrot

Owner

bjorn commented Feb 14, 2013

@Ablu Yes, the problem does not exist on Linux or Windows. Seems to be a restriction of the Mac file dialog only.

Uncade commented Feb 14, 2013

@jgoalby thanks, hazel might work for my situation, checking it out now

@lzantal terminal wouldn't be efficient, as I'm working on and testing the maps one at a time, instead of as a batch.

Owner

bjorn commented Jun 23, 2013

Actually I just noticed this is a duplicate of #262.

@bjorn bjorn closed this Jun 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment