ldtk icon indicating copy to clipboard operation
ldtk copied to clipboard

Import entites in sequence of creation

Open zissakos opened this issue 10 months ago • 1 comments

For my racing game I set the track checkpoints as entites such that they form the logical ideal line through the track. Naturally, when importing these, the sequence becomes important. Since my track is a world consisting of several levels, I cannot rely on the sequence in the file. I need to order by "creationdate".

What is the best practice to import entities in the sequence they were created in LDtk?

I was also thinking about a custom INT value for my entity, but then I would need an AUTOINCREMENT flag, which currently is not supported. Has this ever been discussed before?

I discovered that sorting by IID works, but is it guaranteed? (does IID creation consider time?)

zissakos avatar Jan 12 '26 12:01 zissakos

You can add a "next checkpoint" field in your entity that is a reference the next checkpoint entity..... so in the editor you explicitly link them (you can do that visually!), and when importing you treat that as a linked-list. It’s better then increment because you can easily add points in the middle

mathias-a-la-basse avatar Jan 13 '26 21:01 mathias-a-la-basse