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

Object resort #1168

Closed
ghost opened this issue Jan 4, 2016 · 10 comments
Closed

Object resort #1168

ghost opened this issue Jan 4, 2016 · 10 comments

Comments

@ghost
Copy link

ghost commented Jan 4, 2016

would it be possible to add in object resorting when/if objects are deleted from a layer, Currently it causes ghost objects that don't exist and causes issues :(

@bjorn
Copy link
Member

bjorn commented Jan 4, 2016

Can you be a little more specific? I'm not really sure what you're talking about. Nothing should remain after deleting objects.

@karai17
Copy link

karai17 commented Jan 5, 2016

I think what he means is that if you create 5 objects, and delete the third one, the ids remain as 1 2 4 5 instead of resorting to 1 2 3 4. This was a problem last night while debugging STI since I commonly use ipairs to loop through map.objects but there was a hole in the table since the map.lua file's first object started with an id of 4.

@bjorn
Copy link
Member

bjorn commented Jan 5, 2016

Well, this is intentional because these IDs were meant to be used to uniquely refer to objects from custom properties or even external files. Renumbering them would destroy such references.

Also, a gap in the range of IDs is not a "ghost object", so I'm not sure if that's what he meant.

@karai17
Copy link

karai17 commented Jan 5, 2016

That seems strange to me. I can understand referring to them from external
programs (which renumbering would allow) but tying objects together via
custom properties seems like a very niche use case.


Landon Manning
[email protected]

On 5 January 2016 at 18:19, Thorbjørn Lindeijer [email protected]
wrote:

Well, this is intentional because these IDs were meant to be used to
uniquely refer to objects from custom properties or even external files.
Renumbering them would destroy such references.


Reply to this email directly or view it on GitHub
#1168 (comment).

@bjorn
Copy link
Member

bjorn commented Jan 6, 2016

tying objects together via custom properties seems like a very niche use case

That is only because it is still a little clumsy since custom properties are always strings. Once property types are implemented, there can be an "object reference" type, allowing Tiled to make it easier to make links as well as to render links.

@karai17
Copy link

karai17 commented Jan 6, 2016

How would you export this link to, say, Lua?


Landon Manning
[email protected]

On 5 January 2016 at 20:12, Thorbjørn Lindeijer [email protected]
wrote:

tying objects together via custom properties seems like a very niche use
case

That is only because it is still a little clumsy since custom properties
are always strings. Once property types are implemented, there can be an
"object reference" type, allowing Tiled to make it easier to make links as
well as to render links.


Reply to this email directly or view it on GitHub
#1168 (comment).

@bjorn
Copy link
Member

bjorn commented Jan 6, 2016

How would you export this link to, say, Lua?

Just as the number that it is, right?

@karai17
Copy link

karai17 commented Jan 6, 2016

Hm. I still don't really like it, but I guess it's not up to me. I'd prefer
an ordered list of objects. You could always use the object's name as a
custom property.


Landon Manning
[email protected]

On 5 January 2016 at 20:26, Thorbjørn Lindeijer [email protected]
wrote:

How would you export this link to, say, Lua?

Just as the number that it is, right?


Reply to this email directly or view it on GitHub
#1168 (comment).

@bjorn
Copy link
Member

bjorn commented Jan 6, 2016

You could always use the object's name as a custom property.

Names are not unique, and they could change at will, breaking an unknown set of links. Of course naming has also advantages, but in supporting the connecting of objects explicitly in Tiled (#707), they don't really work.

@bjorn
Copy link
Member

bjorn commented Mar 20, 2016

Closing this since the original poster never clarified their problem.

@bjorn bjorn closed this as completed Mar 20, 2016
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