Closed christopho closed 6 years ago
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?
Yes but the engine still has to support the updated data file format and to provide a Lua API to get/set properties.
Awesome stuff!
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().
There will be entity:get_property() and entity:set_property(). Or entity:get_field()/entity:set_field(), I am not sure :)
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.
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 :)
@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.
Allow to add any property (key and value) to any type of entity.
https://files.gitter.im/solarus-games/Lobby/vMVf/image.png