New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need short and consistent --export-format #1382

Closed
buckle2000 opened this Issue Oct 22, 2016 · 6 comments

Comments

3 participants
@buckle2000
Contributor

buckle2000 commented Oct 22, 2016

Currently --export-format's output varies from machine to machine.

Format like lua is better than "Lua files (*.lua)" because it can be used on a different machine without changing build script.

@buckle2000 buckle2000 changed the title from Need clear --export-format to Need short and consistent --export-format Oct 22, 2016

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Oct 22, 2016

Owner

That's right. Formats should probably have some explicit short name for this, since the file extension is not guaranteed to be unique.

Note that in this particular case, you can just leave out the --export-format parameter, because the Lua format will be used automatically based on the file extension.

Owner

bjorn commented Oct 22, 2016

That's right. Formats should probably have some explicit short name for this, since the file extension is not guaranteed to be unique.

Note that in this particular case, you can just leave out the --export-format parameter, because the Lua format will be used automatically based on the file extension.

@buckle2000

This comment has been minimized.

Show comment
Hide comment
@buckle2000

buckle2000 Oct 23, 2016

Contributor

In some cases, maps would be exported to lua files but have extension other than .lua (maybe .map). I know I can rename files but with specified format it is just redundant.

Also, I cannot export lua files with tengine plugin turned on.

Contributor

buckle2000 commented Oct 23, 2016

In some cases, maps would be exported to lua files but have extension other than .lua (maybe .map). I know I can rename files but with specified format it is just redundant.

Also, I cannot export lua files with tengine plugin turned on.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Oct 24, 2016

Owner

Good points, and that's also why I agree there should be some kind of short string identifying each format. Unfortunately, the plugin name can't be used either because a single plugin could add multiple formats (currently done by the Python and JSON plugins).

Owner

bjorn commented Oct 24, 2016

Good points, and that's also why I agree there should be some kind of short string identifying each format. Unfortunately, the plugin name can't be used either because a single plugin could add multiple formats (currently done by the Python and JSON plugins).

@josefnpat

This comment has been minimized.

Show comment
Hide comment
@josefnpat

josefnpat Nov 1, 2016

Originally I came here to mention that "Lua files (*.lua)" as an argument is odd and unwieldy, but honestly, I think it's good. It takes the guesswork out of what it's exporting as, especially since the there might be multiple object structures for future Lua exports (e.g. "Tiled Lua File (*.lua)" or "<Possibly very specific framework that's popular but refuses to work with Tiled> Lua File (*.lua)".

The real problem here is that when one runs tiled --export-formats it doesn't specifically mention that the string should be what is the list.

For example,

seppi@seppi7:~♠ tiled --export-formats
Export formats:
  "CSV files (*.csv)"
  "Lua files (*.lua)"
  "Json map files (*.json)"
  "JavaScript map files (*.js)"

I was confused at first why --export-map lua input.tmx didn't work. Lua is in the list! (My first guess was the fact that I didn't capitalize "Lua"). On a whim, I tried the string, and was happy to see data popping up from my pipeline.

Maybe it would be nice to explain that the strings shown are the input args, or show a quick example to squash any doubt:

seppi@seppi7:~♠ tiled --export-formats
Export format arguments:
  "CSV files (*.csv)"
  "Lua files (*.lua)"
  "Json map files (*.json)"
  "JavaScript map files (*.js)"

Example:
tiled --export-map "CSV files (*.csv)" foo.tmx

josefnpat commented Nov 1, 2016

Originally I came here to mention that "Lua files (*.lua)" as an argument is odd and unwieldy, but honestly, I think it's good. It takes the guesswork out of what it's exporting as, especially since the there might be multiple object structures for future Lua exports (e.g. "Tiled Lua File (*.lua)" or "<Possibly very specific framework that's popular but refuses to work with Tiled> Lua File (*.lua)".

The real problem here is that when one runs tiled --export-formats it doesn't specifically mention that the string should be what is the list.

For example,

seppi@seppi7:~♠ tiled --export-formats
Export formats:
  "CSV files (*.csv)"
  "Lua files (*.lua)"
  "Json map files (*.json)"
  "JavaScript map files (*.js)"

I was confused at first why --export-map lua input.tmx didn't work. Lua is in the list! (My first guess was the fact that I didn't capitalize "Lua"). On a whim, I tried the string, and was happy to see data popping up from my pipeline.

Maybe it would be nice to explain that the strings shown are the input args, or show a quick example to squash any doubt:

seppi@seppi7:~♠ tiled --export-formats
Export format arguments:
  "CSV files (*.csv)"
  "Lua files (*.lua)"
  "Json map files (*.json)"
  "JavaScript map files (*.js)"

Example:
tiled --export-map "CSV files (*.csv)" foo.tmx
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Nov 2, 2016

Owner

@josefnpat Good suggestion, but the original issue that the format depends on the locale of the machine (since it uses a translated string) still needs to be fixed as well. Hence I would still introduce short strings to identify these formats, And I think it will then be clear enough, for example like:

$ tiled --export-formats
Export formats:
  csv
  js
  json
  lua
  te4

Usage:
  tiled --export-map [format] <source> <target>

Here te4 actually also uses the .lua extension, but this way it is clearly labeled as the specific format that it is.

Owner

bjorn commented Nov 2, 2016

@josefnpat Good suggestion, but the original issue that the format depends on the locale of the machine (since it uses a translated string) still needs to be fixed as well. Hence I would still introduce short strings to identify these formats, And I think it will then be clear enough, for example like:

$ tiled --export-formats
Export formats:
  csv
  js
  json
  lua
  te4

Usage:
  tiled --export-map [format] <source> <target>

Here te4 actually also uses the .lua extension, but this way it is clearly labeled as the specific format that it is.

@buckle2000

This comment has been minimized.

Show comment
Hide comment
@buckle2000

buckle2000 Nov 4, 2016

Contributor

I think plugins should declare format name explicitly in code.
Something like lua_tiled_map is better than "Lua files (*.lua)"

Contributor

buckle2000 commented Nov 4, 2016

I think plugins should declare format name explicitly in code.
Something like lua_tiled_map is better than "Lua files (*.lua)"

@bjorn bjorn added this to the Tiled 1.0 milestone Jan 13, 2017

@bjorn bjorn added this to TODO in Roadmap Feb 13, 2017

@bjorn bjorn closed this in 6dc2213 Feb 28, 2017

@bjorn bjorn moved this from Tiled 1.0 to Recently Completed in Roadmap Feb 28, 2017

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