The relevant code segment in lime-tile.lua in Tile:create() is the following:
[lua]…
for i=1, #properties, 1 do
– Read in the Config file data if it has one, otherwise it is a normal property
if properties[i].name == “configFile” then
readInConfigFile(properties[i].value, self)
else
self:addProperty(properties[i])
end
end
…[/lua]
If I understand it well, then the Tiled-set properties are read-in, and made into Lime-properties for the tile.
The issue is with the sequence, where the “configFile” property is treated like any other, which means that those properties read before the config one is encountered will potentially be overwritten by the config-file props, while those that are read after the config file is dealt with, will overwrite those set by the config file props…
You probably want to first read and deal with the configFile before you go over the other Tiled props, other wise you have a behavior where the set property value depends on whether it is encountered before or after the configFile-property…
A possible solutions is to loop twice - first to deal with any configFile, then to deal with the other props:
[lua]…
for i=1, #properties, 1 do
– Read in the Config file data if it has one, otherwise it is a normal property
if properties[i].name == “configFile” then
readInConfigFile(properties[i].value, self)
break
end
end
for i=1, #properties, 1 do
– Read in the Config file data if it has one, otherwise it is a normal property
if properties[i].name ~= “configFile” then
self:addProperty(properties[i])
end
end
…[/lua]
-Frank.
-Frank.
[import]uid: 8093 topic_id: 6896 reply_id: 306896[/import]