Skip to content
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

A suggest about Object Types #2872

Closed
refox1 opened this issue Jul 23, 2020 · 2 comments
Closed

A suggest about Object Types #2872

refox1 opened this issue Jul 23, 2020 · 2 comments

Comments

@refox1
Copy link

refox1 commented Jul 23, 2020

Hi , we are developing a 2D game with tiled.

Many troubles are found in Object Types,
If can add a description of the type in the custom Object Types , it will be much more convenient to use,
in many cases, the type is represented by a number or enmu, and always need go back to the code to see what it is.

There is another problem,
Types with default values are not saved to the TMX file, although the file size is smaller, but it needs to be associate ”objecttypes.xml“.
It's not a good design ,TMX does not describe itself, sometimes it's easy to make mistakes.

Best wishes .
Thank you very much.

@refox1
Copy link
Author

refox1 commented Jul 24, 2020

by the way, it would be better if could add the list or popupenum,
now the custom Object Types is a little simple.

@bjorn
Copy link
Member

bjorn commented Aug 12, 2020

Many troubles are found in Object Types,
If can add a description of the type in the custom Object Types , it will be much more convenient to use,
in many cases, the type is represented by a number or enum, and always need go back to the code to see what it is.

Indeed there is currently no support for custom "enum" types. To make your map more descriptive, I would suggest to use a string instead of a number to set the value. Eventually we will add support for defining custom enums, this is covered by issue #1211. I agree adding a "description" field to the custom properties would also be nice.

There is another problem,
Types with default values are not saved to the TMX file, although the file size is smaller, but it needs to be associate ”objecttypes.xml“.
It's not a good design ,TMX does not describe itself, sometimes it's easy to make mistakes.

This is because explicitly including the values counts as "overriding" of the default value, so when we'd explicitly save all the values for each object instance and then you change a default value (for an object type property, a tile property or a template property), this change would not apply to any of the already placed objects, which would generally get annoying.

However, you can export your map and "resolve" these properties. For this there is the export option "Resolve object types and properties" in Preferences > General > Export Options.

I'll close this issue because the enum feature is already covered.

@bjorn bjorn closed this as completed Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants