tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Object templates

Open zamp opened this issue 15 years ago • 14 comments

Would be nice if you could set up object templates so when you create new objects you could just pick one from a list and drag n drop it on the map. Maybe double click on list to edit a template. The templates should have the object type and properties with default values. http://juvo.se/tbb3.jpg here's a mashup of what it could look like.

zamp avatar Sep 06 '11 10:09 zamp

#78 was a duplicate of this and was closed therefore.

stefanbeller avatar Sep 17 '11 07:09 stefanbeller

This is similar to #24 but I prefer this solution to introducing additional buttons on the tool bar.

bjorn avatar Sep 17 '11 16:09 bjorn

I am definitely looking forward to this feature. Object types are nice but those don't have associated properties. A palette for easily creating these objects is definitely something that would help.

laughsuggestion avatar Jan 16 '12 19:01 laughsuggestion

I was about to suggest something similar, but this could be a much better idea =D Could be a good way to define a "Type", using left click on an previously created object (with all sets of properties that we want), and selecting "Define Prototipe" or "Add To Library" (or something like that), so... this is similar to "Copy" an object, but in this case, can be done a lot of times, and through various projects.

NinjaFighter avatar Feb 13 '12 21:02 NinjaFighter

Any news on this?

AbelToy avatar Mar 25 '12 21:03 AbelToy

Nope. Hasn't happened.

Sent from my iPhone

On Mar 25, 2012, at 2:09 PM, "Abel Toy i Díez" [email protected] wrote:

Any news on this?


Reply to this email directly or view it on GitHub: https://github.com/bjorn/tiled/issues/70#issuecomment-4684701

laughsuggestion avatar Mar 25 '12 21:03 laughsuggestion

This feature screams to be implemented xd. Is very tough to make one object (i.e: a tree) from several objects (i.e: the different parts of the tree image), just see what I'm talking about:

Captura de pantalla de 2013-03-07 20:58:18

what a mess! xd. For sure this feature should group (or something alike) the tiles involved on making the actual object so you can access them easily and not dealing with separate objects, meanwhile I'll try to polish my "algorithm" or trying another approximation to solve my issue.

PS: This is the actual look of my test from the default development branch:

Captura de pantalla de 2013-03-07 20:59:36

yup, every object is a sprite in the test game, doing a mess with the correct draw order :'|

elzorrorebelde avatar Mar 06 '13 23:03 elzorrorebelde

Damn I would love to see this feature implemented!

Imagine you define an object (eg: a platform), you give it some basic properties (like minX, minY, maxX, maxY) to what you want it to do.

Now imagine you are doing a platformer, you will probably use dozen if not hundred of those objects.

And after using lots of them, you have the idea of adding custom collision to your platform (like it should collide from above but not from under. You will have to cycle through all your platform object and edit them all to add the collision : top / collision : bottom / collision : both custom property. What a hassle to maintain!

Of course you could just do it in your code, checking the id of the object and adding the behaviour, but it would really be a mess and not faster.

I think having template of object (aka prefab (cf unity3D)) would really be a neat feature for any "medium to big" sized project.

downstroy avatar Jan 21 '15 15:01 downstroy

@zamp Is there any chance you would be able to restore the mashup you linked to in your original request? I think it could be very helpful for anybody who could be interested to work on this feature (which could be this summer, as a Google Summer of Code project).

bjorn avatar Mar 21 '17 12:03 bjorn

In Unity, unchanged instance properties synchronizes with prefab properties. I think tracking prefab property changes will good feature. In addition it can reduce file size a little bit, by saving only changed properties.

For now have no good idea how to implement object from several tiles. May be the library object editor window should provide like map editor interface (with grid for tiles)

i-ka avatar Mar 25 '17 09:03 i-ka

@bjorn sorry. I don't have the file anymore nor can I recall what it looked like.

zamp avatar Mar 30 '17 15:03 zamp

@zamp Alright, no problem. Thanks for letting us know!

bjorn avatar Mar 30 '17 20:03 bjorn

I'm closing this issue since the feature is now implemented, thanks to @thabetx's Google Summer of Code project! Check out the documentation and be sure to try it out by using a development snapshot (available at itch.io).

Any feedback would be very welcome as we will now be working towards the Tiled 1.1 release.

bjorn avatar Sep 06 '17 09:09 bjorn

For reference, here are the issues I've already opened covering remaining tasks:

  • Allow replacing existing objects with template instances #1722
  • Allow deleting object templates from a template group #1723
  • Allow unloading a template group #1724
  • Allow resetting overridden properties individually for template instances #1725
  • Allow locking template properties #1726

bjorn avatar Sep 06 '17 11:09 bjorn