Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

Custom properties of entities #1094

Closed
christopho opened this issue Oct 16, 2017 · 8 comments
Closed

Custom properties of entities #1094

christopho opened this issue Oct 16, 2017 · 8 comments
Assignees
Milestone

Comments

@christopho
Copy link
Collaborator

Allow to add any property (key and value) to any type of entity.

https://files.gitter.im/solarus-games/Lobby/vMVf/image.png

@Diarandor
Copy link
Contributor

This is great. I was thinking in a feature like this a few days ago.

I am not sure but, shouldn't this be in the Editor's repo?

@christopho
Copy link
Collaborator Author

Yes but the engine still has to support the updated data file format and to provide a Lua API to get/set properties.

@CJBok
Copy link

CJBok commented Oct 16, 2017

Awesome stuff!

@Diarandor
Copy link
Contributor

Will these properties appear as a parameter for the creation event? I mean: entity:on_created(properties_list).

Or there will be a specific function to recover the list of properties? I mean: entity:get_initial_properties().

@christopho
Copy link
Collaborator Author

There will be entity:get_property() and entity:set_property().
Or entity:get_field()/entity:set_field(), I am not sure :)

@Diarandor
Copy link
Contributor

I think it could be convenient to allow to recover that list somehow, or at least the list of keys.
For instance, if we want to make a script that clones entities (of many types), we cannot know which were the initial properties because we cannot access that info.

@CJBok
Copy link

CJBok commented Oct 17, 2017

I would vote for entity:get_property() and entity:set_property().

Also can the same be done on the actual map as well? Would be nice to have extra properties on the map as well :)

@Diarandor
Copy link
Contributor

@CJBok: I think so. The issue seems to me not only about the engine, but also about the Map Editor, as it can be seen in the attached image.

@christopho christopho changed the title Custom fields of entities Custom properties of entities Jan 30, 2018
@christopho christopho added this to the v1.6 milestone Jan 30, 2018
@christopho christopho self-assigned this Jan 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants