[QUESTION] ABOUT "TYPE" CHANGE #3406
TheMaverickProgrammer posted onGitHub
In Tiled 1.9.0 you change "type" to "class". My game engine uses "type" specifically to look for and create certain objects. The docs say "added Class support". Does this mean it is safe to quickly patch our code and allow "class" to be synonymous with "type" for this new version?
In the future, please don't select the Bug option if you're opening an Issue about something that isn't a bug. If your issue is neither a Feature or a Bug, you can open a blank issue.
I did basically what you described in my engine, and it works just fine, I haven't run into any issues so far. I only did this for things that could have types before though, for e.g. Layers and Maps, which didn't have types before 1.9, I would only support "class". I guess ideally, we should check the map file's version, and only look for "class" in maps of version 1.9 or greater. Maps saved in 1.8 compatibility mode (to keep using "type" instead of "class" for Tiles and Objects) have 1.8 as their version, even when saved in 1.9. The change from "type" to "class" was just for consistency with new features and for clearer semantics, there's no new "type" with different meaning or anything, and there isn't likely to be, so I think making them synonymous for Objects and Tiles should be safe enough.
It made me select an issue type iirc.
It made me select an issue type iirc.
The option to open a blank issue is easy to miss, but it is there:
I think this UI is the same for most GitHub repos with issue templates, so if you run into this again, check there.
ok. I will wait for more people (or the tool author) to confirm this is safe. otherwise we're still not convinced long-term to make this change in our engine.
That doesnt answer my direct question. And there is clearly more to this
based on what the other user has said: that custom data uses types
. Get
outta here with your read-the-docs unhelpful parroting.
On Thu, Jul 14, 2022, 5:01 AM IronPowerTGA @.***> wrote:
Read the tmx-map-format document https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#object
class: The class of the object. An arbitrary string. (defaults to “”, renamed from type since 1.9)
— Reply to this email directly, view it on GitHub https://github.com/mapeditor/tiled/issues/3406#issuecomment-1184187680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAWMPL7RUWPQB5XRQHJOE3VT7JPRANCNFSM53D5IAHQ . You are receiving this because you authored the thread.Message ID: @.***>
Please refrain from ad hominem attacks, they're not helpful and they don't help you make your case.
As I wrote in my earlier post, but in too many words: It is safe to make "class" and "type" synonyms, but only for Objects and Tiles, not for anything else (not for custom Properties, where "type" has its own meaning, and not Maps, Layers, Tilesets, Terrain Sets, Terrains, which have never had a "type" and now have "class").
eishiya is more helpful and informed here. Thank you eishiya for the specifics.