Right now, the prop-values in Tiled are somewhat loosely defined - they are all essentially strings, but some of them are sometimes automatically converted to numbers or booleans, and some strings could be lists… some of the code relies on Lua’s auto-conversion, which does what you intend most of the time, but snags you when you don’t expect it. This ambiguity leads to subtle errors and patch-code that sometimes converts “true” into true, but not always, and you can only do it when you “know” that the user meant true and not “true”. (I’ve been bitten by this a few times already)
The config files for Lime, however, use json throughout, and there is no ambiguity - nice and clean.
My suggestion is to start using json also for the Tiled prop-values.
This would allow you to specify the difference between true and “true”, 42 and “42”, null as nil, lists as [1,2,3], etc.,etc.
It would also make the format specification between Tiled props and config files consistent.
The only issue is that it would break much of what is already there if you would simply make the switch…
Unless… you would define a special Tiled property, like “*JSON-FORMAT*”, which would indicate to the Lime parser that all property values defined for this Tiled-bugger are defined in json-format.
(Lime would have to look for this special prop first before it starts parsing and interpreting the props-values of the XML…). Kind of a hack to provide backwards compatibility.
Comments?
-FrankS.
[import]uid: 8093 topic_id: 6937 reply_id: 306937[/import]